blob: eaf68670b7f2ce213b7689bd10ef00d258c83a2d [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001# Makefile for the Vim message translations for MSVC
2# (based on make_ming.mak)
3#
4# Mike Williams <mrw@eandem.co.uk>
5#
6# Please read README_mvc.txt before using this file.
7#
8
RestorerZe2146922023-11-23 20:58:32 +01009!IF [powershell -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2
10!ERROR The program "PowerShell" version 3.0 or higher is required to work
11!ENDIF
12
Bram Moolenaar167fb6d2023-05-23 15:27:51 +010013# get LANGUAGES, MOFILES, MOCONVERTED and others
RestorerZe2146922023-11-23 20:58:32 +010014!INCLUDE Make_all.mak
15
16!IFNDEF VIMRUNTIME
17VIMRUNTIME = ..\..\runtime
18!ENDIF
Bram Moolenaar071d4272004-06-13 20:20:40 +000019
20PACKAGE = vim
Ken Takata075ad702023-11-25 15:51:00 +010021# Correct the following line for the where executeable file vim is installed.
Bram Moolenaarfa573352020-09-04 13:53:00 +020022VIM = ..\vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000023
Ken Takata075ad702023-11-25 15:51:00 +010024# Correct the following line for the directory where gettext et al is
25# installed. Please do not put the path in quotes.
RestorerZe2146922023-11-23 20:58:32 +010026GETTEXT_PATH = D:\Programs\GetText\bin
Bram Moolenaar071d4272004-06-13 20:20:40 +000027
Ken Takata075ad702023-11-25 15:51:00 +010028MSGFMT = "$(GETTEXT_PATH)\msgfmt" -v
29XGETTEXT = "$(GETTEXT_PATH)\xgettext"
30MSGMERGE = "$(GETTEXT_PATH)\msgmerge"
Bram Moolenaar071d4272004-06-13 20:20:40 +000031
RestorerZe2146922023-11-23 20:58:32 +010032# In case some package like GnuWin32, UnixUtils, gettext
33# or something similar is installed on the system.
34# If the "iconv" program is installed on the system, but it is not registered
35# in the %PATH% environment variable, then specify the full path to this file.
36!IF EXIST ("iconv.exe")
37ICONV = "iconv.exe"
38!ELSEIF EXIST ("$(GETTEXT_PATH)\iconv.exe")
39ICONV="$(GETTEXT_PATH)\iconv.exe"
40!ENDIF
41
42# In case some package like GnuWin32, UnixUtils
43# or something similar is installed on the system.
44# If the "touch" program is installed on the system, but it is not registered
45# in the %PATH% environment variable, then specify the full path to this file.
46!IF EXIST ("touch.exe")
Ken Takata075ad702023-11-25 15:51:00 +010047TOUCH_TARGET = touch.exe $@
RestorerZe2146922023-11-23 20:58:32 +010048!ELSE
Ken Takata075ad702023-11-25 15:51:00 +010049TOUCH_TARGET = @if exist $@ ( copy /b $@+,, ) else ( type nul >$@ )
RestorerZe2146922023-11-23 20:58:32 +010050!ENDIF
51
52MV = move /y
53CP = copy /y
54RM = del /q
Bram Moolenaar071d4272004-06-13 20:20:40 +000055MKD = mkdir
56LS = dir
57
58LSFLAGS = /b /on /l /s
59
60INSTALLDIR = $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES
61
62.SUFFIXES:
RestorerZe2146922023-11-23 20:58:32 +010063.SUFFIXES: .po .mo .pot .ck
64
65all: $(MOFILES) $(MOCONVERTED)
66
67.po.ck:
Ken Takata075ad702023-11-25 15:51:00 +010068 $(VIM) -u NONE --noplugins -e -s -X --cmd "set enc=utf-8" -S check.vim \
69 -c "if error == 0 | q | else | num 2 | cq | endif" $<
70 $(TOUCH_TARGET)
RestorerZe2146922023-11-23 20:58:32 +010071
72check: $(CHECKFILES)
73
74checkclean:
75 $(RM) *.ck
76
77converted: $(MOCONVERTED)
78
Ken Takata075ad702023-11-25 15:51:00 +010079checklanguage:
80 @if "$(LANGUAGE)"=="" (echo Set the environment variable ^%LANGUAGE^%. See README_mvc.txt. && exit 1)
81
RestorerZe2146922023-11-23 20:58:32 +010082nl.po:
83 @( echo \# > nl.po )
84
85# Norwegian/Bokmal: "nb" is an alias for "no".
86nb.po: no.po
87 $(CP) no.po nb.po
88
89# Convert ja.po to create ja.sjis.po.
90ja.sjis.po: ja.po
91 @$(MAKE) -nologo -f Make_mvc.mak sjiscorr
92 -$(RM) $@
93!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
94 "$(GETTEXT_PATH)\msgconv.exe" -t CP932 $? | .\sjiscorr.exe > $@
95!ELSEIF DEFINED (ICONV)
96 $(ICONV) -f UTF-8 -t CP932 $? | .\sjiscorr.exe > $@
97!ELSE
98 powershell -nologo -noprofile -Command \
99 [System.IO.File]::WriteAllText(\"$@\", \
100 [System.IO.File]::ReadAllText(\"$?\", \
101 [System.Text.Encoding]::GetEncoding(65001)), \
102 [System.Text.Encoding]::GetEncoding(932))
103 type $@ | .\sjiscorr.exe > tmp.$@
104 @$(MV) tmp.$@ $@
105!ENDIF
106 powershell -nologo -noprofile -Command \
107 $$out = [System.IO.File]::ReadAllText(\"$@\", \
108 [System.Text.Encoding]::GetEncoding(932)) \
109 -replace \"`r`n\", \"`n\"; \
110 [System.IO.File]::WriteAllText(\"$@\", $$out, \
111 [System.Text.Encoding]::GetEncoding(932))
112
113sjiscorr: sjiscorr.c
114 $(CC) sjiscorr.c
115
116# Convert ja.po to create ja.euc-jp.po
117ja.euc-jp.po: ja.po
118 -$(RM) $@
119!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
120 "$(GETTEXT_PATH)\msgconv.exe" -t EUC-JP -o $@ $?
121!ELSE
122! IF DEFINED (ICONV)
123 $(ICONV) -f UTF-8 -t EUC-JP $? > $@
124! ELSE
125 powershell -nologo -noprofile -Command \
126 [System.IO.File]::WriteAllText(\"$@\", \
127 [System.IO.File]::ReadAllText(\"$?\", \
128 [System.Text.Encoding]::GetEncoding(65001)), \
129 [System.Text.Encoding]::GetEncoding(20932))
130! ENDIF
131 powershell -nologo -noprofile -Command \
132 $$out = [System.IO.File]::ReadAllText(\"$@\", \
133 [System.Text.Encoding]::GetEncoding(20932)) -replace \
134 'charset=utf-8', 'charset=EUC-JP'; \
135 [System.IO.File]::WriteAllText(\"$@\", $$out, \
136 [System.Text.Encoding]::GetEncoding(20932))
137!ENDIF
138 powershell -nologo -noprofile -Command \
139 $$out = [System.IO.File]::ReadAllText(\"$@\", \
140 [System.Text.Encoding]::GetEncoding(20932)) -replace \
141 '# Original translations', \
142 '# Generated from ja.po, DO NOT EDIT'; \
143 [System.IO.File]::WriteAllText(\"$@\", $$out, \
144 [System.Text.Encoding]::GetEncoding(20932))
145
146# Convert cs.po to create cs.cp1250.po.
147cs.cp1250.po: cs.po
148 -$(RM) $@
149!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
150 "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $?
151!ELSE
152! IF DEFINED (ICONV)
153 $(ICONV) -f ISO-8859-2 -t CP1250 $? > $@
154! ELSE
155 powershell -nologo -noprofile -Command \
156 [System.IO.File]::WriteAllText(\"$@\", \
157 [System.IO.File]::ReadAllText(\"$?\", \
158 [System.Text.Encoding]::GetEncoding(28592)), \
159 [System.Text.Encoding]::GetEncoding(1250))
160! ENDIF
161 powershell -nologo -noprofile -Command \
162 $$out = [System.IO.File]::ReadAllText(\"$@\", \
163 [System.Text.Encoding]::GetEncoding(1250)) -replace \
164 'charset=iso-8859-2', 'charset=CP1250'; \
165 [System.IO.File]::WriteAllText(\"$@\", $$out, \
166 [System.Text.Encoding]::GetEncoding(1250))
167!ENDIF
168 powershell -nologo -noprofile -Command \
169 $$out = [System.IO.File]::ReadAllText(\"$@\", \
170 [System.Text.Encoding]::GetEncoding(1250)) -replace \
171 '# Original translations', \
172 '# Generated from cs.po, DO NOT EDIT'; \
173 [System.IO.File]::WriteAllText(\"$@\", $$out, \
174 [System.Text.Encoding]::GetEncoding(1250))
175
176# Convert pl.po to create pl.cp1250.po.
177pl.cp1250.po: pl.po
178 -$(RM) $@
179!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
180 "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $?
181!ELSE
182! IF DEFINED (ICONV)
183 $(ICONV) -f ISO-8859-2 -t CP1250 $? > $@
184! ELSE
185 powershell -nologo -noprofile -Command \
186 [System.IO.File]::WriteAllText(\"$@\", \
187 [System.IO.File]::ReadAllText(\"$?\", \
188 [System.Text.Encoding]::GetEncoding(28592)), \
189 [System.Text.Encoding]::GetEncoding(1250))
190! ENDIF
191 powershell -nologo -noprofile -Command \
192 $$out = [System.IO.File]::ReadAllText(\"$@\", \
193 [System.Text.Encoding]::GetEncoding(1250)) -replace \
194 'charset=iso-8859-2', 'charset=CP1250'; \
195 [System.IO.File]::WriteAllText(\"$@\", $$out, \
196 [System.Text.Encoding]::GetEncoding(1250))
197!ENDIF
198 powershell -nologo -noprofile -Command \
199 $$out = [System.IO.File]::ReadAllText(\"$@\", \
200 [System.Text.Encoding]::GetEncoding(1250)) -replace \
201 '# Original translations', \
202 '# Generated from pl.po, DO NOT EDIT'; \
203 [System.IO.File]::WriteAllText(\"$@\", $$out, \
204 [System.Text.Encoding]::GetEncoding(1250))
205
206# Convert pl.po to create pl.UTF-8.po.
207pl.UTF-8.po: pl.po
208 -$(RM) $@
209!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
210 "$(GETTEXT_PATH)\msgconv.exe" -t UTF-8 -o $@ $?
211!ELSE
212! IF DEFINED (ICONV)
213 $(ICONV) -f ISO-8859-2 -t UTF-8 $? > $@
214! ELSE
215 powershell -nologo -noprofile -Command \
216 [System.IO.File]::WriteAllText(\"$@\", \
217 [System.IO.File]::ReadAllText(\"$?\", \
218 [System.Text.Encoding]::GetEncoding(28592)))
219! ENDIF
220 powershell -nologo -noprofile -Command \
221 (Get-Content -Raw -Encoding UTF8 $@ \
222 ^| % {$$_-replace 'charset=iso-8859-2', 'charset=UTF-8'}) \
223 ^| 1>nul New-Item -Force -Path . -ItemType file -Name $@
224!ENDIF
225 powershell -nologo -noprofile -Command \
226 (Get-Content -Raw -Encoding UTF8 $@ \
227 ^| % {$$_-replace '# Original translations', \
228 '# Generated from pl.po, DO NOT EDIT'}) \
229 ^| 1>nul New-Item -Force -Path . -ItemType file -Name $@
230
231# Convert sk.po to create sk.cp1250.po.
232sk.cp1250.po: sk.po
233 -$(RM) $@
234!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
235 "$(GETTEXT_PATH)\msgconv.exe" -t CP1250 -o $@ $?
236!ELSE
237! IF DEFINED (ICONV)
238 $(ICONV) -f ISO-8859-2 -t CP1250 $? > $@
239! ELSE
240 powershell -nologo -noprofile -Command \
241 [System.IO.File]::WriteAllText(\"$@\", \
242 [System.IO.File]::ReadAllText(\"$?\", \
243 [System.Text.Encoding]::GetEncoding(28592)), \
244 [System.Text.Encoding]::GetEncoding(1250))
245! ENDIF
246 powershell -nologo -noprofile -Command \
247 $$out = [System.IO.File]::ReadAllText(\"$@\", \
248 [System.Text.Encoding]::GetEncoding(1250)) -replace \
249 'charset=iso-8859-2', 'charset=CP1250'; \
250 [System.IO.File]::WriteAllText(\"$@\", $$out, \
251 [System.Text.Encoding]::GetEncoding(1250))
252!ENDIF
253 powershell -nologo -noprofile -Command \
254 $$out = [System.IO.File]::ReadAllText(\"$@\", \
255 [System.Text.Encoding]::GetEncoding(1250)) -replace \
256 '# Original translations', \
257 '# Generated from sk.po, DO NOT EDIT'; \
258 [System.IO.File]::WriteAllText(\"$@\", $$out, \
259 [System.Text.Encoding]::GetEncoding(1250))
260
261# Convert zh_CN.UTF-8.po to create zh_CN.po.
262zh_CN.po: zh_CN.UTF-8.po
263 -$(RM) $@
264!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
265 "$(GETTEXT_PATH)\msgconv.exe" -t GB2312 -o $@ $?
266!ELSE
267! IF DEFINED (ICONV)
268 $(ICONV) -f UTF-8 -t GB2312 $? > $@
269! ELSE
270 powershell -nologo -noprofile -Command \
271 [System.IO.File]::WriteAllText(\"$@\", \
272 [System.IO.File]::ReadAllText(\"$?\", \
273 [System.Text.Encoding]::GetEncoding(65001)), \
274 [System.Text.Encoding]::GetEncoding(936))
275
276! ENDIF
277 powershell -nologo -noprofile -Command \
278 $$out = [System.IO.File]::ReadAllText(\"$@\", \
279 [System.Text.Encoding]::GetEncoding(936)) -replace \
280 'charset=UTF-8', 'charset=GB2312'; \
281 [System.IO.File]::WriteAllText(\"$@\", $$out, \
282 [System.Text.Encoding]::GetEncoding(936))
283!ENDIF
284 powershell -nologo -noprofile -Command \
285 $$out = [System.IO.File]::ReadAllText(\"$@\", \
286 [System.Text.Encoding]::GetEncoding(936)) -replace \
287 '# Original translations', \
288 '# Generated from zh_CN.UTF-8.po, DO NOT EDIT'; \
289 [System.IO.File]::WriteAllText(\"$@\", $$out, \
290 [System.Text.Encoding]::GetEncoding(936))
291
292# Convert zh_CN.UTF-8.po to create zh_CN.cp936.po.
293# Set 'charset' to gbk to avoid that msfmt generates a warning.
294# This used to convert from zh_CN.po, but that results in a conversion error.
295zh_CN.cp936.po: zh_CN.UTF-8.po
296 -$(RM) $@
297!IF DEFINED (ICONV)
298 $(ICONV) -f UTF-8 -t CP936 $? > $@
299!ELSE
300 powershell -nologo -noprofile -Command \
301 [System.IO.File]::WriteAllText(\"$@\", \
302 [System.IO.File]::ReadAllText(\"$?\", \
303 [System.Text.Encoding]::GetEncoding(65001)), \
304 [System.Text.Encoding]::GetEncoding(20936))
305
306!ENDIF
307 powershell -nologo -noprofile -Command \
308 $$out = [System.IO.File]::ReadAllText(\"$@\", \
309 [System.Text.Encoding]::GetEncoding(20936)) \
310 -replace 'charset=UTF-8', 'charset=GBK'\
311 -replace '# Original translations', \
312 '# Generated from zh_CN.UTF-8.po, DO NOT EDIT'; \
313 [System.IO.File]::WriteAllText(\"$@\", $$out, \
314 [System.Text.Encoding]::GetEncoding(20936))
315
316# Convert zh_TW.UTF-8.po to create zh_TW.po
317zh_TW.po: zh_TW.UTF-8.po
318 -$(RM) $@
319!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
320 "$(GETTEXT_PATH)\msgconv.exe" -t BIG5 -o $@ $?
321!ELSE
322! IF DEFINED (ICONV)
323 $(ICONV) -f UTF-8 -t BIG5 $? > $@
324! ELSE
325 powershell -nologo -noprofile -Command \
326 [System.IO.File]::WriteAllText(\"$@\", \
327 [System.IO.File]::ReadAllText(\"$?\", \
328 [System.Text.Encoding]::GetEncoding(65001)), \
329 [System.Text.Encoding]::GetEncoding(950))
330
331! ENDIF
332 powershell -nologo -noprofile -Command \
333 $$out = [System.IO.File]::ReadAllText(\"$@\", \
334 [System.Text.Encoding]::GetEncoding(950)) -replace \
335 'charset=UTF-8', 'charset=BIG5'; \
336 [System.IO.File]::WriteAllText(\"$@\", $$out, \
337 [System.Text.Encoding]::GetEncoding(950))
338!ENDIF
339 powershell -nologo -noprofile -Command \
340 $$out = [System.IO.File]::ReadAllText(\"$@\", \
341 [System.Text.Encoding]::GetEncoding(950)) -replace \
342 '# Original translations', \
343 '# Generated from zh_TW.UTF-8.po, DO NOT EDIT'; \
344 [System.IO.File]::WriteAllText(\"$@\", $$out, \
345 [System.Text.Encoding]::GetEncoding(950))
346
347# Convert zh_TW.UTF-8.po to create zh_TW.po with backslash characters
348# Requires doubling backslashes in the second byte. Don't depend on big5corr,
349# it should only be compiled when zh_TW.po is outdated.
350#
351# 06.11.23, added by Restorer:
352# For more details, see:
353# https://github.com/vim/vim/pull/3261
354# https://github.com/vim/vim/pull/3476
355# https://github.com/vim/vim/pull/12153
356# (read all comments)
357#
358# I checked the workability on the list of backslash characters
359# specified in zh_TW.UTF-8.po. It works.
360# But it is better to have someone native speaker check it.
361#
362
363#zh_TW.po: zh_TW.UTF-8.po
364# @$(MAKE) -nologo -f Make_mvc.mak big5corr
365# -$(RM) $@
366#!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
367# "$(GETTEXT_PATH)\msgconv.exe" -t BIG5 $? | .\big5corr.exe > $@
368#!ELSEIF DEFINED (ICONV)
369# $(ICONV) -f UTF-8 -t BIG5 $? | .\big5corr.exe > $@
370#!ELSE
371# powershell -nologo -noprofile -Command \
372# [System.IO.File]::WriteAllText(\"$@\", \
373# [System.IO.File]::ReadAllText(\"$?\", \
374# [System.Text.Encoding]::GetEncoding(65001)), \
375# [System.Text.Encoding]::GetEncoding(950))
376# type $@ | .\big5corr.exe > tmp.$@
377# @$(MV) tmp.$@ $@
378#!ENDIF
379# powershell -nologo -noprofile -Command \
380# $$out = [System.IO.File]::ReadAllText(\"$@\", \
381# [System.Text.Encoding]::GetEncoding(950)) \
382# -replace \"`r`n\", \"`n\"; \
383# [System.IO.File]::WriteAllText(\"$@\", $$out, \
384# [System.Text.Encoding]::GetEncoding(950))
385
386# see above in the zh_TW.po conversion section for backslashes.
387#big5corr: big5corr.c
388# $(CC) big5corr.c
389
390# Convert ko.UTF-8.po to create ko.po.
391ko.po: ko.UTF-8.po
392 -$(RM) $@
393!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
394 "$(GETTEXT_PATH)\msgconv.exe" -t EUC-KR -o $@ $?
395!ELSE
396! IF DEFINED (ICONV)
397 $(ICONV) -f UTF-8 -t EUC-KR $? > $@
398! ELSE
399 powershell -nologo -noprofile -Command \
400 [System.IO.File]::WriteAllText(\"$@\", \
401 [System.IO.File]::ReadAllText(\"$?\", \
402 [System.Text.Encoding]::GetEncoding(65001)), \
403 [System.Text.Encoding]::GetEncoding(51949))
404
405! ENDIF
406 powershell -nologo -noprofile -Command \
407 $$out = [System.IO.File]::ReadAllText(\"$@\", \
408 [System.Text.Encoding]::GetEncoding(51949)) -replace \
409 'charset=UTF-8', 'charset=EUC-KR'; \
410 [System.IO.File]::WriteAllText(\"$@\", $$out, \
411 [System.Text.Encoding]::GetEncoding(51949))
412!ENDIF
413 powershell -nologo -noprofile -Command \
414 $$out = [System.IO.File]::ReadAllText(\"$@\", \
415 [System.Text.Encoding]::GetEncoding(51949)) -replace \
416 '# Original translations', \
417 '# Generated from ko.UTF-8.po, DO NOT EDIT'; \
418 [System.IO.File]::WriteAllText(\"$@\", $$out, \
419 [System.Text.Encoding]::GetEncoding(51949))
420
421# Convert ru.po to create ru.cp1251.po.
422ru.cp1251.po: ru.po
423 -$(RM) $@
424!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
425 "$(GETTEXT_PATH)\msgconv.exe" -t CP1251 -o $@ $?
426!ELSE
427! IF DEFINED (ICONV)
428 $(ICONV) -f UTF-8 -t CP1251 $? > $@
429! ELSE
430 powershell -nologo -noprofile -Command \
431 [System.IO.File]::WriteAllText(\"$@\", \
432 [System.IO.File]::ReadAllText(\"$?\", \
433 [System.Text.Encoding]::GetEncoding(65001)), \
434 [System.Text.Encoding]::GetEncoding(1251))
435
436! ENDIF
437 powershell -nologo -noprofile -Command \
438 $$out = [System.IO.File]::ReadAllText(\"$@\", \
439 [System.Text.Encoding]::GetEncoding(1251)) -replace \
440 'charset=UTF-8', 'charset=CP1251'; \
441 [System.IO.File]::WriteAllText(\"$@\", $$out, \
442 [System.Text.Encoding]::GetEncoding(1251))
443!ENDIF
444 powershell -nologo -noprofile -Command \
445 $$out = [System.IO.File]::ReadAllText(\"$@\", \
446 [System.Text.Encoding]::GetEncoding(1251)) -replace \
447 '# Original translations', \
448 '# Generated from ru.po, DO NOT EDIT'; \
449 [System.IO.File]::WriteAllText(\"$@\", $$out, \
450 [System.Text.Encoding]::GetEncoding(1251))
451
452# Convert uk.po to create uk.cp1251.po.
453uk.cp1251.po: uk.po
454 -$(RM) $@
455!IF EXIST ("$(GETTEXT_PATH)\msgconv.exe")
456 "$(GETTEXT_PATH)\msgconv.exe" -t CP1251 -o $@ $?
457!ELSE
458! IF DEFINED (ICONV)
459 $(ICONV) -f UTF-8 -t CP1251 $? > $@
460! ELSE
461 powershell -nologo -noprofile -Command \
462 [System.IO.File]::WriteAllText(\"$@\", \
463 [System.IO.File]::ReadAllText(\"$?\", \
464 [System.Text.Encoding]::GetEncoding(65001)), \
465 [System.Text.Encoding]::GetEncoding(1251))
466
467! ENDIF
468 powershell -nologo -noprofile -Command \
469 $$out = [System.IO.File]::ReadAllText(\"$@\", \
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
475 powershell -nologo -noprofile -Command \
476 $$out = [System.IO.File]::ReadAllText(\"$@\", \
477 [System.Text.Encoding]::GetEncoding(1251)) -replace \
478 '# Original translations', \
479 '# Generated from uk.po, DO NOT EDIT'; \
480 [System.IO.File]::WriteAllText(\"$@\", $$out, \
481 [System.Text.Encoding]::GetEncoding(1251))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000482
483.po.mo:
Bram Moolenaar01380622015-12-29 16:04:42 +0100484 set OLD_PO_FILE_INPUT=yes
Bram Moolenaar071d4272004-06-13 20:20:40 +0000485 $(MSGFMT) -o $@ $<
486
Bram Moolenaarfa573352020-09-04 13:53:00 +0200487PO_INPUTLIST = \
488 ..\*.c \
489 ..\if_perl.xs \
490 ..\GvimExt\gvimext.cpp \
491 ..\errors.h \
492 ..\globals.h \
493 ..\if_py_both.h \
494 ..\vim.h \
495 gvim.desktop.in \
496 vim.desktop.in
497
Bram Moolenaar167fb6d2023-05-23 15:27:51 +0100498files: $(PO_INPUTLIST)
Bram Moolenaarfa573352020-09-04 13:53:00 +0200499 $(LS) $(LSFLAGS) $(PO_INPUTLIST) > .\files
Bram Moolenaar071d4272004-06-13 20:20:40 +0000500
Ken Takata075ad702023-11-25 15:51:00 +0100501first_time: checklanguage files
RestorerZe2146922023-11-23 20:58:32 +0100502 $(VIM) -u NONE --not-a-term -S tojavascript.vim $(LANGUAGE).po \
503 $(PO_VIM_INPUTLIST)
Bram Moolenaar01380622015-12-29 16:04:42 +0100504 set OLD_PO_FILE_INPUT=yes
505 set OLD_PO_FILE_OUTPUT=yes
RestorerZe2146922023-11-23 20:58:32 +0100506 $(XGETTEXT) --default-domain=$(LANGUAGE) --add-comments $(XGETTEXT_KEYWORDS) \
507 --files-from=.\files $(PO_VIM_JSLIST)
508 $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(LANGUAGE).po \
509 $(PO_VIM_INPUTLIST)
Bram Moolenaarfa573352020-09-04 13:53:00 +0200510 $(RM) *.js
Bram Moolenaar071d4272004-06-13 20:20:40 +0000511
Bram Moolenaarfa573352020-09-04 13:53:00 +0200512$(PACKAGE).pot: files
RestorerZe2146922023-11-23 20:58:32 +0100513 $(VIM) -u NONE --not-a-term -S tojavascript.vim $(PACKAGE).pot \
514 $(PO_VIM_INPUTLIST)
Bram Moolenaar01380622015-12-29 16:04:42 +0100515 set OLD_PO_FILE_INPUT=yes
516 set OLD_PO_FILE_OUTPUT=yes
RestorerZe2146922023-11-23 20:58:32 +0100517 $(XGETTEXT) --default-domain=$(PACKAGE) --add-comments $(XGETTEXT_KEYWORDS) \
518 --files-from=.\files $(PO_VIM_JSLIST)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000519 $(MV) $(PACKAGE).po $(PACKAGE).pot
RestorerZe2146922023-11-23 20:58:32 +0100520 $(VIM) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot \
521 $(PO_VIM_INPUTLIST)
Bram Moolenaarfa573352020-09-04 13:53:00 +0200522 $(RM) *.js
523
RestorerZe2146922023-11-23 20:58:32 +0100524# When updating ja.sjis.po there are a bunch of errors and a crash.
525# The files that are converted to a different encoding clearly state "DO NOT EDIT".
526update-po: $(MOFILES:.mo=)
527
Bram Moolenaarfa573352020-09-04 13:53:00 +0200528# Don't add a dependency here, we only want to update the .po files manually
529$(LANGUAGES):
Ken Takata075ad702023-11-25 15:51:00 +0100530 @$(MAKE) -nologo -f Make_mvc.mak $(PACKAGE).pot GETTEXT_PATH="$(GETTEXT_PATH)"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000531 $(CP) $@.po $@.po.orig
532 $(MV) $@.po $@.po.old
533 $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
534 $(RM) $@.po.old
535
Ken Takata075ad702023-11-25 15:51:00 +0100536install: checklanguage $(LANGUAGE).mo
Bram Moolenaar071d4272004-06-13 20:20:40 +0000537 if not exist $(INSTALLDIR) $(MKD) $(INSTALLDIR)
538 $(CP) $(LANGUAGE).mo $(INSTALLDIR)\$(PACKAGE).mo
539
Bram Moolenaar01380622015-12-29 16:04:42 +0100540install-all: all
RestorerZe2146922023-11-23 20:58:32 +0100541 for %%l in ($(LANGUAGES)) do @if not exist $(VIMRUNTIME)\lang\%%l\LC_MESSAGES \
542 $(MKD) $(VIMRUNTIME)\lang\%%l\LC_MESSAGES
543 for %%l in ($(LANGUAGES)) do @$(CP) %%l.mo \
544 $(VIMRUNTIME)\lang\%%l\LC_MESSAGES\$(PACKAGE).mo
Bram Moolenaar01380622015-12-29 16:04:42 +0100545
Ken Takata075ad702023-11-25 15:51:00 +0100546cleanup-po: checklanguage $(LANGUAGE).po
547 $(VIM) -u NONE -e -X -S cleanup.vim -c wq $(LANGUAGE).po
RestorerZe2146922023-11-23 20:58:32 +0100548
549cleanup-po-all: $(POFILES)
550 !$(VIM) -u NONE -e -X -S cleanup.vim -c wq $**
551
552clean: checkclean
Bram Moolenaar071d4272004-06-13 20:20:40 +0000553 $(RM) *.mo
554 $(RM) *.pot
Bram Moolenaarfa573352020-09-04 13:53:00 +0200555 $(RM) files
RestorerZe2146922023-11-23 20:58:32 +0100556 $(RM) sjiscorr.obj sjiscorr.exe
557# $(RM) big5corr.obj big5corr.exe
558
559# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: