summaryrefslogtreecommitdiff
path: root/src/po
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-28 16:46:57 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-28 16:46:57 +0200
commit9966b21a57277986217aa28237d6c247ebd060d7 (patch)
tree0123999d430636663fe3d21f0ee0c9eb20e55331 /src/po
parent93723a4ef18f260b82d89759db2f1eeae730c4ec (diff)
downloadvim-git-9966b21a57277986217aa28237d6c247ebd060d7.tar.gz
patch 8.0.0794: checking translations fails with multiple NLv8.0.0794
Problem: The script to check translations fails if there is more than one NL in one line. Solution: Count the number of NL characters. Make count() accept a string.
Diffstat (limited to 'src/po')
-rw-r--r--src/po/check.vim8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/po/check.vim b/src/po/check.vim
index ba98ae7aa..3bcbef395 100644
--- a/src/po/check.vim
+++ b/src/po/check.vim
@@ -114,14 +114,12 @@ endif
func! CountNl(first, last)
let nl = 0
for lnum in range(a:first, a:last)
- if getline(lnum) =~ '\\n'
- let nl += 1
- endif
+ let nl += count(getline(lnum), "\n")
endfor
return nl
endfunc
-" Check that the \n at the end of the msid line is also present in the msgstr
+" Check that the \n at the end of the msgid line is also present in the msgstr
" line. Skip over the header.
/^"MIME-Version:
while 1
@@ -138,7 +136,7 @@ while 1
let transcount = CountNl(strlnum, end - 1)
" Allow for a few more or less line breaks when there are 2 or more
if origcount != transcount && (origcount <= 2 || transcount <= 2)
- echomsg 'Mismatching "\\n" in line ' . line('.')
+ echomsg 'Mismatching "\n" in line ' . line('.')
if error == 0
let error = lnum
endif