public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-yew-comp] apt package manager: fix format of translatable string
@ 2026-02-04 10:07 Maximiliano Sandoval
  0 siblings, 0 replies; only message in thread
From: Maximiliano Sandoval @ 2026-02-04 10:07 UTC (permalink / raw)
  To: yew-devel

Tr uses the `{n}` variable name for the count variable.

Note that as per gettext docs [1] it is not appropriate to use ngettext
when neither the msgid or the msgid_plural strings make use of the count
variable `n`. This produces warnings with msgfmt --check on newer
gettext versions.

[1] https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html#index-ngettext

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 src/apt_package_manager.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/apt_package_manager.rs b/src/apt_package_manager.rs
index 2385b43..314d6f9 100644
--- a/src/apt_package_manager.rs
+++ b/src/apt_package_manager.rs
@@ -478,7 +478,7 @@ fn render_tree_node(args: &mut DataTableCellRenderArgs<TreeEntry>) -> Html {
                 + ": "
                 + &*info.name
                 + " ("
-                + &tr!("One item" | "{} items" % info.count)
+                + &tr!("One item" | "{n} items" % info.count)
                 + ")";
             args.add_class("pwt-bg-color-surface");
             args.set_attribute("colspan", "20");
-- 
2.47.3





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-04 10:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-04 10:07 [PATCH proxmox-yew-comp] apt package manager: fix format of translatable string Maximiliano Sandoval

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