Hello

Filter messages form vim.h in file dialogues currently are not translated.

In patch attached such messages are marked for translation with N_(),
translated with _() before using in function calls and vim.h added to
po/makefiles to include N_() marked strings in po/.pot file.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
From ad0a946a7111949287ba15ff9d91c0fe22e9bb38 Mon Sep 17 00:00:00 2001
From: Sergey Alyoshin <alyoshi...@gmail.com>
Date: Sat, 28 Apr 2018 21:47:52 +0300
Subject: [PATCH] Add file filter dialog messages to translation

---
 src/diff.c           |  2 +-
 src/ex_cmds2.c       |  2 +-
 src/ex_docmd.c       |  4 ++--
 src/message.c        |  2 +-
 src/po/Make_cyg.mak  |  4 ++--
 src/po/Make_ming.mak |  4 ++--
 src/po/Make_mvc.mak  |  2 +-
 src/po/Makefile      |  4 ++--
 src/quickfix.c       |  2 +-
 src/vim.h            | 12 ++++++------
 10 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/diff.c b/src/diff.c
index b69b69e31..9cb9e25cd 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -909,7 +909,7 @@ ex_diffpatch(exarg_T *eap)
     if (cmdmod.browse)
     {
 	browseFile = do_browse(0, (char_u *)_("Patch file"),
-			 eap->arg, NULL, NULL, BROWSE_FILTER_ALL_FILES, NULL);
+			 eap->arg, NULL, NULL, _(BROWSE_FILTER_ALL_FILES), NULL);
 	if (browseFile == NULL)
 	    return;		/* operation cancelled */
 	eap->arg = browseFile;
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 69283d693..50a0f45f1 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -4140,7 +4140,7 @@ ex_source(exarg_T *eap)
 	char_u *fname = NULL;
 
 	fname = do_browse(0, (char_u *)_("Source Vim script"), eap->arg,
-				      NULL, NULL, BROWSE_FILTER_MACROS, NULL);
+				      NULL, NULL, _(BROWSE_FILTER_MACROS), NULL);
 	if (fname != NULL)
 	{
 	    cmd_source(fname, eap);
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 29270ad48..fc87587dc 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9619,7 +9619,7 @@ ex_redir(exarg_T *eap)
 
 		browseFile = do_browse(BROWSE_SAVE,
 			(char_u *)_("Save Redirection"),
-			fname, NULL, NULL, BROWSE_FILTER_ALL_FILES, curbuf);
+			fname, NULL, NULL, _(BROWSE_FILTER_ALL_FILES), curbuf);
 		if (browseFile == NULL)
 		    return;		/* operation cancelled */
 		vim_free(fname);
@@ -9845,7 +9845,7 @@ ex_mkrc(
 		eap->cmdidx == CMD_mksession ? (char_u *)_("Save Session") :
 # endif
 		(char_u *)_("Save Setup"),
-		fname, (char_u *)"vim", NULL, BROWSE_FILTER_MACROS, NULL);
+		fname, (char_u *)"vim", NULL, _(BROWSE_FILTER_MACROS), NULL);
 	if (browseFile == NULL)
 	    goto theend;
 	fname = browseFile;
