diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-05-28 18:39:55 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-05-28 18:39:55 +0100 |
commit | 78ee62563ea940086f094150f0356e38f780c580 (patch) | |
tree | 42e998a75a97c5d92d601e59f33ca43526544499 /src | |
parent | 30805a1aba0067cf0087f9a0e5c184562433e2e7 (diff) |
patch 9.0.1586: error for using two messages with ngettext() differing in "%"v9.0.1586
Problem: Checking translations gives an error for using two messages with
ngettext() that differ in "%" items.
Solution: Adjust the check script to tolerate omitting one "%" item.
Diffstat (limited to 'src')
-rw-r--r-- | src/po/check.vim | 12 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/po/check.vim b/src/po/check.vim index a01874cce7..b2a5fd582e 100644 --- a/src/po/check.vim +++ b/src/po/check.vim @@ -6,6 +6,9 @@ if 1 " Only execute this if the eval feature is available. +" using line continuation +set cpo&vim + " Function to get a split line at the cursor. " Used for both msgid and msgstr lines. " Removes all text except % items and returns the result. @@ -59,12 +62,18 @@ while 1 if getline(line('.') - 1) !~ "no-c-format" " go over the "msgid" and "msgid_plural" lines let prevfromline = 'foobar' + let plural = 0 while 1 + if getline('.') =~ 'msgid_plural' + let plural += 1 + endif let fromline = GetMline() if prevfromline != 'foobar' && prevfromline != fromline + \ && (plural != 1 + \ || count(prevfromline, '%') + 1 != count(fromline, '%')) echomsg 'Mismatching % in line ' . (line('.') - 1) echomsg 'msgid: ' . prevfromline - echomsg 'msgid ' . fromline + echomsg 'msgid: ' . fromline if error == 0 let error = line('.') endif @@ -86,6 +95,7 @@ while 1 while getline('.') =~ '^msgstr' let toline = GetMline() if fromline != toline + \ && (plural == 0 || count(fromline, '%') != count(toline, '%') + 1) echomsg 'Mismatching % in line ' . (line('.') - 1) echomsg 'msgid: ' . fromline echomsg 'msgstr: ' . toline diff --git a/src/version.c b/src/version.c index 27e558a52b..fdb7716a98 100644 --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1586, +/**/ 1585, /**/ 1584, |