]> granicus.if.org Git - vim/commitdiff
patch 8.2.1585: messages in globals.h not translated v8.2.1585
authorBram Moolenaar <Bram@vim.org>
Fri, 4 Sep 2020 11:53:00 +0000 (13:53 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 4 Sep 2020 11:53:00 +0000 (13:53 +0200)
Problem:    Messages in globals.h not translated, xgettext on MS-Windows not
            fully supported.
Solution:   Add globals.h to list of input files.  Update MS-Windows makefiles
            to improve message translations. (Ken Takata, closes #6858)

src/po/Make_cyg.mak
src/po/Make_ming.mak
src/po/Make_mvc.mak
src/po/Makefile
src/po/README.txt
src/po/fixfilenames.vim
src/version.c

index 3f853016f386c14356f3a7f27ad720bf6af1feca..0fe7f92952eeb140c09cb6931055494e3c442b9c 100644 (file)
@@ -16,6 +16,7 @@ endif
 include Make_all.mak
 
 PACKAGE = vim
+VIM = ../vim
 
 # Uncomment one of the lines below or modify it to put the path to your
 # gettext binaries
@@ -44,21 +45,48 @@ MKD = mkdir -p
 
 .SUFFIXES:
 .SUFFIXES: .po .mo .pot
-.PHONY: first_time all install clean $(LANGUAGES)
+.PHONY: first_time all install install-all clean $(LANGUAGES)
 
 .po.mo:
        $(MSGFMT) -o $@ $<
 
 all: $(MOFILES) $(MOCONVERTED)
 
-first_time:
+PO_INPUTLIST = \
+       $(wildcard ../*.c) \
+       ../if_perl.xs \
+       ../GvimExt/gvimext.cpp \
+       ../errors.h \
+       ../globals.h \
+       ../if_py_both.h \
+       ../vim.h \
+       gvim.desktop.in \
+       vim.desktop.in
+
+PO_VIM_INPUTLIST = \
+       ../../runtime/optwin.vim
+
+PO_VIM_JSLIST = \
+       optwin.js
+
+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 $(wildcard ../*.c) ../if_perl.xs ../GvimExt/gvimext.cpp $(wildcard ../globals.h) ../if_py_both.h ../vim.h
+               --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(PO_INPUTLIST) $(PO_VIM_JSLIST)
+       $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
+       $(RM) *.js
 
-$(LANGUAGES):
+$(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 $(wildcard ../*.c) ../if_perl.xs ../GvimExt/gvimext.cpp $(wildcard ../globals.h) ../if_py_both.h ../vim.h
+               --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(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
+
+# Don't add a dependency here, we only want to update the .po files manually
+$(LANGUAGES):
+       @$(MAKE) -f Make_cyg.mak $(PACKAGE).pot GETTEXT_PATH=$(GETTEXT_PATH)
        $(CP) $@.po $@.po.orig
        $(MV) $@.po $@.po.old
        $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
@@ -75,5 +103,3 @@ install-all: install
 clean:
        $(RM) *.mo
        $(RM) *.pot
-
-
index aa19306c65cf154310ecd84944ddd7c97146a3b3..5e9428f6474f91ee56fb0f21e27114d6ec5ed920 100644 (file)
@@ -22,6 +22,11 @@ endif
 include Make_all.mak
 
 PACKAGE = vim
+ifeq (sh.exe, $(SHELL))
+VIM = ..\vim
+else
+VIM = ../vim
+endif
 
 # Uncomment one of the lines below or modify it to put the path to your
 # gettex binaries; I use the first
@@ -53,21 +58,48 @@ endif
 
 .SUFFIXES:
 .SUFFIXES: .po .mo .pot
-.PHONY: first_time all install clean $(LANGUAGES)
+.PHONY: first_time all install install-all clean $(LANGUAGES)
 
 .po.mo:
        $(MSGFMT) -o $@ $<
 
 all: $(MOFILES) $(MOCONVERTED)
 
-first_time:
+PO_INPUTLIST = \
+       $(wildcard ../*.c) \
+       ../if_perl.xs \
+       ../GvimExt/gvimext.cpp \
+       ../errors.h \
+       ../globals.h \
+       ../if_py_both.h \
+       ../vim.h \
+       gvim.desktop.in \
+       vim.desktop.in
+
+PO_VIM_INPUTLIST = \
+       ../../runtime/optwin.vim
+
+PO_VIM_JSLIST = \
+       optwin.js
+
+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 $(wildcard ../*.c) ../if_perl.xs ../GvimExt/gvimext.cpp $(wildcard ../globals.h) ../if_py_both.h ../vim.h
+               --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(PO_INPUTLIST) $(PO_VIM_JSLIST)
+       $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
+       $(RM) *.js
 
-$(LANGUAGES):
+$(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 $(wildcard ../*.c) ../if_perl.xs ../GvimExt/gvimext.cpp $(wildcard ../globals.h) ../if_py_both.h ../vim.h
+               --add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 $(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
+
+# Don't add a dependency here, we only want to update the .po files manually
+$(LANGUAGES):
+       @$(MAKE) -f Make_ming.mak $(PACKAGE).pot GETTEXT_PATH=$(GETTEXT_PATH)
        $(CP) $@.po $@.po.orig
        $(MV) $@.po $@.po.old
        $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
@@ -94,5 +126,3 @@ endif
 clean:
        $(RM) *.mo
        $(RM) *.pot
-
-
index 43c805fb9c79f6454392e94a8a6e2bd1bac3c25e..801a43694f99345f8ba4d8193fd4a4e748090428 100644 (file)
@@ -14,6 +14,7 @@ VIMRUNTIME = ..\..\runtime
 !include Make_all.mak
 
 PACKAGE = vim
+VIM = ..\vim
 
 # Correct the following line for the directory where gettext et al is installed
 GETTEXT_PATH = H:\gettext.0.14.4\bin
@@ -41,19 +42,47 @@ INSTALLDIR = $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES
 
 all: $(MOFILES) $(MOCONVERTED)
 
-files:
-       $(LS) $(LSFLAGS) ..\*.c ..\if_perl.xs ..\GvimExt\gvimext.cpp ..\globals.h ..\if_py_both.h ..\vim.h > .\files
+PO_INPUTLIST = \
+       ..\*.c \
+       ..\if_perl.xs \
+       ..\GvimExt\gvimext.cpp \
+       ..\errors.h \
+       ..\globals.h \
+       ..\if_py_both.h \
+       ..\vim.h \
+       gvim.desktop.in \
+       vim.desktop.in
+
+PO_VIM_INPUTLIST = \
+       ..\..\runtime\optwin.vim
+
+PO_VIM_JSLIST = \
+       optwin.js
+
+files: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
+       $(LS) $(LSFLAGS) $(PO_INPUTLIST) > .\files
+       echo $(PO_VIM_JSLIST)>> .\files
 
 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
+       $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).pot $(PO_VIM_INPUTLIST)
+       $(RM) *.js
 
-$(LANGUAGES): files
+$(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
        $(MV) $(PACKAGE).po $(PACKAGE).pot
+       $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
+       $(RM) *.js
+
+# Don't add a dependency here, we only want to update the .po files manually
+$(LANGUAGES):
+       @$(MAKE) -nologo -f Make_mvc.mak $(PACKAGE).pot GETTEXT_PATH=$(GETTEXT_PATH)
        $(CP) $@.po $@.po.orig
        $(MV) $@.po $@.po.old
        $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
@@ -70,3 +99,4 @@ install-all: all
 clean:
        $(RM) *.mo
        $(RM) *.pot
+       $(RM) files
index 8ef93e6eb0fc52b6b41a8f3b200814bae84f45ba..e46bceaf35a41d42e2a8437ccf1a8d9d2fa84107 100644 (file)
@@ -181,6 +181,7 @@ PO_INPUTLIST = \
        ../*.c \
        ../if_perl.xs \
        ../GvimExt/gvimext.cpp \
+       ../errors.h \
        ../globals.h \
        ../if_py_both.h \
        ../vim.h \
@@ -202,7 +203,7 @@ $(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
                $(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)
+       $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot $(PO_VIM_INPUTLIST)
        # Delete the temporary files
        rm *.js
 
index 68d267af17d36f1489dc3b24f48167bbe7e625be..6979b82e668e153a0846e37df6d5fe44afa62166 100644 (file)
@@ -92,7 +92,7 @@ language.
        msgstr "Berichten übersetzt bei: John Doe <john@doe.org>"
 
 (3) Remove unused messages (optional)
-    Remove messages that have been marked as obsolete. 
+    Remove messages that have been marked as obsolete.
     Such messages start with "#~".
 
     The cleanup script will also do that (see next step).
@@ -128,7 +128,7 @@ language.
     Vim normally picks up the .mo files from:
            $VIMRUNTIME/lang/{lang}/LC_MESSAGES/vim.mo
     To try out the messages with Vim use:
-           make tryoutinstall
+           make tryoutinstall
     And run Vim with $VIMRUNTIME set to ../runtime
 
 
index 65d448ce419c250676c88eb579fbc289c2b20565..04bc0791c0fa1d1a60b4f8cf7c8b2174f77e5bf7 100644 (file)
@@ -5,7 +5,7 @@ set shortmess+=A
 
 for name in argv()[1:]
   let jsname = fnamemodify(name, ":t:r") .. ".js"
-  exe "%s+" .. jsname .. "+" .. name .. "+"
+  exe "%s+" .. jsname .. "+" .. substitute(name, '\\', '/', 'g') .. "+"
 endfor
 
 write
index 116fab9d2be98198e08e9d343c2638da3db5deda..338bb55704c4d68cf21bb6d675686876e7ca727d 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1585,
 /**/
     1584,
 /**/