Skip to content

Commit d1d037e

Browse files
committed
patch 8.1.0111: .po files do not use recommended names
Problem: .po files do not use recommended names. Solution: Give a warning if the recommended name is not used. Accept the recommended name for conversion. (Christian Brabandt, Ken Takata)
1 parent fc08960 commit d1d037e

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

src/po/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ sjiscorr: sjiscorr.c
8787

8888
ja.euc-jp.po: ja.po
8989
iconv -f utf-8 -t euc-jp ja.po | \
90-
sed -e 's/charset=utf-8/charset=euc-jp/' -e 's/# Original translations/# Generated from ja.po, DO NOT EDIT/' > ja.euc-jp.po
90+
sed -e 's/charset=[uU][tT][fF]-8/charset=euc-jp/' -e 's/# Original translations/# Generated from ja.po, DO NOT EDIT/' > ja.euc-jp.po
9191

9292
# Convert cs.po to create cs.cp1250.po.
9393
cs.cp1250.po: cs.po
@@ -105,7 +105,7 @@ pl.cp1250.po: pl.po
105105
pl.UTF-8.po: pl.po
106106
rm -f pl.UTF-8.po
107107
iconv -f iso-8859-2 -t utf-8 pl.po | \
108-
sed -e 's/charset=ISO-8859-2/charset=utf-8/' -e 's/# Original translations/# Generated from pl.po, DO NOT EDIT/' > pl.UTF-8.po
108+
sed -e 's/charset=ISO-8859-2/charset=UTF-8/' -e 's/# Original translations/# Generated from pl.po, DO NOT EDIT/' > pl.UTF-8.po
109109

110110
# Convert sk.po to create sk.cp1250.po.
111111
sk.cp1250.po: sk.po
@@ -119,7 +119,7 @@ sk.cp1250.po: sk.po
119119
zh_CN.cp936.po: zh_CN.UTF-8.po
120120
rm -f zh_CN.cp936.po
121121
iconv -f UTF-8 -t cp936 zh_CN.UTF-8.po | \
122-
sed -e 's/charset=utf-8/charset=gbk/' -e 's/# Original translations/# Generated from zh_CN.UTF-8.po, DO NOT EDIT/' > zh_CN.cp936.po
122+
sed -e 's/charset=[uU][tT][fF]-8/charset=gbk/' -e 's/# Original translations/# Generated from zh_CN.UTF-8.po, DO NOT EDIT/' > zh_CN.cp936.po
123123

124124
# Convert ko.UTF-8.po to create ko.po.
125125
ko.po: ko.UTF-8.po

src/po/check.vim

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,37 @@ elseif !plural && search('^"Plural-Forms: ', 'n')
173173
" We allow for a stray plural header, msginit adds one.
174174
endif
175175

176+
" Check that 8bit encoding is used instead of 8-bit
177+
let cte = search('^"Content-Transfer-Encoding:\s\+8-bit', 'n')
178+
let ctc = search('^"Content-Type:.*;\s\+\<charset=[iI][sS][oO]_', 'n')
179+
let ctu = search('^"Content-Type:.*;\s\+\<charset=utf-8', 'n')
180+
if cte
181+
echomsg "Content-Transfer-Encoding should be 8bit instead of 8-bit"
182+
" TODO: make this an error
183+
" if error == 0
184+
" let error = cte
185+
" endif
186+
elseif ctc
187+
echomsg "Content-Type charset should be 'ISO-...' instead of 'ISO_...'"
188+
" TODO: make this an error
189+
" if error == 0
190+
" let error = ct
191+
" endif
192+
elseif ctu
193+
echomsg "Content-Type charset should be 'UTF-8' instead of 'utf-8'"
194+
" TODO: make this an error
195+
" if error == 0
196+
" let error = ct
197+
" endif
198+
endif
199+
176200

177201
if error == 0
178202
" If all was OK restore the view.
179203
call winrestview(wsv)
180204
echomsg "OK"
181205
else
206+
" Put the cursor on the line with the error.
182207
exe error
183208
endif
184209

src/po/sjiscorr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ main(int argc, char **argv)
1616
{
1717
for (p = buffer; *p != 0; p++)
1818
{
19-
if (strncmp(p, "charset=utf-8", 13) == 0)
19+
if (strncmp(p, "charset=utf-8", 13) == 0
20+
|| strncmp(p, "charset=UTF-8", 13) == 0)
2021
{
2122
fputs("charset=cp932", stdout);
2223
p += 12;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,8 @@ static char *(features[]) =
789789

790790
static int included_patches[] =
791791
{ /* Add new patch number below this line */
792+
/**/
793+
111,
792794
/**/
793795
110,
794796
/**/

0 commit comments

Comments
 (0)