summaryrefslogtreecommitdiffstats
path: root/src/po
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-05-27 13:40:11 +0100
committerBram Moolenaar <Bram@vim.org>2023-05-27 13:40:11 +0100
commita1d5f9f33c68d06475406d6f44d307d5e01adc01 (patch)
treed717b6a8973ea87313b596ad682308e48574a34d /src/po
parent9f3afe7a70d50447424b8d7404aae0d641cd827c (diff)
patch 9.0.1581: translation does not work for plural argumentv9.0.1581
Problem: Translation does not work for plural argument. Solution: Use PLURAL_MSG() for errors and with xgettext. (closes #12443)
Diffstat (limited to 'src/po')
-rw-r--r--src/po/Make_all.mak2
-rw-r--r--src/po/Make_cyg.mak4
-rw-r--r--src/po/Make_ming.mak4
-rw-r--r--src/po/Make_mvc.mak4
-rw-r--r--src/po/Makefile3
5 files changed, 9 insertions, 8 deletions
diff --git a/src/po/Make_all.mak b/src/po/Make_all.mak
index 7a6144e64c..f5f8e131b6 100644
--- a/src/po/Make_all.mak
+++ b/src/po/Make_all.mak
@@ -188,3 +188,5 @@ PO_VIM_JSLIST = \
optwin.js \
defaults.js
+# Arguments for xgettext to pick up messages to translate from the source code.
+XGETTEXT_KEYWORDS = --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 --keyword=PLURAL_MSG:2,4
diff --git a/src/po/Make_cyg.mak b/src/po/Make_cyg.mak
index 2969d1e872..705858da58 100644
--- a/src/po/Make_cyg.mak
+++ b/src/po/Make_cyg.mak
@@ -66,14 +66,14 @@ PO_INPUTLIST = \
first_time: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
$(VIM) -u NONE --not-a-term -S tojavascript.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
$(XGETTEXT) --default-domain=$(LANGUAGE) \
- --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(PO_INPUTLIST) $(PO_VIM_JSLIST)
+ --add-comments $(XGETTEXT_KEYWORDS) $(PO_INPUTLIST) $(PO_VIM_JSLIST)
$(VIM) -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
$(RM) *.js
$(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
$(VIM) -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
$(XGETTEXT) --default-domain=$(PACKAGE) \
- --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(PO_INPUTLIST) $(PO_VIM_JSLIST)
+ --add-comments $(XGETTEXT_KEYWORDS) $(PO_INPUTLIST) $(PO_VIM_JSLIST)
$(MV) $(PACKAGE).po $(PACKAGE).pot
$(VIM) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
$(RM) *.js
diff --git a/src/po/Make_ming.mak b/src/po/Make_ming.mak
index 1912bc51ad..42dab84449 100644
--- a/src/po/Make_ming.mak
+++ b/src/po/Make_ming.mak
@@ -79,14 +79,14 @@ PO_INPUTLIST = \
first_time: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
$(VIM) -u NONE --not-a-term -S tojavascript.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
$(XGETTEXT) --default-domain=$(LANGUAGE) \
- --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(PO_INPUTLIST) $(PO_VIM_JSLIST)
+ --add-comments $(XGETTEXT_KEYWORDS) $(PO_INPUTLIST) $(PO_VIM_JSLIST)
$(VIM) -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
$(RM) *.js
$(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
$(VIM) -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
$(XGETTEXT) --default-domain=$(PACKAGE) \
- --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(PO_INPUTLIST) $(PO_VIM_JSLIST)
+ --add-comments $(XGETTEXT_KEYWORDS) $(PO_INPUTLIST) $(PO_VIM_JSLIST)
$(MV) $(PACKAGE).po $(PACKAGE).pot
$(VIM) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
$(RM) *.js
diff --git a/src/po/Make_mvc.mak b/src/po/Make_mvc.mak
index bdb6dcce49..9cfa408f28 100644
--- a/src/po/Make_mvc.mak
+++ b/src/po/Make_mvc.mak
@@ -60,7 +60,7 @@ first_time: files
$(VIM) -u NONE --not-a-term -S tojavascript.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
set OLD_PO_FILE_INPUT=yes
set OLD_PO_FILE_OUTPUT=yes
- $(XGETTEXT) --default-domain=$(LANGUAGE) --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 --files-from=.\files $(PO_VIM_JSLIST)
+ $(XGETTEXT) --default-domain=$(LANGUAGE) --add-comments $(XGETTEXT_KEYWORDS) --files-from=.\files $(PO_VIM_JSLIST)
$(VIM) -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
$(RM) *.js
@@ -68,7 +68,7 @@ $(PACKAGE).pot: files
$(VIM) -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
set OLD_PO_FILE_INPUT=yes
set OLD_PO_FILE_OUTPUT=yes
- $(XGETTEXT) --default-domain=$(PACKAGE) --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 --files-from=.\files $(PO_VIM_JSLIST)
+ $(XGETTEXT) --default-domain=$(PACKAGE) --add-comments $(XGETTEXT_KEYWORDS) --files-from=.\files $(PO_VIM_JSLIST)
$(MV) $(PACKAGE).po $(PACKAGE).pot
$(VIM) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
$(RM) *.js
diff --git a/src/po/Makefile b/src/po/Makefile
index 2b17fead38..b637f12138 100644
--- a/src/po/Makefile
+++ b/src/po/Makefile
@@ -208,8 +208,7 @@ $(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
$(VIM) -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
# create vim.pot
$(XGETTEXT) --default-domain=$(PACKAGE) --add-comments \
- --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 \
- $(PO_INPUTLIST) $(PO_VIM_JSLIST)
+ $(XGETTEXT_KEYWORDS) $(PO_INPUTLIST) $(PO_VIM_JSLIST)
mv -f $(PACKAGE).po $(PACKAGE).pot
# Fix Vim scripts names, so that "gf" works
$(VIM) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)