i18n: Add N_n() no-op macro to allow xgettext to extract plural forms

This is intended to allow xgettext to extract plural forms from the code
without actually altering the input. Basically, this is to _n() as N_()
is to _(), and doesn't actually call any gettext functions.
This commit is contained in:
Iris Morelle 2021-09-17 07:17:34 -03:00
parent 0e37282fdb
commit 190b3cce08
No known key found for this signature in database
GPG key ID: E312033F4023A753
3 changed files with 3 additions and 1 deletions

View file

@ -26,6 +26,7 @@ set(GETTEXT_XGETTEXT_OPTIONS
--keyword=vgettext
--keyword=VGETTEXT
--keyword=_n:1,2
--keyword=N_n:1,2
--keyword=sngettext:1,2
--keyword=vngettext:1,2
--keyword=VNGETTEXT:1,2

View file

@ -58,7 +58,7 @@ if "pot-update" in COMMAND_LINE_TARGETS:
"""xgettext --force-po --default-domain=%s --directory=. --add-comments=TRANSLATORS: \
--from-code=UTF-8 --sort-by-file \
--keyword=_ --keyword=N_ --keyword=sgettext --keyword=vgettext --keyword=VGETTEXT \
--keyword=_n:1,2 --keyword=sngettext:1,2 --keyword=vngettext:1,2 --keyword=VNGETTEXT:1,2 \
--keyword=_n:1,2 --keyword=N_n:1,2 --keyword=sngettext:1,2 --keyword=vngettext:1,2 --keyword=VNGETTEXT:1,2 \
--files-from=%s --copyright-holder='Wesnoth development team' --msgid-bugs-address=https://bugs.wesnoth.org/ \
--output=$TARGET \
; sed -i s/charset=CHARSET/charset=UTF-8/ $TARGET \

View file

@ -99,3 +99,4 @@ namespace translation
#define gettext_noop(String) String
#define N_(String) gettext_noop (String)
#define N_n(String1, String2) String1, String2