public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH proxmox-i18n] fix formats in translations
Date: Tue, 16 Jun 2026 16:01:33 +0200	[thread overview]
Message-ID: <20260616140135.467696-1-m.sandoval@proxmox.com> (raw)

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





                 reply	other threads:[~2026-06-16 14:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260616140135.467696-1-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal