translation: Auto-generate headers for the vim.pot file
Commit:
https://github.com/vim/vim/commit/22fc41f1f7c94fca491b6759e49ac2430f0b81a2
Author: RestorerZ <[email protected]>
Date: Thu Aug 7 16:16:09 2025 +0200
translation: Auto-generate headers for the vim.pot file
closes: https://github.com/vim/vim/issues/17855
Signed-off-by: RestorerZ <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/po/Make_mvc.mak b/src/po/Make_mvc.mak
index 61fdcb74e..aa11d9fc6 100644
--- a/src/po/Make_mvc.mak
+++ b/src/po/Make_mvc.mak
@@ -12,7 +12,8 @@
!ENDIF
!IFNDEF LANGUAGE
-! IF [powershell.exe -nologo -noprofile
$$lng=(Get-UICulture).TwoLetterISOLanguageName; \
+! IF [powershell.exe -nologo -noprofile \
+ $$lng=(Get-UICulture).TwoLetterISOLanguageName; \
$$Env:LANGUAGE=$$lng;Set-Content -Path .\lng.tmp -Value
"LANGUAGE=$$lng"]
! ENDIF
# In order for the "install" and "cleanup-po" rule to work.
@@ -53,8 +54,8 @@ GETTEXT_PATH = D:\Programs\GetText in
# Starting from version 0.22, msgfmt forcibly converts text to UTF-8 regardless
# of the value of the "charset" field.
!IF [%comspec% /v:on /e:on /c "for /F "tokens=4 delims= " %G in \
- ('"$(GETTEXT_PATH)\msgfmt.exe" --version^|findstr
/rc:[0-9^]\.[0-9^][0-9^]') do \
- @(set "v=%G" && if !v:~2^,2! GEQ 22 exit /b 1)"]
+ ('"$(GETTEXT_PATH)\msgfmt.exe" --version^|findstr
/rc:[0-9^]\.[0-9^][0-9^]')\
+ do @(set "v=%G" && if !v:~2^,2! GEQ 22 exit /b 1)"]
MSGFMT = "$(GETTEXT_PATH)\msgfmt.exe" -v --no-convert
!ELSE
MSGFMT = "$(GETTEXT_PATH)\msgfmt.exe" -v
@@ -94,6 +95,14 @@ PSFLAGS = -NoLogo -NoProfile -Command
INSTALLDIR = $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES
+!IF [%comspec% /C \
+ "for /F %G in ('wmic Path Win32_LocalTime Get Year /format:list ^| \
+ findstr /R [0-9^]') do @(echo:%G> .\_date.tmp)"]
+!ENDIF
+!INCLUDE .\_date.tmp
+!IF [$(RM) .\_date.tmp]
+!ENDIF
+
.SUFFIXES:
.SUFFIXES: .po .mo .pot .ck
@@ -104,8 +113,8 @@ originals : $(MOFILES)
converted: $(MOCONVERTED)
.po.ck:
- "$(VIMPROG)" -u NONE --noplugins -e -s -X --cmd "set enc=utf-8" -S
check.vim \
- -c "if error == 0 | q | else | num 2 | cq | endif" $<
+ "$(VIMPROG)" -u NONE --noplugins -e -s -X --cmd "set enc=utf-8" \
+ -S check.vim -c "if error == 0 | q | else | num 2 | cq | endif"
$<
$(TOUCH_TARGET)
check: $(CHECKFILES)
@@ -456,11 +465,14 @@ first_time: files
@ copy /b .iles+. im_to_js . llfiles
set OLD_PO_FILE_INPUT=yes
set OLD_PO_FILE_OUTPUT=yes
- $(XGETTEXT) --default-domain=$(LANGUAGE) --add-comments
$(XGETTEXT_KEYWORDS) \
- --files-from=. llfiles
+ $(XGETTEXT) --default-domain=$(LANGUAGE) --add-comments \
+ $(XGETTEXT_KEYWORDS) --files-from=. llfiles \
+ --copyright-holder="$(Year), The Vim Project"
--package-name=Vim \
+ --msgid-bugs-address="[email protected]"
"$(VIMPROG)" -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).po \
$(PO_VIM_INPUTLIST)
$(RM) *.js . im_to_js
+ @$(MAKE) -lf Make_mvc.mak clean
$(PACKAGE).pot: files
"$(VIMPROG)" -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot \
@@ -469,10 +481,13 @@ $(PACKAGE).pot: files
set OLD_PO_FILE_INPUT=yes
set OLD_PO_FILE_OUTPUT=yes
$(XGETTEXT) --default-domain=$(PACKAGE) --output=$(PACKAGE).pot \
- --add-comments $(XGETTEXT_KEYWORDS) --files-from=. llfiles
+ --add-comments $(XGETTEXT_KEYWORDS) --files-from=. llfiles \
+ --no-location --copyright-holder="$(Year), The Vim Project" \
+ --package-name=Vim --msgid-bugs-address="[email protected]"
"$(VIMPROG)" -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot \
$(PO_VIM_INPUTLIST)
$(RM) *.js . im_to_js
+ @$(MAKE) -lf Make_mvc.mak clean
# Only original translations with default encoding should be updated.
# The files that are converted to a different encoding clearly state "DO NOT
EDIT".
@@ -480,7 +495,7 @@ update-po: $(MOFILES:.mo=)
# Don't add a dependency here, we only want to update the .po files manually.
$(LANGUAGES):
- @$(MAKE) -nologo -f Make_mvc.mak GETTEXT_PATH="$(GETTEXT_PATH)"
$(PACKAGE).pot
+ @$(MAKE) -lf Make_mvc.mak GETTEXT_PATH="$(GETTEXT_PATH)" $(PACKAGE).pot
$(CP) [email protected] [email protected]
$(MV) [email protected] [email protected]
$(MSGMERGE) [email protected] $(PACKAGE).pot -o [email protected]
diff --git a/src/po/Makefile b/src/po/Makefile
index 0cc106d41..0e9f28572 100644
--- a/src/po/Makefile
+++ b/src/po/Makefile
@@ -41,7 +41,8 @@ converted: $(MOCONVERTED)
.po.ck:
$(VIMPROG) -u NONE --noplugins -e -s -X --cmd "set enc=utf-8" \
- -S check.vim -c "if error == 0 | q | else | num 2 | cq | endif"
$< >/dev/null
+ -S check.vim -c "if error == 0 | q | else | num 2 | cq | endif"
\
+ $< >/dev/null
touch $@
check: $(CHECKFILES)
@@ -269,7 +270,8 @@ $(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST)
# Create vim.pot.
$(XGETTEXT) --default-domain=$(PACKAGE) --output=$(PACKAGE).pot \
--add-comments $(XGETTEXT_KEYWORDS) --files-from=./allfiles \
- --no-location
+ --no-location --copyright-holder="$$(date +%Y), The Vim
Project" \
+ --package-name=Vim --msgid-bugs-address="[email protected]"
# Fix Vim scripts names, so that "gf" works.
$(VIMPROG) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot \
$(PO_VIM_INPUTLIST)
diff --git a/src/po/vim.pot b/src/po/vim.pot
index 5b9ba3cd8..43a8d64b2 100644
--- a/src/po/vim.pot
+++ b/src/po/vim.pot
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
+# Copyright (C) YEAR 2025, The Vim Project
+# This file is distributed under the same license as the Vim package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: PACKAGE VERSION
"
-"Report-Msgid-Bugs-To:
"
-"POT-Creation-Date: 2025-08-07 15:32+0200
"
+"Project-Id-Version: Vim
"
+"Report-Msgid-Bugs-To: [email protected]
"
+"POT-Creation-Date: 2025-08-07 16:17+0200
"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE
"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>
"
"Language-Team: LANGUAGE <[email protected]>
"
--
--
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1uk1d5-000Zy2-L7%40256bit.org.