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