diff --git a/src/message.c b/src/message.c
index 25c22f63e..b01feea8c 100644
--- a/src/message.c
+++ b/src/message.c
@@ -4057,7 +4057,7 @@ do_browse(
 	}
 	else
 	    fname = gui_mch_browse(flags & BROWSE_SAVE,
-					   title, dflt, ext, initdir, filter);
+					  title, dflt, ext, initdir, _(filter));
 
 	/* We hang around in the dialog for a while, the user might do some
 	 * things to our files.  The Win32 dialog allows deleting or renaming
diff --git a/src/po/Make_cyg.mak b/src/po/Make_cyg.mak
index 4ee21a150..5f6f6cca3 100644
--- a/src/po/Make_cyg.mak
+++ b/src/po/Make_cyg.mak
@@ -130,11 +130,11 @@ all: $(MOFILES)
 
 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
+		--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
+		--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
diff --git a/src/po/Make_ming.mak b/src/po/Make_ming.mak
index 6973ad79c..70b2c1efa 100644
--- a/src/po/Make_ming.mak
+++ b/src/po/Make_ming.mak
@@ -139,11 +139,11 @@ all: $(MOFILES)
 
 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
+		--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
+		--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
diff --git a/src/po/Make_mvc.mak b/src/po/Make_mvc.mak
index 0f0adebb6..0748bdf06 100644
--- a/src/po/Make_mvc.mak
+++ b/src/po/Make_mvc.mak
@@ -119,7 +119,7 @@ INSTALLDIR = $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES
 all: $(MOFILES)
 
 files:
-	$(LS) $(LSFLAGS) ..\*.c ..\if_perl.xs ..\GvimExt\gvimext.cpp ..\globals.h ..\if_py_both.h > .\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
diff --git a/src/po/Makefile b/src/po/Makefile
index fc78c4308..386cb6443 100644
--- a/src/po/Makefile
+++ b/src/po/Makefile
@@ -281,10 +281,10 @@ distclean: clean
 checkclean:
 	rm -f *.ck
 
-$(PACKAGE).pot: ../*.c ../if_perl.xs ../GvimExt/gvimext.cpp ../globals.h ../if_py_both.h
+$(PACKAGE).pot: ../*.c ../if_perl.xs ../GvimExt/gvimext.cpp ../globals.h ../if_py_both.h ../vim.h
 	cd ..; $(XGETTEXT) --default-domain=$(PACKAGE) \
 		--add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2 \
-		*.c if_perl.xs GvimExt/gvimext.cpp globals.h if_py_both.h
+		*.c if_perl.xs GvimExt/gvimext.cpp globals.h if_py_both.h vim.h
 	mv -f ../$(PACKAGE).po $(PACKAGE).pot
 
 update-po: $(LANGUAGES)
diff --git a/src/quickfix.c b/src/quickfix.c
index cc6fe0a07..8829de8d1 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -4115,7 +4115,7 @@ ex_cfile(exarg_T *eap)
     if (cmdmod.browse)
     {
 	char_u *browse_file = do_browse(0, (char_u *)_("Error file"), eap->arg,
-				   NULL, NULL, BROWSE_FILTER_ALL_FILES, NULL);
+				   NULL, NULL, _(BROWSE_FILTER_ALL_FILES), NULL);
 	if (browse_file == NULL)
 	    return;
 	set_string_option_direct((char_u *)"ef", -1, browse_file, OPT_FREE, 0);
diff --git a/src/vim.h b/src/vim.h
index 985a4926d..af01f1a51 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -2186,16 +2186,16 @@ typedef enum {
 #ifdef FEAT_BROWSE
 # ifdef BACKSLASH_IN_FILENAME
 #  define BROWSE_FILTER_MACROS \
-	(char_u *)"Vim macro files (*.vim)\t*.vim\nAll Files (*.*)\t*.*\n"
-#  define BROWSE_FILTER_ALL_FILES (char_u *)"All Files (*.*)\t*.*\n"
+	(char_u *)N_("Vim macro files (*.vim)\t*.vim\nAll Files (*.*)\t*.*\n")
+#  define BROWSE_FILTER_ALL_FILES (char_u *)N_("All Files (*.*)\t*.*\n")
 #  define BROWSE_FILTER_DEFAULT \
-	(char_u *)"All Files (*.*)\t*.*\nC source (*.c, *.h)\t*.c;*.h\nC++ source (*.cpp, *.hpp)\t*.cpp;*.hpp\nVB code (*.bas, *.frm)\t*.bas;*.frm\nVim files (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n"
+	(char_u *)N_("All Files (*.*)\t*.*\nC source (*.c, *.h)\t*.c;*.h\nC++ source (*.cpp, *.hpp)\t*.cpp;*.hpp\nVB code (*.bas, *.frm)\t*.bas;*.frm\nVim files (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n")
 # else
 #  define BROWSE_FILTER_MACROS \
-	(char_u *)"Vim macro files (*.vim)\t*.vim\nAll Files (*)\t*\n"
-#  define BROWSE_FILTER_ALL_FILES (char_u *)"All Files (*)\t*\n"
+	(char_u *)N_("Vim macro files (*.vim)\t*.vim\nAll Files (*)\t*\n")
+#  define BROWSE_FILTER_ALL_FILES (char_u *)N_("All Files (*)\t*\n")
 #  define BROWSE_FILTER_DEFAULT \
-	(char_u *)"All Files (*)\t*\nC source (*.c, *.h)\t*.c;*.h\nC++ source (*.cpp, *.hpp)\t*.cpp;*.hpp\nVim files (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n"
+	(char_u *)N_("All Files (*)\t*\nC source (*.c, *.h)\t*.c;*.h\nC++ source (*.cpp, *.hpp)\t*.cpp;*.hpp\nVim files (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n")
 # endif
 # define BROWSE_SAVE 1	    /* flag for do_browse() */
 # define BROWSE_DIR 2	    /* flag for do_browse() */
-- 
2.14.2

Raspunde prin e-mail lui