* [PATCH proxmox-i18n] fix formats in translations
@ 2026-06-16 14:01 Maximiliano Sandoval
0 siblings, 0 replies; only message in thread
From: Maximiliano Sandoval @ 2026-06-16 14:01 UTC (permalink / raw)
To: pve-devel
Detected with `make check` using gettext 0.26.
Strings were fixed in place where the fix is obvious, e.g. {0} -> {n}.
Else if any of the variables in msgid_plural were missing:
- If msgstr[n] is not in english, instead of trying to guess the correct
translation we set it to "" to be safe.
- If msgstr[n] is in english, it is set to "", this was likely probably
a translator error and might need reviewing anyways.
In the case of Ukrainian and Russian the first plural form (msgstr[0])
applies when n=1,21,31,41,... so msgfmt will consider it an error if any
variable defined in msgid_plural are missing in msgstr[0].
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
Notes:
The script used was
```perl
use Locale::PO;
foreach my $la (@ARGV) {
my $file = "$la.po";
my $dest = "$la.with-formats.po";
my $po = Locale::PO->load_file_asarray($file, 'utf8');
die "The file $file does no exist\n" if !scalar(@$po);
sub is_formated {
my ($entry,) = @_;
if ($entry->{msgid} =~ /{[a-z0-9_]*}/) {
return 1;
} elsif ($entry->{msgid_plural} =~ /{[a-z0-9_]*}/) {
return 1;
}
return 0;
}
# Filter out obsolete entries and process flags in one pass
my @clean_po = grep {!$_->{obsolete}} @$po;
foreach (@clean_po) {
my $entry = $_;
if ($entry->{obsolete}) {
print "$entry->{msgid}\n";
next;
}
if ($entry->has_flag('javascript-format')) {
$entry->remove_flag('javascript-format');
}
if (!$entry->has_flag('rust-format') && is_formated($entry)) {
$entry->add_flag('rust-format');
}
}
Locale::PO->save_file_fromarray($dest, \@clean_po, 'utf8');
}
```
and the check was done with
```
flatpak run --command=msgfmt --filesystem=home org.freedesktop.Platform//25.08 --check "$LA".with-formats.po
```
de.po | 2 +-
es.po | 2 +-
ja.po | 4 +---
ko.po | 4 ++--
ru.po | 20 ++++++++++----------
ukr.po | 20 ++++++++++----------
6 files changed, 25 insertions(+), 27 deletions(-)
diff --git a/de.po b/de.po
index fa211cf6..c1a5c88a 100644
--- a/de.po
+++ b/de.po
@@ -116,7 +116,7 @@ msgstr[1] "{n} Kerne"
msgid "1 Node"
msgid_plural "{0} Nodes"
msgstr[0] "1 Knoten"
-msgstr[1] "{n} Knoten"
+msgstr[1] "{0} Knoten"
#: pve-yew-mobile-gui/src/pages/page_node_status/dashboard_panel.rs:80
#: proxmox-yew-comp/src/form/pve/qemu_property/qemu_processor_property.rs:30
diff --git a/es.po b/es.po
index cc8bb23e..adc5fef4 100644
--- a/es.po
+++ b/es.po
@@ -15138,7 +15138,7 @@ msgid ""
"subscription on that node too."
msgstr ""
"¿Desea eliminar {key} del conjunto de llaves? Todavía está asignada a "
-"{remote}/{node); la asignación se liberará sin eliminar ninguna suscripción "
+"{remote}/{node}; la asignación se liberará sin eliminar ninguna suscripción "
"en el nodo remoto. Utilice primero la opción “Limpiar llave” en el panel "
"“Estado de suscripcion del nodo” para liberar también una suscripción en ese "
"nodo."
diff --git a/ja.po b/ja.po
index b52a1b88..f2274760 100644
--- a/ja.po
+++ b/ja.po
@@ -8252,9 +8252,7 @@ msgstr "IPフィルタ"
#: proxmox-backup/www/window/S3ClientEdit.js:52
msgid "IP or FQDN S3 endpoint (allows {{bucket}} or {{region}} templating)"
-msgstr ""
-"IP又は FQDN S3 エンドポイント({bucket}} 又は {{region}} テンプレート使用も可"
-"能"
+msgstr "IP又は FQDN S3 エンドポイント{{bucket}} 又は {{region}} テンプレート使用も可能"
#: pve-manager/www/manager6/dc/ClusterEdit.js:261
msgid "IP resolved by node's hostname"
diff --git a/ko.po b/ko.po
index 5ae6c56c..897f4ba3 100644
--- a/ko.po
+++ b/ko.po
@@ -101,7 +101,7 @@ msgstr "/some/path"
#: pve-yew-mobile-gui/src/pages/page_dashboard.rs:135
msgid "1 CPU"
msgid_plural "{n} CPUs"
-msgstr[0] "1 CPU"
+msgstr[0] ""
#: pve-yew-mobile-gui/src/pages/page_node_status/dashboard_panel.rs:79
#: proxmox-yew-comp/src/form/pve/qemu_property/qemu_processor_property.rs:29
@@ -12426,7 +12426,7 @@ msgstr "On-site"
#: proxmox-yew-comp/src/apt_package_manager.rs:481
msgid "One item"
msgid_plural "{n} items"
-msgstr[0] "{}개의 항목"
+msgstr[0] "{n}개의 항목"
#: proxmox-datacenter-manager/ui/src/configuration/subscription_keys.rs:432
msgid ""
diff --git a/ru.po b/ru.po
index 2804ac33..80c22f0c 100644
--- a/ru.po
+++ b/ru.po
@@ -49,7 +49,7 @@ msgstr "Потоков рабочих процессов"
#: pve-yew-mobile-gui/src/pages/page_node_status/dashboard_panel.rs:87
msgid "% of one threads"
msgid_plural "% of {n} threads"
-msgstr[0] "% использования одного потока"
+msgstr[0] ""
msgstr[1] "% использования {n} потоков"
msgstr[2] "% использования {n} потоков"
@@ -111,7 +111,7 @@ msgstr[2] ""
#: proxmox-yew-comp/src/form/pve/qemu_property/qemu_processor_property.rs:29
msgid "1 Core"
msgid_plural "{n} Cores"
-msgstr[0] "1 ядро"
+msgstr[0] ""
msgstr[1] "{n} ядра"
msgstr[2] "{n} ядер"
@@ -128,7 +128,7 @@ msgstr[2] "Узел"
#: proxmox-yew-comp/src/node_info.rs:242
msgid "1 Socket"
msgid_plural "{n} Sockets"
-msgstr[0] "1 сокет"
+msgstr[0] ""
msgstr[1] "{n} сокета"
msgstr[2] "{n} сокетов"
@@ -6831,7 +6831,7 @@ msgstr "Не удалось установить соединение ни с о
#: proxmox-datacenter-manager/ui/src/dashboard/remote_panel.rs:102
msgid "Failed to reach one of {0} remotes."
msgid_plural "Failed to reach {n} of {0} remotes."
-msgstr[0] "Не удалось установить соединение с одним удалённым узлом из {0}."
+msgstr[0] ""
msgstr[1] "Не удалось установить соединение с {n} удалёнными узлами из {0}."
msgstr[2] "Не удалось установить соединение с {n} удалёнными узлами из {0}."
@@ -12697,9 +12697,9 @@ msgstr "По месту"
#: proxmox-yew-comp/src/apt_package_manager.rs:481
msgid "One item"
msgid_plural "{n} items"
-msgstr[0] "Один объект"
-msgstr[1] "{} объекта"
-msgstr[2] "{} объектов"
+msgstr[0] ""
+msgstr[1] "{n} объекта"
+msgstr[2] "{n} объектов"
#: proxmox-datacenter-manager/ui/src/configuration/subscription_keys.rs:432
msgid ""
@@ -12710,7 +12710,7 @@ msgstr ""
#: proxmox-datacenter-manager/ui/src/dashboard/node_status_panel.rs:146
msgid "One of {0} nodes online"
msgid_plural "{n} of {0} nodes online"
-msgstr[0] "Один из {0} узлов в сети"
+msgstr[0] ""
msgstr[1] "{n} из {0} узла в сети"
msgstr[2] "{n} из {0} узлов в сети"
@@ -12727,14 +12727,14 @@ msgstr ""
#: proxmox-yew-comp/src/apt_repositories.rs:853
msgid "One repository"
msgid_plural "{n} repositories"
-msgstr[0] "Один репозиторий"
+msgstr[0] ""
msgstr[1] "{n} репозитория"
msgstr[2] "{n} репозиториев"
#: proxmox-datacenter-manager/ui/src/remotes/updates.rs:676
msgid "One update pending"
msgid_plural "{n} updates pending"
-msgstr[0] "Доступно одно обновление"
+msgstr[0] ""
msgstr[1] "Доступно {n} обновления"
msgstr[2] "Доступно {n} обновлений"
diff --git a/ukr.po b/ukr.po
index 855133bc..a5f3cc47 100644
--- a/ukr.po
+++ b/ukr.po
@@ -54,9 +54,9 @@ msgstr "# робочих потоків"
#: pve-yew-mobile-gui/src/pages/page_node_status/dashboard_panel.rs:87
msgid "% of one threads"
msgid_plural "% of {n} threads"
-msgstr[0] "% одного потоку"
-msgstr[1] "# робочих потоків"
-msgstr[2] "# робочих потоків"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
#: proxmox-datacenter-manager/ui/src/configuration/subscription_registry.rs:1239
msgid ""
@@ -114,9 +114,9 @@ msgstr[2] ""
#: proxmox-yew-comp/src/form/pve/qemu_property/qemu_processor_property.rs:29
msgid "1 Core"
msgid_plural "{n} Cores"
-msgstr[0] "1 Ядро"
-msgstr[1] "{n} Cores"
-msgstr[2] "{n} Cores"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
#: proxmox-datacenter-manager/ui/src/dashboard/map.rs:256
#, fuzzy
@@ -131,9 +131,9 @@ msgstr[2] "Вузол"
#: proxmox-yew-comp/src/node_info.rs:242
msgid "1 Socket"
msgid_plural "{n} Sockets"
-msgstr[0] "1 Сокет"
-msgstr[1] "Сокет"
-msgstr[2] "Сокет"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
#: proxmox-backup/www/datastore/OptionView.js:335
msgid "1048576 (0 disables cache)"
@@ -12797,7 +12797,7 @@ msgstr ""
#: proxmox-yew-comp/src/apt_repositories.rs:853
msgid "One repository"
msgid_plural "{n} repositories"
-msgstr[0] "Один репозиторій"
+msgstr[0] ""
msgstr[1] "{n} репозиторія"
msgstr[2] "{n} репозиторіїв"
--
2.47.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-16 14:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-16 14:01 [PATCH proxmox-i18n] fix formats in translations Maximiliano Sandoval
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.