Skip to content

Commit 449d76c

Browse files
martinpittlarskarlitski
authored andcommitted
po: Don't mark JavaScript strings as c-format
We don't use printf-style C format macros like "%s" in the JavaScript code, at least not for translations. But xgettext interprets the "$0% Free" in pkg/kubernetes/scripts/nodes.js as C format string, which confuses translation tools and blocks the proper translation of this string. As there doesn't seem to be a way to change the `--keyword=ngettext` argument to do that, just filter out the `c-format` tag with sed. Closes #10058
1 parent cc36342 commit 449d76c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

po/Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,14 @@ po/cockpit.html.pot: po/POTFILES.html.in
8585

8686
# Extract cockpit style javascript translations
8787
po/cockpit.js.pot: po/POTFILES.js.in
88-
$(XGETTEXT) --default-domain=cockpit --output=$@ --language=C --keyword= \
88+
$(XGETTEXT) --default-domain=cockpit --output=- --language=C --keyword= \
8989
--keyword=_:1,1t --keyword=_:1c,2,1t --keyword=C_:1c,2 \
9090
--keyword=N_ --keyword=NC_:1c,2 \
9191
--keyword=gettext:1,1t --keyword=gettext:1c,2,2t \
9292
--keyword=ngettext:1,2,3t --keyword=ngettext:1c,2,3,4t \
9393
--keyword=gettextCatalog.getString:1,3c --keyword=gettextCatalog.getPlural:2,3,4c \
94-
--from-code=UTF-8 --directory=$(srcdir) --files-from=$^
94+
--from-code=UTF-8 --directory=$(srcdir) --files-from=$^ | \
95+
sed '/^#/ s/, c-format//' > $@
9596

9697
po/cockpit.manifest.pot: po/POTFILES.manifest.in
9798
$(srcdir)/tools/missing $(srcdir)/po/manifest2po -d $(srcdir) -f $^ -o $@

0 commit comments

Comments
 (0)