Fix translation error

This commit is contained in:
Marco De Araujo 2026-01-03 08:45:13 -04:00
parent 6e94081db2
commit 5a77198344
4 changed files with 22 additions and 23 deletions

7
.vscode/launch.json vendored
View file

@ -11,10 +11,13 @@
"cargo": {
"args": [
"run",
"-- --base-url=http://192.168.69.10:3001/ --slug formgen",
"--bin=uptime-kuma-dashboard"
]
},
"args": []
"args": [
"--base-url=http://192.168.69.10:3001/",
"--slug=formgen",
]
},
{
"name": "Debug unit tests in executable 'uptime-kuma-dashboard'",

View file

@ -48,12 +48,8 @@ pub fn t(key: &str) -> String {
pub fn t_with_args(key: &str, args: &HashMap<&'static str, String>) -> String {
let mut map = HashMap::new();
let args_map: &HashMap<Cow<'static, _>, FluentValue<'_>>;
args_map = {
for (key, value) in args {
map.insert(Cow::Borrowed(*key), FluentValue::from(value.clone()));
}
&map
};
LOCALES.lookup_with_args(&get_system_locale(), key, args_map)
for (key, value) in args {
map.insert(Cow::Borrowed(*key), FluentValue::from(value));
}
LOCALES.lookup_with_args(&get_system_locale(), key, &map)
}

View file

@ -6,9 +6,9 @@ Response = Response
response = response
invalid-json-status-page = ❌ Error parssing status page JSON
invalid-json-heartbeat = ❌ Error parssing heartbeat JSON
invalid-uptime-key-format = Invalid format for uptime key. Expected format "monitorID_period". Received key: {key}
invalid-monitor-id = Invalid monitor ID: {id}
invalid-period-hours = Invalid period in hours: {hours}
invalid-uptime-key-format = Invalid format for uptime key. Expected format "monitorID_period". Received key: {$key}
invalid-monitor-id = Invalid monitor ID: {$id}
invalid-period-hours = Invalid period in hours: {$hours}
loading = Loading...
monitors = Monitors
unknown = Unknown
@ -18,11 +18,11 @@ status = Status
error = Error
dashboard-header = Status Dashboard
never = Never
auto-update-failed = Automatic update failed: {error}
update-fail = Failed to update data: {error}
auto-update-failed = Automatic update failed: {$error}
update-fail = Failed to update data: {$error}
now = Now
uptime = Uptime
history = History
auto-update-enabled = Auto-update enabled ({interval} min)
update-failed = Update failed: {error}
auto-update-enabled = Auto-update enabled ({$interval} min)
update-failed = Update failed: {$error}
key-to-exit = Press 'q' to exit

View file

@ -5,10 +5,10 @@ missing_url = ❌ URL não fornecida. Use --url ou a variável de ambiente UPTIM
Response = Resposta
response = resposta
invalid-json-status-page = ❌ Falha ao parsear JSON do status page
invalid-json-heartbeat = Falha ao parsear JSON do heartbeat
invalid-uptime-key-format = Formato inválido na chave de uptime. Chave esperada no formato "monitorID_periodo". Chave recebida: {key}
invalid-monitor-id = ID de monitor inválido: {id}
invalid-period-hours = Período em horas inválido: {hours}
invalid-json-heartbeat = Falha ao parsear JSON do heartbeat
invalid-uptime-key-format = Formato inválido na chave de uptime. Chave esperada no formato "monitorID_periodo". Chave recebida: {$key}
invalid-monitor-id = ID de monitor inválido: {$id}
invalid-period-hours = Período em horas inválido: {$hours}
loading = Carregando...
monitors = Monitors
monitor = Monitor
@ -23,6 +23,6 @@ auto-update-failed = Falha na atualização automática
update-fail = Falha ao atualizar dados
now = Agora
history = Historico
auto-update-enabled = Auto-atualização ativada ({interval} min)
update-failed = Falha na atualização: {error}
auto-update-enabled = Auto-atualização ativada ({$interval} min)
update-failed = Falha na atualização: {$error}
key-to-exit = Pressione 'q' para sair