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 2/2] fix strings with wrong format
Date: Wed,  4 Feb 2026 11:41:35 +0100	[thread overview]
Message-ID: <20260204104150.178904-2-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20260204104150.178904-1-m.sandoval@proxmox.com>

That would fail to be replaced at runtime. Depending on how the string
was replaced at runtime having a broken format can result in either the
string not being replaced at runtime or a crash.

Where it was not clear how to fix the issue the string is left
untranslated.

After this commit the remaining errors are only in ukr.po, ru.po and a
single error in pl.po that can be fixed with [2]. The reported errors in
ukr.po and ru.po need more consideration due to the complexity of their
plural forms.

These were detected with the following script

```python
import polib
from pathlib import Path

dirty = False

def is_rust_format(entry):
    return (
        "{}" in entry.msgid
        or "{0}" in entry.msgid
        or "{n}" in entry.msgid
        or "{}" in entry.msgid_plural
        or "{0}" in entry.msgid_plural
        or "{n}" in entry.msgid_plural
    )

def check_po_file(path):
    po = polib.pofile(path)
    for entry in po:
        if "javascript-format" in entry.flags:
            entry.flags.remove("javascript-format")

        if (
            entry.occurrences
            and all([o.endswith(".rs") for (o, l) in entry.occurrences])
            and is_rust_format(entry)
        ):
            entry.flags.append("rust-format")
            dirty = True

    if dirty:
        po.save(f"{file.stem}.with-formats.po")

root = Path()

for file in root.iterdir():
    if file.suffix == ".po" and ".with-formats" not in file.name:
        check_po_file(file)
```

which attaches the `rust-format` flag to a string. Then later the new po
files are checked with
```
msgfmt --check $PO_FILE
```

with gettext 0.26. This can be done, for example, with
```sh
for f in *.with-formats.po; do flatpak run --command=msgfmt --filesystem=home org.freedesktop.Platform//25.08 --check $f; done
```

for example.

[1] https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html#index-ngettext
[2] https://lore.proxmox.com/all/20260204100736.134697-1-m.sandoval@proxmox.com/

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 ar.po  | 4 ++--
 cs.po  | 4 ++--
 ja.po  | 2 +-
 ko.po  | 4 ++--
 ukr.po | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/ar.po b/ar.po
index 66a34efa..b4ae88c8 100644
--- a/ar.po
+++ b/ar.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: pve-manager 31813246103b2582162f422dc34d8077eaee1e01\n"
 "Report-Msgid-Bugs-To: <support@proxmox.com>\n"
 "POT-Creation-Date: 2025-12-10 15:47+0100\n"
-"PO-Revision-Date: 2025-07-18 10:53+0200\n"
+"PO-Revision-Date: 2026-02-04 10:38+0100\n"
 "Last-Translator: \n"
 "Language-Team: Arabic <support@proxmox.com>\n"
 "Language: ar\n"
@@ -19109,7 +19109,7 @@ msgstr "{0} إلى {1} ({2})"
 #: proxmox-widget-toolkit/src/Utils.js:1121
 #, javascript-format
 msgid "{0}% of {1}"
-msgstr "{0}٪ من {1}"
+msgstr ""
 
 #: proxmox-datacenter-manager/ui/src/pve/lxc/overview.rs:296
 #: proxmox-datacenter-manager/ui/src/pve/qemu/overview.rs:305
diff --git a/cs.po b/cs.po
index 728f23aa..3d38dd7a 100644
--- a/cs.po
+++ b/cs.po
@@ -12,7 +12,7 @@ msgstr ""
 "Project-Id-Version: proxmox-backup 254169f622d891d67de38e8c8c6b9fa8f4af5dc9\n"
 "Report-Msgid-Bugs-To: <support@proxmox.com>\n"
 "POT-Creation-Date: 2025-12-10 15:47+0100\n"
-"PO-Revision-Date: 2025-12-03 08:55+0100\n"
+"PO-Revision-Date: 2026-02-04 10:49+0100\n"
 "Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>\n"
 "Language-Team: Czech <support@proxmox.com>\n"
 "Language: cs\n"
