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:
parent
0e37282fdb
commit
190b3cce08
3 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -99,3 +99,4 @@ namespace translation
|
|||
|
||||
#define gettext_noop(String) String
|
||||
#define N_(String) gettext_noop (String)
|
||||
#define N_n(String1, String2) String1, String2
|
||||
|
|
Loading…
Add table
Reference in a new issue