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": { "cargo": {
"args": [ "args": [
"run", "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'", "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 { pub fn t_with_args(key: &str, args: &HashMap<&'static str, String>) -> String {
let mut map = HashMap::new(); let mut map = HashMap::new();
let args_map: &HashMap<Cow<'static, _>, FluentValue<'_>>;
args_map = {
for (key, value) in args { for (key, value) in args {
map.insert(Cow::Borrowed(*key), FluentValue::from(value.clone())); map.insert(Cow::Borrowed(*key), FluentValue::from(value));
} }
&map LOCALES.lookup_with_args(&get_system_locale(), key, &map)
};
LOCALES.lookup_with_args(&get_system_locale(), key, args_map)
} }

View file

@ -6,9 +6,9 @@ Response = Response
response = response response = response
invalid-json-status-page = ❌ Error parssing status page JSON invalid-json-status-page = ❌ Error parssing status page JSON
invalid-json-heartbeat = ❌ Error parssing heartbeat 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-uptime-key-format = Invalid format for uptime key. Expected format "monitorID_period". Received key: {$key}
invalid-monitor-id = Invalid monitor ID: {id} invalid-monitor-id = Invalid monitor ID: {$id}
invalid-period-hours = Invalid period in hours: {hours} invalid-period-hours = Invalid period in hours: {$hours}
loading = Loading... loading = Loading...
monitors = Monitors monitors = Monitors
unknown = Unknown unknown = Unknown
@ -18,11 +18,11 @@ status = Status
error = Error error = Error
dashboard-header = Status Dashboard dashboard-header = Status Dashboard
never = Never never = Never
auto-update-failed = Automatic update failed: {error} auto-update-failed = Automatic update failed: {$error}
update-fail = Failed to update data: {error} update-fail = Failed to update data: {$error}
now = Now now = Now
uptime = Uptime uptime = Uptime
history = History history = History
auto-update-enabled = Auto-update enabled ({interval} min) auto-update-enabled = Auto-update enabled ({$interval} min)
update-failed = Update failed: {error} update-failed = Update failed: {$error}
key-to-exit = Press 'q' to exit 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
response = resposta response = resposta
invalid-json-status-page = ❌ Falha ao parsear JSON do status page invalid-json-status-page = ❌ Falha ao parsear JSON do status page
invalid-json-heartbeat = Falha ao parsear JSON do heartbeat 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-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-monitor-id = ID de monitor inválido: {$id}
invalid-period-hours = Período em horas inválido: {hours} invalid-period-hours = Período em horas inválido: {$hours}
loading = Carregando... loading = Carregando...
monitors = Monitors monitors = Monitors
monitor = Monitor monitor = Monitor
@ -23,6 +23,6 @@ auto-update-failed = Falha na atualização automática
update-fail = Falha ao atualizar dados update-fail = Falha ao atualizar dados
now = Agora now = Agora
history = Historico history = Historico
auto-update-enabled = Auto-atualização ativada ({interval} min) auto-update-enabled = Auto-atualização ativada ({$interval} min)
update-failed = Falha na atualização: {error} update-failed = Falha na atualização: {$error}
key-to-exit = Pressione 'q' para sair key-to-exit = Pressione 'q' para sair