Patch 8.2.1585

4 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 4, 2020, 7:53:45 AM9/4/20
to vim...@googlegroups.com

Patch 8.2.1585
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)
Files: 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


*** ../vim-8.2.1584/src/po/Make_cyg.mak 2018-06-24 15:41:25.000000000 +0200
--- src/po/Make_cyg.mak 2020-09-04 13:49:12.312509501 +0200
***************
*** 16,21 ****
--- 16,22 ----
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,64 ****

.SUFFIXES:
.SUFFIXES: .po .mo .pot
! .PHONY: first_time all install clean $(LANGUAGES)

.po.mo:
$(MSGFMT) -o $@ $<

all: $(MOFILES) $(MOCONVERTED)

! first_time:
$(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

! $(LANGUAGES):
$(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
$(MV) $(PACKAGE).po $(PACKAGE).pot
$(CP) $@.po $@.po.orig
$(MV) $@.po $@.po.old
$(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
--- 45,92 ----

.SUFFIXES:
.SUFFIXES: .po .mo .pot
! .PHONY: first_time all install install-all clean $(LANGUAGES)

.po.mo:
$(MSGFMT) -o $@ $<

all: $(MOFILES) $(MOCONVERTED)

! 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 $(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)
$(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,79 ****
clean:
$(RM) *.mo
$(RM) *.pot
-
-
--- 103,105 ----
*** ../vim-8.2.1584/src/po/Make_ming.mak 2018-06-24 15:41:39.000000000 +0200
--- src/po/Make_ming.mak 2020-09-04 13:49:12.316509497 +0200
***************
*** 22,27 ****
--- 22,32 ----
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,73 ****

.SUFFIXES:
.SUFFIXES: .po .mo .pot
! .PHONY: first_time all install clean $(LANGUAGES)

.po.mo:
$(MSGFMT) -o $@ $<

all: $(MOFILES) $(MOCONVERTED)

! first_time:
$(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

! $(LANGUAGES):
$(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
$(MV) $(PACKAGE).po $(PACKAGE).pot
$(CP) $@.po $@.po.orig
$(MV) $@.po $@.po.old
$(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
--- 58,105 ----

.SUFFIXES:
.SUFFIXES: .po .mo .pot
! .PHONY: first_time all install install-all clean $(LANGUAGES)

.po.mo:
$(MSGFMT) -o $@ $<

all: $(MOFILES) $(MOCONVERTED)

! 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 $(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)
$(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,98 ****
clean:
$(RM) *.mo
$(RM) *.pot
-
-
--- 126,128 ----
*** ../vim-8.2.1584/src/po/Make_mvc.mak 2018-06-24 15:42:00.000000000 +0200
--- src/po/Make_mvc.mak 2020-09-04 13:49:12.316509497 +0200
***************
*** 14,19 ****
--- 14,20 ----
!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,59 ****

all: $(MOFILES) $(MOCONVERTED)

! files:
! $(LS) $(LSFLAGS) ..\*.c ..\if_perl.xs ..\GvimExt\gvimext.cpp ..\globals.h ..\if_py_both.h ..\vim.h > .\files

first_time: files
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

! $(LANGUAGES): files
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
$(CP) $@.po $@.po.orig
$(MV) $@.po $@.po.old
$(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
--- 42,88 ----

all: $(MOFILES) $(MOCONVERTED)

! 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

! $(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,72 ****
--- 99,102 ----
clean:
$(RM) *.mo
$(RM) *.pot
+ $(RM) files
*** ../vim-8.2.1584/src/po/Makefile 2020-08-30 15:49:12.154736331 +0200
--- src/po/Makefile 2020-09-04 13:49:12.316509497 +0200
***************
*** 181,186 ****
--- 181,187 ----
../*.c \
../if_perl.xs \
../GvimExt/gvimext.cpp \
+ ../errors.h \
../globals.h \
../if_py_both.h \
../vim.h \
***************
*** 202,208 ****
$(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)
# Delete the temporary files
rm *.js

--- 203,209 ----
$(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)
# Delete the temporary files
rm *.js

*** ../vim-8.2.1584/src/po/README.txt 2020-08-30 15:49:12.154736331 +0200
--- src/po/README.txt 2020-09-04 13:49:12.316509497 +0200
***************
*** 92,98 ****
msgstr "Berichten übersetzt bei: John Doe <jo...@doe.org>"

(3) Remove unused messages (optional)
! Remove messages that have been marked as obsolete.
Such messages start with "#~".

The cleanup script will also do that (see next step).
--- 92,98 ----
msgstr "Berichten übersetzt bei: John Doe <jo...@doe.org>"

(3) Remove unused messages (optional)
! Remove messages that have been marked as obsolete.
Such messages start with "#~".

The cleanup script will also do that (see next step).
***************
*** 128,134 ****
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
And run Vim with $VIMRUNTIME set to ../runtime


--- 128,134 ----
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
And run Vim with $VIMRUNTIME set to ../runtime


*** ../vim-8.2.1584/src/po/fixfilenames.vim 2020-08-30 15:49:12.158736328 +0200
--- src/po/fixfilenames.vim 2020-09-04 13:49:12.316509497 +0200
***************
*** 5,11 ****

for name in argv()[1:]
let jsname = fnamemodify(name, ":t:r") .. ".js"
! exe "%s+" .. jsname .. "+" .. name .. "+"
endfor

write
--- 5,11 ----

for name in argv()[1:]
let jsname = fnamemodify(name, ":t:r") .. ".js"
! exe "%s+" .. jsname .. "+" .. substitute(name, '\\', '/', 'g') .. "+"
endfor

write
*** ../vim-8.2.1584/src/version.c 2020-09-03 22:33:40.973029609 +0200
--- src/version.c 2020-09-04 13:51:32.008269348 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1585,
/**/

--
WOMAN: King of the who?
ARTHUR: The Britons.
WOMAN: Who are the Britons?
ARTHUR: Well, we all are. we're all Britons and I am your king.
The Quest for the Holy Grail (Monty Python)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages