Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | # Makefile for the Vim message translations for MSVC |
| 2 | # (based on make_ming.mak) |
| 3 | # |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 4 | # Mike Williams, <mrw@eandem.co.uk> |
| 5 | # 06.01.24, Restorer, <restorer@mail2k.ru> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6 | # |
| 7 | # Please read README_mvc.txt before using this file. |
| 8 | # |
| 9 | |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 10 | !IF [powershell.exe -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2 |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 11 | !ERROR The program "PowerShell" version 3.0 or higher is required to work |
| 12 | !ENDIF |
| 13 | |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 14 | !IFNDEF LANGUAGE |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 15 | ! IF [powershell.exe -nologo -noprofile $$lng=(Get-UICulture).TwoLetterISOLanguageName; \ |
| 16 | $$Env:LANGUAGE=$$lng;Set-Content -Path .\lng.tmp -Value "LANGUAGE=$$lng"] |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 17 | ! ENDIF |
| 18 | # In order for the "install" and "cleanup-po" rule to work. |
| 19 | # The others work with just setting the environment variable. |
| 20 | # And to show in the message. |
| 21 | ! INCLUDE lng.tmp |
| 22 | ! IF [del /q .\lng.tmp] |
| 23 | ! ENDIF |
| 24 | ! MESSAGE |
| 25 | ! MESSAGE The %LANGUAGE% environment variable is not set. |
| 26 | ! MESSAGE This variable will be temporarily set to "$(LANGUAGE)" while "nmake.exe" is running. |
| 27 | ! MESSAGE See README_mvc.txt for more information on the %LANGUAGE% environment variable. |
| 28 | ! MESSAGE |
| 29 | !ELSE |
| 30 | ! MESSAGE LANGUAGE is already set "$(LANGUAGE)" |
| 31 | !ENDIF |
| 32 | |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 33 | # Get LANGUAGES, MOFILES, MOCONVERTED and others. |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 34 | !INCLUDE Make_all.mak |
| 35 | |
| 36 | !IFNDEF VIMRUNTIME |
| 37 | VIMRUNTIME = ..\..\runtime |
| 38 | !ENDIF |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 39 | |
| 40 | PACKAGE = vim |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 41 | # Correct the following line for the where executeable file vim is |
| 42 | # installed. Please do not put the path in quotes. |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame^] | 43 | !IFNDEF VIMPROG |
RestorerZ | cd33faf | 2024-07-04 17:47:16 +0200 | [diff] [blame] | 44 | VIMPROG = ..\vim.exe |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame^] | 45 | !ENDIF |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 46 | |
Ken Takata | 075ad70 | 2023-11-25 15:51:00 +0100 | [diff] [blame] | 47 | # Correct the following line for the directory where gettext et al is |
| 48 | # installed. Please do not put the path in quotes. |
Cthulhux | 2f27c65 | 2024-04-10 16:34:49 +0200 | [diff] [blame] | 49 | !IFNDEF GETTEXT_PATH |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 50 | GETTEXT_PATH = D:\Programs\GetText\bin |
Cthulhux | 2f27c65 | 2024-04-10 16:34:49 +0200 | [diff] [blame] | 51 | !ENDIF |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 52 | |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 53 | # Starting from version 0.22, msgfmt forcibly converts text to UTF-8 regardless |
| 54 | # of the value of the "charset" field. |
| 55 | !IF [%comspec% /v:on /e:on /c "for /F "tokens=4 delims= " %G in \ |
| 56 | ('"$(GETTEXT_PATH)\msgfmt.exe" --version^|findstr /rc:[0-9^]\.[0-9^][0-9^]') do \ |
| 57 | @(set "v=%G" && if !v:~2^,2! GEQ 22 exit /b 1)"] |
| 58 | MSGFMT = "$(GETTEXT_PATH)\msgfmt.exe" -v --no-convert |
| 59 | !ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 60 | MSGFMT = "$(GETTEXT_PATH)\msgfmt.exe" -v |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 61 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 62 | XGETTEXT = "$(GETTEXT_PATH)\xgettext.exe" |
| 63 | MSGMERGE = "$(GETTEXT_PATH)\msgmerge.exe" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 64 | |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 65 | # In case some package like GnuWin32, UnixUtils, gettext |
| 66 | # or something similar is installed on the system. |
| 67 | # If the "iconv" program is installed on the system, but it is not registered |
| 68 | # in the %PATH% environment variable, then specify the full path to this file. |
| 69 | !IF EXIST ("iconv.exe") |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 70 | ICONV = iconv.exe |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 71 | !ELSEIF EXIST ("$(GETTEXT_PATH)\iconv.exe") |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 72 | ICONV = "$(GETTEXT_PATH)\iconv.exe" |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 73 | !ENDIF |
| 74 | |
| 75 | # In case some package like GnuWin32, UnixUtils |
| 76 | # or something similar is installed on the system. |
| 77 | # If the "touch" program is installed on the system, but it is not registered |
| 78 | # in the %PATH% environment variable, then specify the full path to this file. |
| 79 | !IF EXIST ("touch.exe") |
Ken Takata | 075ad70 | 2023-11-25 15:51:00 +0100 | [diff] [blame] | 80 | TOUCH_TARGET = touch.exe $@ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 81 | !ELSE |
Ken Takata | 075ad70 | 2023-11-25 15:51:00 +0100 | [diff] [blame] | 82 | TOUCH_TARGET = @if exist $@ ( copy /b $@+,, ) else ( type nul >$@ ) |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 83 | !ENDIF |
| 84 | |
| 85 | MV = move /y |
| 86 | CP = copy /y |
| 87 | RM = del /q |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 88 | MKD = mkdir |
| 89 | LS = dir |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 90 | PS = PowerShell.exe |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 91 | |
| 92 | LSFLAGS = /b /on /l /s |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 93 | PSFLAGS = -NoLogo -NoProfile -Command |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 94 | |
| 95 | INSTALLDIR = $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES |
| 96 | |
| 97 | .SUFFIXES: |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 98 | .SUFFIXES: .po .mo .pot .ck |
| 99 | |
| 100 | all: $(MOFILES) $(MOCONVERTED) |
| 101 | |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 102 | originals : $(MOFILES) |
| 103 | |
| 104 | converted: $(MOCONVERTED) |
| 105 | |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 106 | .po.ck: |
RestorerZ | cd33faf | 2024-07-04 17:47:16 +0200 | [diff] [blame] | 107 | "$(VIMPROG)" -u NONE --noplugins -e -s -X --cmd "set enc=utf-8" -S check.vim \ |
Ken Takata | 075ad70 | 2023-11-25 15:51:00 +0100 | [diff] [blame] | 108 | -c "if error == 0 | q | else | num 2 | cq | endif" $< |
| 109 | $(TOUCH_TARGET) |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 110 | |
| 111 | check: $(CHECKFILES) |
| 112 | |
| 113 | checkclean: |
| 114 | $(RM) *.ck |
| 115 | |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 116 | nl.po: |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 117 | @( echo ^# >> nl.po ) |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 118 | |
| 119 | # Norwegian/Bokmal: "nb" is an alias for "no". |
| 120 | nb.po: no.po |
| 121 | $(CP) no.po nb.po |
| 122 | |
| 123 | # Convert ja.po to create ja.sjis.po. |
| 124 | ja.sjis.po: ja.po |
| 125 | @$(MAKE) -nologo -f Make_mvc.mak sjiscorr |
| 126 | -$(RM) $@ |
| 127 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 128 | "$(GETTEXT_PATH)\msgconv.exe" -t CP932 $? | .\sjiscorr.exe > $@ |
| 129 | !ELSEIF DEFINED (ICONV) |
| 130 | $(ICONV) -f UTF-8 -t CP932 $? | .\sjiscorr.exe > $@ |
| 131 | !ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 132 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 133 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 134 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 135 | [System.Text.Encoding]::GetEncoding(932)) |
| 136 | type $@ | .\sjiscorr.exe > tmp.$@ |
| 137 | @$(MV) tmp.$@ $@ |
| 138 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 139 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 140 | [System.Text.Encoding]::GetEncoding(932)) \ |
| 141 | -replace \"`r`n\", \"`n\"; \ |
| 142 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 143 | [System.Text.Encoding]::GetEncoding(932)) |
| 144 | |
| 145 | sjiscorr: sjiscorr.c |
| 146 | $(CC) sjiscorr.c |
| 147 | |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 148 | # Convert ja.po to create ja.euc-jp.po. |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 149 | ja.euc-jp.po: ja.po |
| 150 | -$(RM) $@ |
| 151 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 152 | "$(GETTEXT_PATH)\msgconv.exe" -t EUC-JP -o $@ $? |
| 153 | !ELSE |
| 154 | ! IF DEFINED (ICONV) |
| 155 | $(ICONV) -f UTF-8 -t EUC-JP $? > $@ |
| 156 | ! ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 157 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 158 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 159 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 160 | [System.Text.Encoding]::GetEncoding(20932)) |
| 161 | ! ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 162 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 163 | [System.Text.Encoding]::GetEncoding(20932)) -replace \ |
| 164 | 'charset=utf-8', 'charset=EUC-JP'; \ |
| 165 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 166 | [System.Text.Encoding]::GetEncoding(20932)) |
| 167 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 168 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 169 | [System.Text.Encoding]::GetEncoding(20932)) -replace \ |
| 170 | '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 171 | '# Generated from $?, DO NOT EDIT'; \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 172 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 173 | [System.Text.Encoding]::GetEncoding(20932)) |
| 174 | |
| 175 | # Convert cs.po to create cs.cp1250.po. |
| 176 | cs.cp1250.po: cs.po |
| 177 | -$(RM) $@ |
| 178 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 179 | "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $? |
| 180 | !ELSE |
| 181 | ! IF DEFINED (ICONV) |
| 182 | $(ICONV) -f ISO-8859-2 -t CP1250 $? > $@ |
| 183 | ! ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 184 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 185 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 186 | [System.Text.Encoding]::GetEncoding(28592)), \ |
| 187 | [System.Text.Encoding]::GetEncoding(1250)) |
| 188 | ! ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 189 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 190 | [System.Text.Encoding]::GetEncoding(1250)) -replace \ |
| 191 | 'charset=iso-8859-2', 'charset=CP1250'; \ |
| 192 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 193 | [System.Text.Encoding]::GetEncoding(1250)) |
| 194 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 195 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 196 | [System.Text.Encoding]::GetEncoding(1250)) -replace \ |
| 197 | '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 198 | '# Generated from $?, DO NOT EDIT'; \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 199 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 200 | [System.Text.Encoding]::GetEncoding(1250)) |
| 201 | |
| 202 | # Convert pl.po to create pl.cp1250.po. |
| 203 | pl.cp1250.po: pl.po |
| 204 | -$(RM) $@ |
| 205 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 206 | "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $? |
| 207 | !ELSE |
| 208 | ! IF DEFINED (ICONV) |
| 209 | $(ICONV) -f ISO-8859-2 -t CP1250 $? > $@ |
| 210 | ! ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 211 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 212 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 213 | [System.Text.Encoding]::GetEncoding(28592)), \ |
| 214 | [System.Text.Encoding]::GetEncoding(1250)) |
| 215 | ! ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 216 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 217 | [System.Text.Encoding]::GetEncoding(1250)) -replace \ |
| 218 | 'charset=iso-8859-2', 'charset=CP1250'; \ |
| 219 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 220 | [System.Text.Encoding]::GetEncoding(1250)) |
| 221 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 222 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 223 | [System.Text.Encoding]::GetEncoding(1250)) -replace \ |
| 224 | '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 225 | '# Generated from $?, DO NOT EDIT'; \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 226 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 227 | [System.Text.Encoding]::GetEncoding(1250)) |
| 228 | |
| 229 | # Convert pl.po to create pl.UTF-8.po. |
| 230 | pl.UTF-8.po: pl.po |
| 231 | -$(RM) $@ |
| 232 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 233 | "$(GETTEXT_PATH)\msgconv.exe" -t UTF-8 -o $@ $? |
| 234 | !ELSE |
| 235 | ! IF DEFINED (ICONV) |
| 236 | $(ICONV) -f ISO-8859-2 -t UTF-8 $? > $@ |
| 237 | ! ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 238 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 239 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 240 | [System.Text.Encoding]::GetEncoding(28592))) |
| 241 | ! ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 242 | $(PS) $(PSFLAGS) (Get-Content -Raw -Encoding UTF8 $@ \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 243 | ^| % {$$_-replace 'charset=iso-8859-2', 'charset=UTF-8'}) \ |
| 244 | ^| 1>nul New-Item -Force -Path . -ItemType file -Name $@ |
| 245 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 246 | $(PS) $(PSFLAGS) (Get-Content -Raw -Encoding UTF8 $@ \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 247 | ^| % {$$_-replace '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 248 | '# Generated from $?, DO NOT EDIT'}) \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 249 | ^| 1>nul New-Item -Force -Path . -ItemType file -Name $@ |
| 250 | |
| 251 | # Convert sk.po to create sk.cp1250.po. |
| 252 | sk.cp1250.po: sk.po |
| 253 | -$(RM) $@ |
| 254 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 255 | "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $? |
| 256 | !ELSE |
| 257 | ! IF DEFINED (ICONV) |
| 258 | $(ICONV) -f ISO-8859-2 -t CP1250 $? > $@ |
| 259 | ! ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 260 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 261 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 262 | [System.Text.Encoding]::GetEncoding(28592)), \ |
| 263 | [System.Text.Encoding]::GetEncoding(1250)) |
| 264 | ! ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 265 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 266 | [System.Text.Encoding]::GetEncoding(1250)) -replace \ |
| 267 | 'charset=iso-8859-2', 'charset=CP1250'; \ |
| 268 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 269 | [System.Text.Encoding]::GetEncoding(1250)) |
| 270 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 271 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 272 | [System.Text.Encoding]::GetEncoding(1250)) -replace \ |
| 273 | '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 274 | '# Generated from $?, DO NOT EDIT'; \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 275 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 276 | [System.Text.Encoding]::GetEncoding(1250)) |
| 277 | |
| 278 | # Convert zh_CN.UTF-8.po to create zh_CN.po. |
| 279 | zh_CN.po: zh_CN.UTF-8.po |
| 280 | -$(RM) $@ |
| 281 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 282 | "$(GETTEXT_PATH)\msgconv.exe" -t GB2312 -o $@ $? |
| 283 | !ELSE |
| 284 | ! IF DEFINED (ICONV) |
| 285 | $(ICONV) -f UTF-8 -t GB2312 $? > $@ |
| 286 | ! ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 287 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 288 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 289 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 290 | [System.Text.Encoding]::GetEncoding(936)) |
| 291 | |
| 292 | ! ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 293 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 294 | [System.Text.Encoding]::GetEncoding(936)) -replace \ |
| 295 | 'charset=UTF-8', 'charset=GB2312'; \ |
| 296 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 297 | [System.Text.Encoding]::GetEncoding(936)) |
| 298 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 299 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 300 | [System.Text.Encoding]::GetEncoding(936)) -replace \ |
| 301 | '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 302 | '# Generated from $?, DO NOT EDIT'; \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 303 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 304 | [System.Text.Encoding]::GetEncoding(936)) |
| 305 | |
| 306 | # Convert zh_CN.UTF-8.po to create zh_CN.cp936.po. |
| 307 | # Set 'charset' to gbk to avoid that msfmt generates a warning. |
| 308 | # This used to convert from zh_CN.po, but that results in a conversion error. |
| 309 | zh_CN.cp936.po: zh_CN.UTF-8.po |
| 310 | -$(RM) $@ |
| 311 | !IF DEFINED (ICONV) |
| 312 | $(ICONV) -f UTF-8 -t CP936 $? > $@ |
| 313 | !ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 314 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 315 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 316 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 317 | [System.Text.Encoding]::GetEncoding(20936)) |
| 318 | |
| 319 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 320 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 321 | [System.Text.Encoding]::GetEncoding(20936)) \ |
| 322 | -replace 'charset=UTF-8', 'charset=GBK'\ |
| 323 | -replace '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 324 | '# Generated from $?, DO NOT EDIT'; \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 325 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 326 | [System.Text.Encoding]::GetEncoding(20936)) |
| 327 | |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 328 | # Convert zh_TW.UTF-8.po to create zh_TW.po. |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 329 | zh_TW.po: zh_TW.UTF-8.po |
| 330 | -$(RM) $@ |
| 331 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 332 | "$(GETTEXT_PATH)\msgconv.exe" -t BIG5 -o $@ $? |
| 333 | !ELSE |
| 334 | ! IF DEFINED (ICONV) |
| 335 | $(ICONV) -f UTF-8 -t BIG5 $? > $@ |
| 336 | ! ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 337 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 338 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 339 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 340 | [System.Text.Encoding]::GetEncoding(950)) |
| 341 | |
| 342 | ! ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 343 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 344 | [System.Text.Encoding]::GetEncoding(950)) -replace \ |
| 345 | 'charset=UTF-8', 'charset=BIG5'; \ |
| 346 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 347 | [System.Text.Encoding]::GetEncoding(950)) |
| 348 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 349 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 350 | [System.Text.Encoding]::GetEncoding(950)) -replace \ |
| 351 | '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 352 | '# Generated from $?, DO NOT EDIT'; \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 353 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 354 | [System.Text.Encoding]::GetEncoding(950)) |
| 355 | |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 356 | # Convert zh_TW.UTF-8.po to create zh_TW.po with backslash characters. |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 357 | # Requires doubling backslashes in the second byte. Don't depend on big5corr, |
| 358 | # it should only be compiled when zh_TW.po is outdated. |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 359 | |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 360 | # |
| 361 | # 06.11.23, added by Restorer: |
| 362 | # For more details, see: |
| 363 | # https://github.com/vim/vim/pull/3261 |
| 364 | # https://github.com/vim/vim/pull/3476 |
| 365 | # https://github.com/vim/vim/pull/12153 |
| 366 | # (read all comments) |
| 367 | # |
| 368 | # I checked the workability on the list of backslash characters |
| 369 | # specified in zh_TW.UTF-8.po. It works. |
| 370 | # But it is better to have someone native speaker check it. |
| 371 | # |
| 372 | |
| 373 | #zh_TW.po: zh_TW.UTF-8.po |
| 374 | # @$(MAKE) -nologo -f Make_mvc.mak big5corr |
| 375 | # -$(RM) $@ |
| 376 | #!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 377 | # "$(GETTEXT_PATH)\msgconv.exe" -t BIG5 $? | .\big5corr.exe > $@ |
| 378 | #!ELSEIF DEFINED (ICONV) |
| 379 | # $(ICONV) -f UTF-8 -t BIG5 $? | .\big5corr.exe > $@ |
| 380 | #!ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 381 | # $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 382 | # [System.IO.File]::ReadAllText(\"$?\", \ |
| 383 | # [System.Text.Encoding]::GetEncoding(65001)), \ |
| 384 | # [System.Text.Encoding]::GetEncoding(950)) |
| 385 | # type $@ | .\big5corr.exe > tmp.$@ |
| 386 | # @$(MV) tmp.$@ $@ |
| 387 | #!ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 388 | # $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 389 | # [System.Text.Encoding]::GetEncoding(950)) \ |
| 390 | # -replace \"`r`n\", \"`n\"; \ |
| 391 | # [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 392 | # [System.Text.Encoding]::GetEncoding(950)) |
| 393 | |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 394 | # See above in the zh_TW.po conversion section for backslashes. |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 395 | #big5corr: big5corr.c |
| 396 | # $(CC) big5corr.c |
| 397 | |
| 398 | # Convert ko.UTF-8.po to create ko.po. |
| 399 | ko.po: ko.UTF-8.po |
| 400 | -$(RM) $@ |
| 401 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 402 | "$(GETTEXT_PATH)\msgconv.exe" -t EUC-KR -o $@ $? |
| 403 | !ELSE |
| 404 | ! IF DEFINED (ICONV) |
| 405 | $(ICONV) -f UTF-8 -t EUC-KR $? > $@ |
| 406 | ! ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 407 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 408 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 409 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 410 | [System.Text.Encoding]::GetEncoding(51949)) |
| 411 | |
| 412 | ! ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 413 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 414 | [System.Text.Encoding]::GetEncoding(51949)) -replace \ |
| 415 | 'charset=UTF-8', 'charset=EUC-KR'; \ |
| 416 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 417 | [System.Text.Encoding]::GetEncoding(51949)) |
| 418 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 419 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 420 | [System.Text.Encoding]::GetEncoding(51949)) -replace \ |
| 421 | '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 422 | '# Generated from $?, DO NOT EDIT'; \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 423 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 424 | [System.Text.Encoding]::GetEncoding(51949)) |
| 425 | |
| 426 | # Convert ru.po to create ru.cp1251.po. |
| 427 | ru.cp1251.po: ru.po |
| 428 | -$(RM) $@ |
| 429 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 430 | "$(GETTEXT_PATH)\msgconv.exe" -t CP1251 -o $@ $? |
| 431 | !ELSE |
| 432 | ! IF DEFINED (ICONV) |
| 433 | $(ICONV) -f UTF-8 -t CP1251 $? > $@ |
| 434 | ! ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 435 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 436 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 437 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 438 | [System.Text.Encoding]::GetEncoding(1251)) |
| 439 | |
| 440 | ! ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 441 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 442 | [System.Text.Encoding]::GetEncoding(1251)) -replace \ |
| 443 | 'charset=UTF-8', 'charset=CP1251'; \ |
| 444 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 445 | [System.Text.Encoding]::GetEncoding(1251)) |
| 446 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 447 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 448 | [System.Text.Encoding]::GetEncoding(1251)) -replace \ |
| 449 | '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 450 | '# Generated from $?, DO NOT EDIT'; \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 451 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 452 | [System.Text.Encoding]::GetEncoding(1251)) |
| 453 | |
| 454 | # Convert uk.po to create uk.cp1251.po. |
| 455 | uk.cp1251.po: uk.po |
| 456 | -$(RM) $@ |
| 457 | !IF EXIST ("$(GETTEXT_PATH)\msgconv.exe") |
| 458 | "$(GETTEXT_PATH)\msgconv.exe" -t CP1251 -o $@ $? |
| 459 | !ELSE |
| 460 | ! IF DEFINED (ICONV) |
| 461 | $(ICONV) -f UTF-8 -t CP1251 $? > $@ |
| 462 | ! ELSE |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 463 | $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 464 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 465 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 466 | [System.Text.Encoding]::GetEncoding(1251)) |
| 467 | |
| 468 | ! ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 469 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 470 | [System.Text.Encoding]::GetEncoding(1251)) -replace \ |
| 471 | 'charset=UTF-8', 'charset=CP1251'; \ |
| 472 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 473 | [System.Text.Encoding]::GetEncoding(1251)) |
| 474 | !ENDIF |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 475 | $(PS) $(PSFLAGS) $$out = [System.IO.File]::ReadAllText(\"$@\", \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 476 | [System.Text.Encoding]::GetEncoding(1251)) -replace \ |
| 477 | '# Original translations', \ |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 478 | '# Generated from $?, DO NOT EDIT'; \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 479 | [System.IO.File]::WriteAllText(\"$@\", $$out, \ |
| 480 | [System.Text.Encoding]::GetEncoding(1251)) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 481 | |
| 482 | .po.mo: |
Bram Moolenaar | 0138062 | 2015-12-29 16:04:42 +0100 | [diff] [blame] | 483 | set OLD_PO_FILE_INPUT=yes |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 484 | $(MSGFMT) -o $@ $< |
| 485 | |
Bram Moolenaar | fa57335 | 2020-09-04 13:53:00 +0200 | [diff] [blame] | 486 | PO_INPUTLIST = \ |
| 487 | ..\*.c \ |
| 488 | ..\if_perl.xs \ |
| 489 | ..\GvimExt\gvimext.cpp \ |
| 490 | ..\errors.h \ |
| 491 | ..\globals.h \ |
| 492 | ..\if_py_both.h \ |
| 493 | ..\vim.h \ |
| 494 | gvim.desktop.in \ |
| 495 | vim.desktop.in |
| 496 | |
Bram Moolenaar | 167fb6d | 2023-05-23 15:27:51 +0100 | [diff] [blame] | 497 | files: $(PO_INPUTLIST) |
Bram Moolenaar | fa57335 | 2020-09-04 13:53:00 +0200 | [diff] [blame] | 498 | $(LS) $(LSFLAGS) $(PO_INPUTLIST) > .\files |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 499 | |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 500 | first_time: files |
RestorerZ | cd33faf | 2024-07-04 17:47:16 +0200 | [diff] [blame] | 501 | "$(VIMPROG)" -u NONE --not-a-term -S tojavascript.vim $(LANGUAGE).po \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 502 | $(PO_VIM_INPUTLIST) |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame^] | 503 | @ copy /a .\files+.\vim_to_js .\allfiles |
Bram Moolenaar | 0138062 | 2015-12-29 16:04:42 +0100 | [diff] [blame] | 504 | set OLD_PO_FILE_INPUT=yes |
| 505 | set OLD_PO_FILE_OUTPUT=yes |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 506 | $(XGETTEXT) --default-domain=$(LANGUAGE) --add-comments $(XGETTEXT_KEYWORDS) \ |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame^] | 507 | --files-from=.\allfiles |
RestorerZ | cd33faf | 2024-07-04 17:47:16 +0200 | [diff] [blame] | 508 | "$(VIMPROG)" -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).po \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 509 | $(PO_VIM_INPUTLIST) |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame^] | 510 | $(RM) *.js .\vim_to_js |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 511 | |
Bram Moolenaar | fa57335 | 2020-09-04 13:53:00 +0200 | [diff] [blame] | 512 | $(PACKAGE).pot: files |
RestorerZ | cd33faf | 2024-07-04 17:47:16 +0200 | [diff] [blame] | 513 | "$(VIMPROG)" -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 514 | $(PO_VIM_INPUTLIST) |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame^] | 515 | @ copy /a .\files+.\vim_to_js .\allfiles |
Bram Moolenaar | 0138062 | 2015-12-29 16:04:42 +0100 | [diff] [blame] | 516 | set OLD_PO_FILE_INPUT=yes |
| 517 | set OLD_PO_FILE_OUTPUT=yes |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame^] | 518 | $(XGETTEXT) --default-domain=$(PACKAGE) --output=$(PACKAGE).pot \ |
| 519 | --add-comments $(XGETTEXT_KEYWORDS) --files-from=.\allfiles |
RestorerZ | cd33faf | 2024-07-04 17:47:16 +0200 | [diff] [blame] | 520 | "$(VIMPROG)" -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot \ |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 521 | $(PO_VIM_INPUTLIST) |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame^] | 522 | $(RM) *.js .\vim_to_js |
Bram Moolenaar | fa57335 | 2020-09-04 13:53:00 +0200 | [diff] [blame] | 523 | |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 524 | # Only original translations with default encoding should be updated. |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 525 | # The files that are converted to a different encoding clearly state "DO NOT EDIT". |
| 526 | update-po: $(MOFILES:.mo=) |
| 527 | |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 528 | # Don't add a dependency here, we only want to update the .po files manually. |
Bram Moolenaar | fa57335 | 2020-09-04 13:53:00 +0200 | [diff] [blame] | 529 | $(LANGUAGES): |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 530 | @$(MAKE) -nologo -f Make_mvc.mak GETTEXT_PATH="$(GETTEXT_PATH)" $(PACKAGE).pot |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 531 | $(CP) $@.po $@.po.orig |
| 532 | $(MV) $@.po $@.po.old |
| 533 | $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po |
| 534 | $(RM) $@.po.old |
| 535 | |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 536 | install: $(LANGUAGE).mo |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 537 | if not exist "$(INSTALLDIR)" $(MKD) "$(INSTALLDIR)" |
| 538 | $(CP) $(LANGUAGE).mo "$(INSTALLDIR)\$(PACKAGE).mo" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 539 | |
Bram Moolenaar | 0138062 | 2015-12-29 16:04:42 +0100 | [diff] [blame] | 540 | install-all: all |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 541 | for %%l in ($(LANGUAGES)) do @if not exist "$(VIMRUNTIME)\lang\%%l\LC_MESSAGES" \ |
| 542 | $(MKD) "$(VIMRUNTIME)\lang\%%l\LC_MESSAGES" |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 543 | for %%l in ($(LANGUAGES)) do @$(CP) %%l.mo \ |
RestorerZ | e498caf | 2024-03-12 22:11:36 +0100 | [diff] [blame] | 544 | "$(VIMRUNTIME)\lang\%%l\LC_MESSAGES\$(PACKAGE).mo" |
Bram Moolenaar | 0138062 | 2015-12-29 16:04:42 +0100 | [diff] [blame] | 545 | |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 546 | cleanup-po: $(LANGUAGE).po |
RestorerZ | cd33faf | 2024-07-04 17:47:16 +0200 | [diff] [blame] | 547 | "$(VIMPROG)" -u NONE -e -X -S cleanup.vim -c wq $(LANGUAGE).po |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 548 | |
| 549 | cleanup-po-all: $(POFILES) |
RestorerZ | cd33faf | 2024-07-04 17:47:16 +0200 | [diff] [blame] | 550 | !"$(VIMPROG)" -u NONE -e -X -S cleanup.vim -c wq $** |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 551 | |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame^] | 552 | ####### |
| 553 | # For translations of plug-ins |
| 554 | ####### |
| 555 | |
| 556 | # Preparing the POT file of the plug-in package |
| 557 | POT_PLUGPACKAGE_PATH = $(MAKEDIR) |
| 558 | $(PLUGPACKAGE).pot : $(PO_PLUG_INPUTLIST) |
| 559 | "$(VIMPROG)" -u NONE --not-a-term -S tojavascript.vim \ |
| 560 | $(PLUGPACKAGE).pot $** |
| 561 | $(XGETTEXT) --from-code=UTF-8 --default-domain=$(PLUGPACKAGE) \ |
| 562 | --package-name=$(PLUGPACKAGE) \ |
| 563 | --output-dir="$(POT_PLUGPACKAGE_PATH)" \ |
| 564 | --output=$(PLUGPACKAGE).pot --files-from=.\vim_to_js |
| 565 | "$(VIMPROG)" -u NONE --not-a-term -S fixfilenames.vim \ |
| 566 | "$(POT_PLUGPACKAGE_PATH)\$(PLUGPACKAGE).pot" $** |
| 567 | $(RM) *.js .\vim_to_js |
| 568 | |
| 569 | # Converting the PO file of the plug-in package to the binary format of the MO file |
| 570 | MO_PLUGPACKAGE_PATH = $(MAKEDIR) |
| 571 | $(PLUGPACKAGE).mo : $(PO_PLUGPACKAGE) |
| 572 | $(MSGFMT) -o $(MO_PLUGPACKAGE_PATH)\$@ $? |
| 573 | |
| 574 | |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 575 | clean: checkclean |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 576 | $(RM) *.mo |
| 577 | $(RM) *.pot |
RestorerZ | 76ba724 | 2024-01-22 20:28:12 +0100 | [diff] [blame] | 578 | $(RM) *.orig |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame^] | 579 | $(RM) files allfiles |
RestorerZ | e214692 | 2023-11-23 20:58:32 +0100 | [diff] [blame] | 580 | $(RM) sjiscorr.obj sjiscorr.exe |
| 581 | # $(RM) big5corr.obj big5corr.exe |
| 582 | |
| 583 | # vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: |