diff src/po/Makefile @ 16285:e71261a88630 v8.1.1147

patch 8.1.1147: desktop file translations are requiring manual updates commit https://github.com/vim/vim/commit/a60e536a290f7c14cf2b255ddb7071b39619fcd3 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 11 13:11:39 2019 +0200 patch 8.1.1147: desktop file translations are requiring manual updates Problem: Desktop file translations are requiring manual updates. Solution: Use the .po files for desktop file translations. (Christian Brabandt)
author Bram Moolenaar <Bram@vim.org>
date Thu, 11 Apr 2019 13:15:04 +0200
parents b79453d0d01c
children b4c7e026685c
line wrap: on
line diff
--- a/src/po/Makefile
+++ b/src/po/Makefile
@@ -25,6 +25,9 @@ MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_
 .SUFFIXES: .po .mo .pot .ck
 .PHONY: all install uninstall prefixcheck converted check clean checkclean distclean update-po $(LANGUAGES)
 
+LINGUAS:
+	@echo $(LANGUAGES) | tr " " "\n" |sed -e '/\./d' | sort > LINGUAS
+
 .po.mo:
 	$(MSGFMTCMD) -o $@ $<
 
@@ -32,7 +35,7 @@ MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_
 	$(VIM) -u NONE -e -X -S check.vim -c "if error == 0 | q | endif" -c cq $<
 	touch $@
 
-all: $(MOFILES) $(MOCONVERTED)
+all: $(MOFILES) $(MOCONVERTED) gvim.desktop vim.desktop
 
 check: $(CHECKFILES)
 
@@ -157,12 +160,17 @@ distclean: clean
 checkclean:
 	rm -f *.ck
 
-$(PACKAGE).pot: ../*.c ../if_perl.xs ../GvimExt/gvimext.cpp ../globals.h ../if_py_both.h ../vim.h
+$(PACKAGE).pot: ../*.c ../if_perl.xs ../GvimExt/gvimext.cpp ../globals.h ../if_py_both.h ../vim.h gvim.desktop.in vim.desktop.in
 	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 vim.h
+		*.c if_perl.xs GvimExt/gvimext.cpp globals.h if_py_both.h vim.h \
+		po/gvim.desktop.in po/vim.desktop.in
 	mv -f ../$(PACKAGE).po $(PACKAGE).pot
 
+%.desktop: %.desktop.in $(PACKAGE).pot LINGUAS
+	$(MSGFMT) --desktop -d . --template $< -o $@
+	cp -f $@ ../../runtime/$@
+
 update-po: $(LANGUAGES)
 
 # Don't add a dependency here, we only want to update the .po files manually