translation: Stop using msgconv
It caused differences from Unix-like systems. Make sure that the same
files are generated both on Windows and Unix.
fixes: #14490
fixes: #14601
closes: #15469
Also
- update a few more auto-generated po files
- Make_mvc.mak work with Cygwin/MSYS2's gettext by using copy /b instead
of copy /a
Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/po/Make_mvc.mak b/src/po/Make_mvc.mak
index 174908a..f567d88 100644
--- a/src/po/Make_mvc.mak
+++ b/src/po/Make_mvc.mak
@@ -124,9 +124,7 @@
ja.sjis.po: ja.po
@$(MAKE) -nologo -f Make_mvc.mak sjiscorr
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t CP932 $? | .\sjiscorr.exe > $@
-!ELSEIF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f UTF-8 -t CP932 $? | .\sjiscorr.exe > $@
!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
@@ -148,23 +146,19 @@
# Convert ja.po to create ja.euc-jp.po.
ja.euc-jp.po: ja.po
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t EUC-JP -o $@ $?
-!ELSE
-! IF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f UTF-8 -t EUC-JP $? > $@
-! ELSE
+!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
[System.IO.File]::ReadAllText(\"$?\", \
[System.Text.Encoding]::GetEncoding(65001)), \
[System.Text.Encoding]::GetEncoding(20932))
-! ENDIF
+!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(20932)) -replace \
'charset=utf-8', 'charset=EUC-JP'; \
[System.IO.File]::WriteAllText(\"$@\", $$out, \
[System.Text.Encoding]::GetEncoding(20932))
-!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(20932)) -replace \
'# Original translations', \
@@ -175,23 +169,19 @@
# Convert cs.po to create cs.cp1250.po.
cs.cp1250.po: cs.po
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $?
-!ELSE
-! IF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-2 -t CP1250 $? > $@
-! ELSE
+!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
[System.IO.File]::ReadAllText(\"$?\", \
[System.Text.Encoding]::GetEncoding(28592)), \
[System.Text.Encoding]::GetEncoding(1250))
-! ENDIF
+!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(1250)) -replace \
'charset=iso-8859-2', 'charset=CP1250'; \
[System.IO.File]::WriteAllText(\"$@\", $$out, \
[System.Text.Encoding]::GetEncoding(1250))
-!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(1250)) -replace \
'# Original translations', \
@@ -202,23 +192,19 @@
# Convert pl.po to create pl.cp1250.po.
pl.cp1250.po: pl.po
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $?
-!ELSE
-! IF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-2 -t CP1250 $? > $@
-! ELSE
+!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
[System.IO.File]::ReadAllText(\"$?\", \
[System.Text.Encoding]::GetEncoding(28592)), \
[System.Text.Encoding]::GetEncoding(1250))
-! ENDIF
+!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(1250)) -replace \
'charset=iso-8859-2', 'charset=CP1250'; \
[System.IO.File]::WriteAllText(\"$@\", $$out, \
[System.Text.Encoding]::GetEncoding(1250))
-!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(1250)) -replace \
'# Original translations', \
@@ -229,20 +215,16 @@
# Convert pl.po to create pl.UTF-8.po.
pl.UTF-8.po: pl.po
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t UTF-8 -o $@ $?
-!ELSE
-! IF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-2 -t UTF-8 $? > $@
-! ELSE
+!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
[System.IO.File]::ReadAllText(\"$?\", \
[System.Text.Encoding]::GetEncoding(28592)))
-! ENDIF
+!ENDIF
$(PS) $(PSFLAGS) (Get-Content -Raw -Encoding UTF8 $@ \
^| % {$$_-replace 'charset=iso-8859-2', 'charset=UTF-8'}) \
^| 1>nul New-Item -Force -Path . -ItemType file -Name $@
-!ENDIF
$(PS) $(PSFLAGS) (Get-Content -Raw -Encoding UTF8 $@ \
^| % {$$_-replace '# Original translations', \
'# Generated from $?, DO NOT EDIT'}) \
@@ -251,23 +233,19 @@
# Convert sk.po to create sk.cp1250.po.
sk.cp1250.po: sk.po
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $?
-!ELSE
-! IF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f ISO-8859-2 -t CP1250 $? > $@
-! ELSE
+!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
[System.IO.File]::ReadAllText(\"$?\", \
[System.Text.Encoding]::GetEncoding(28592)), \
[System.Text.Encoding]::GetEncoding(1250))
-! ENDIF
+!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(1250)) -replace \
'charset=iso-8859-2', 'charset=CP1250'; \
[System.IO.File]::WriteAllText(\"$@\", $$out, \
[System.Text.Encoding]::GetEncoding(1250))
-!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(1250)) -replace \
'# Original translations', \
@@ -278,24 +256,20 @@
# Convert zh_CN.UTF-8.po to create zh_CN.po.
zh_CN.po: zh_CN.UTF-8.po
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t GB2312 -o $@ $?
-!ELSE
-! IF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f UTF-8 -t GB2312 $? > $@
-! ELSE
+!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
[System.IO.File]::ReadAllText(\"$?\", \
[System.Text.Encoding]::GetEncoding(65001)), \
[System.Text.Encoding]::GetEncoding(936))
-! ENDIF
+!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(936)) -replace \
'charset=UTF-8', 'charset=GB2312'; \
[System.IO.File]::WriteAllText(\"$@\", $$out, \
[System.Text.Encoding]::GetEncoding(936))
-!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(936)) -replace \
'# Original translations', \
@@ -328,24 +302,19 @@
# Convert zh_TW.UTF-8.po to create zh_TW.po.
zh_TW.po: zh_TW.UTF-8.po
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t BIG5 -o $@ $?
-!ELSE
-! IF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f UTF-8 -t BIG5 $? > $@
-! ELSE
+!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
[System.IO.File]::ReadAllText(\"$?\", \
[System.Text.Encoding]::GetEncoding(65001)), \
[System.Text.Encoding]::GetEncoding(950))
-
-! ENDIF
+!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(950)) -replace \
'charset=UTF-8', 'charset=BIG5'; \
[System.IO.File]::WriteAllText(\"$@\", $$out, \
[System.Text.Encoding]::GetEncoding(950))
-!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(950)) -replace \
'# Original translations', \
@@ -373,9 +342,7 @@
#zh_TW.po: zh_TW.UTF-8.po
# @$(MAKE) -nologo -f Make_mvc.mak big5corr
# -$(RM) $@
-#!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
-# "$(GETTEXT_PATH)\msgconv.exe" -t BIG5 $? | .\big5corr.exe > $@
-#!ELSEIF DEFINED (ICONV)
+#!IF DEFINED (ICONV)
# $(ICONV) -f UTF-8 -t BIG5 $? | .\big5corr.exe > $@
#!ELSE
# $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
@@ -398,24 +365,20 @@
# Convert ko.UTF-8.po to create ko.po.
ko.po: ko.UTF-8.po
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t EUC-KR -o $@ $?
-!ELSE
-! IF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f UTF-8 -t EUC-KR $? > $@
-! ELSE
+!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
[System.IO.File]::ReadAllText(\"$?\", \
[System.Text.Encoding]::GetEncoding(65001)), \
[System.Text.Encoding]::GetEncoding(51949))
-! ENDIF
+!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(51949)) -replace \
'charset=UTF-8', 'charset=EUC-KR'; \
[System.IO.File]::WriteAllText(\"$@\", $$out, \
[System.Text.Encoding]::GetEncoding(51949))
-!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(51949)) -replace \
'# Original translations', \
@@ -426,24 +389,19 @@
# Convert ru.po to create ru.cp1251.po.
ru.cp1251.po: ru.po
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t CP1251 -o $@ $?
-!ELSE
-! IF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f UTF-8 -t CP1251 $? > $@
-! ELSE
+!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
[System.IO.File]::ReadAllText(\"$?\", \
[System.Text.Encoding]::GetEncoding(65001)), \
[System.Text.Encoding]::GetEncoding(1251))
-
-! ENDIF
+!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(1251)) -replace \
'charset=UTF-8', 'charset=CP1251'; \
[System.IO.File]::WriteAllText(\"$@\", $$out, \
[System.Text.Encoding]::GetEncoding(1251))
-!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(1251)) -replace \
'# Original translations', \
@@ -454,24 +412,19 @@
# Convert uk.po to create uk.cp1251.po.
uk.cp1251.po: uk.po
-$(RM) $@
-!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
- "$(GETTEXT_PATH)\msgconv.exe" -t CP1251 -o $@ $?
-!ELSE
-! IF DEFINED (ICONV)
+!IF DEFINED (ICONV)
$(ICONV) -f UTF-8 -t CP1251 $? > $@
-! ELSE
+!ELSE
$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
[System.IO.File]::ReadAllText(\"$?\", \
[System.Text.Encoding]::GetEncoding(65001)), \
[System.Text.Encoding]::GetEncoding(1251))
-
-! ENDIF
+!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(1251)) -replace \
'charset=UTF-8', 'charset=CP1251'; \
[System.IO.File]::WriteAllText(\"$@\", $$out, \
[System.Text.Encoding]::GetEncoding(1251))
-!ENDIF
$(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \
[System.Text.Encoding]::GetEncoding(1251)) -replace \
'# Original translations', \
@@ -500,7 +453,7 @@
first_time: files
"$(VIMPROG)" -u NONE --not-a-term -S tojavascript.vim $(LANGUAGE).po \
$(PO_VIM_INPUTLIST)
- @ copy /a .\files+.\vim_to_js .\allfiles
+ @ copy /b .\files+.\vim_to_js .\allfiles
set OLD_PO_FILE_INPUT=yes
set OLD_PO_FILE_OUTPUT=yes
$(XGETTEXT) --default-domain=$(LANGUAGE) --add-comments $(XGETTEXT_KEYWORDS) \
@@ -512,7 +465,7 @@
$(PACKAGE).pot: files
"$(VIMPROG)" -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot \
$(PO_VIM_INPUTLIST)
- @ copy /a .\files+.\vim_to_js .\allfiles
+ @ copy /b .\files+.\vim_to_js .\allfiles
set OLD_PO_FILE_INPUT=yes
set OLD_PO_FILE_OUTPUT=yes
$(XGETTEXT) --default-domain=$(PACKAGE) --output=$(PACKAGE).pot \