patch 8.2.1585: messages in globals.h not translated

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)
diff --git a/src/po/Make_mvc.mak b/src/po/Make_mvc.mak
index 43c805f..801a436 100644
--- a/src/po/Make_mvc.mak
+++ b/src/po/Make_mvc.mak
@@ -14,6 +14,7 @@
 !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 @@
 
 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 @@
 clean:
 	$(RM) *.mo
 	$(RM) *.pot
+	$(RM) files