@@ -18882,7 +18882,7 @@ msgstr "{0} {{1} na uzlu {2})"
 #: proxmox-datacenter-manager/ui/src/pve/storage.rs:288
 #: proxmox-datacenter-manager/ui/src/renderer.rs:76
 msgid "{0}% ({1} of {2})"
-msgstr "{0}% {{1} z {2})"
+msgstr "{0}% ({1} z {2})"
 
 #: proxmox-widget-toolkit/src/Utils.js:1121
 #, javascript-format
diff --git a/ja.po b/ja.po
index 485b98c8..3175e191 100644
--- a/ja.po
+++ b/ja.po
@@ -18710,7 +18710,7 @@ msgstr "{1}の {0}"
 
 #: proxmox-datacenter-manager/ui/src/dashboard/node_status_panel.rs:125
 msgid "{0} of {1} nodes are offline"
-msgstr "1}の {0} ノードがオフライン"
+msgstr "{1}の {0} ノードがオフライン"
 
 #. TRANSLATORS: For example "resource on Remote 'HAL 9000'"
 #: proxmox-datacenter-manager/ui/src/dashboard/top_entities.rs:249
diff --git a/ko.po b/ko.po
index e494cabb..64799f54 100644
--- a/ko.po
+++ b/ko.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: proxmox translations\n"
 "Report-Msgid-Bugs-To: <support@proxmox.com>\n"
 "POT-Creation-Date: 2025-12-19 10:53+0100\n"
-"PO-Revision-Date: 2025-12-16 23:20+0900\n"
+"PO-Revision-Date: 2026-02-04 10:52+0100\n"
 "Last-Translator: angrystar170 <angrystar170@gmail.com>\n"
 "Language-Team: Korean <support@proxmox.com>\n"
 "Language: ko_KR\n"
@@ -12078,7 +12078,7 @@ msgstr "복구 키"
 
 #: proxmox-yew-comp/src/tfa/tfa_add_recovery.rs:119
 msgid "Recovery Keys for user '{}'"
-msgstr "복구 키"
+msgstr ""
 
 #: proxmox-backup/www/panel/PrunePanel.js:100
 msgid "Recursive"
diff --git a/ukr.po b/ukr.po
index 0d26066d..7a2ac42b 100644
--- a/ukr.po
+++ b/ukr.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: proxmox translations\n"
 "Report-Msgid-Bugs-To: <support@proxmox.com>\n"
 "POT-Creation-Date: 2025-12-10 15:47+0100\n"
-"PO-Revision-Date: 2025-09-19 09:44+0200\n"
+"PO-Revision-Date: 2026-02-04 11:09+0100\n"
 "Last-Translator: Sviatoslav Brylenko <s.brylenko@proxmox.com>\n"
 "Language-Team: Ukrainian <support@proxmox.com>\n"
 "Language: uk\n"
@@ -4786,7 +4786,7 @@ msgstr "EVPN зона не має зконфігурованого VRF VNI!"
 #: proxmox-datacenter-manager/ui/src/sdn/evpn/vrf_tree.rs:160
 #: proxmox-datacenter-manager/ui/src/sdn/evpn/vrf_tree.rs:219
 msgid "EVPN Zone {} has no VRF VNI"
-msgstr "EVPN зона не має VRF VNI"
+msgstr ""
 
 #: proxmox-datacenter-manager/ui/src/sdn/evpn/remote_tree.rs:192
 msgid "EVPN Zone {} has no VXLAN ID defined!"
-- 
2.47.3





  reply	other threads:[~2026-02-04 10:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 10:41 [PATCH proxmox-i18n 1/2] ja: remove second plural form Maximiliano Sandoval
2026-02-04 10:41 ` Maximiliano Sandoval [this message]
2026-02-04 13:43   ` [PATCH proxmox-i18n 2/2] fix strings with wrong format Maximiliano Sandoval
2026-02-04 13:50     ` superseded: " Maximiliano Sandoval

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=20260204104150.178904-2-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