summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-06-24 18:04:50 +0200
committerBram Moolenaar <Bram@vim.org>2018-06-24 18:04:50 +0200
commitd1d037e90192ab64e4cec00b9d008b33bc69d979 (patch)
treef74638f9f6f4228ea09fbd834609903137b5c8d8
parentfc0896093c3b3e753859a5f929921933e7a2e6cd (diff)
downloadvim-d1d037e90192ab64e4cec00b9d008b33bc69d979.zip
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)
-rw-r--r--src/po/Makefile6
-rw-r--r--src/po/check.vim25
-rw-r--r--src/po/sjiscorr.c3
-rw-r--r--src/version.c2
4 files changed, 32 insertions, 4 deletions
diff --git a/src/po/Makefile b/src/po/Makefile
index 57aa375bc..c6758e2b7 100644
--- a/src/po/Makefile
+++ b/src/po/Makefile
@@ -87,7 +87,7 @@ sjiscorr: sjiscorr.c
ja.euc-jp.po: ja.po
iconv -f utf-8 -t euc-jp ja.po | \
- sed -e 's/charset=utf-8/charset=euc-jp/' -e 's/# Original translations/# Generated from ja.po, DO NOT EDIT/' > ja.euc-jp.po
+ 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
# Convert cs.po to create cs.cp1250.po.
cs.cp1250.po: cs.po
@@ -105,7 +105,7 @@ pl.cp1250.po: pl.po
pl.UTF-8.po: pl.po
rm -f pl.UTF-8.po
iconv -f iso-8859-2 -t utf-8 pl.po | \
- 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
+ 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
# Convert sk.po to create sk.cp1250.po.
sk.cp1250.po: sk.po
@@ -119,7 +119,7 @@ sk.cp1250.po: sk.po
zh_CN.cp936.po: zh_CN.UTF-8.po
rm -f zh_CN.cp936.po
iconv -f UTF-8 -t cp936 zh_CN.UTF-8.po | \
- 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
+ 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
# Convert ko.UTF-8.po to create ko.po.
ko.po: ko.UTF-8.po
diff --git a/src/po/check.vim b/src/po/check.vim
index 24c4d79cb..672b4f37d 100644
--- a/src/po/check.vim
+++ b/src/po/check.vim
@@ -173,12 +173,37 @@ elseif !plural && search('^"Plural-Forms: ', 'n')
" We allow for a stray plural header, msginit adds one.
endif
+" Check that 8bit encoding is used instead of 8-bit
+let cte = search('^"Content-Transfer-Encoding:\s\+8-bit', 'n')
+let ctc = search('^"Content-Type:.*;\s\+\<charset=[iI][sS][oO]_', 'n')
+let ctu = search('^"Content-Type:.*;\s\+\<charset=utf-8', 'n')
+if cte
+ echomsg "Content-Transfer-Encoding should be 8bit instead of 8-bit"
+ " TODO: make this an error
+ " if error == 0
+ " let error = cte
+ " endif
+elseif ctc
+ echomsg "Content-Type charset should be 'ISO-...' instead of 'ISO_...'"
+ " TODO: make this an error
+ " if error == 0
+ " let error = ct
+ " endif
+elseif ctu
+ echomsg "Content-Type charset should be 'UTF-8' instead of 'utf-8'"
+ " TODO: make this an error
+ " if error == 0
+ " let error = ct
+ " endif
+endif
+
if error == 0
" If all was OK restore the view.
call winrestview(wsv)
echomsg "OK"
else
+ " Put the cursor on the line with the error.
exe error
endif
diff --git a/src/po/sjiscorr.c b/src/po/sjiscorr.c
index 2f55b9ec3..7aa0533c1 100644
--- a/src/po/sjiscorr.c
+++ b/src/po/sjiscorr.c
@@ -16,7 +16,8 @@ main(int argc, char **argv)
{
for (p = buffer; *p != 0; p++)
{
- if (strncmp(p, "charset=utf-8", 13) == 0)
+ if (strncmp(p, "charset=utf-8", 13) == 0
+ || strncmp(p, "charset=UTF-8", 13) == 0)
{
fputs("charset=cp932", stdout);
p += 12;
diff --git a/src/version.c b/src/version.c
index b539e9eb2..95332ca24 100644
--- a/src/version.c
+++ b/src/version.c
@@ -790,6 +790,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 111,
+/**/
110,
/**/
109,