diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-23 12:42:15 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-23 12:42:46 -0400 |
commit | 57c095d5fc155bb29077f9fa2fb8e55b93b7f005 (patch) | |
tree | fbd981f82065d87b84a9bcb4fafb0e229adea4e7 /src | |
parent | 7cf36fc67e88d41a8b1b9b47afbf6146b1baef6e (diff) | |
download | rneovim-57c095d5fc155bb29077f9fa2fb8e55b93b7f005.tar.gz rneovim-57c095d5fc155bb29077f9fa2fb8e55b93b7f005.tar.bz2 rneovim-57c095d5fc155bb29077f9fa2fb8e55b93b7f005.zip |
vim-patch:8.0.1839: script to check .po file doesn't check for plural header
Problem: Script to check .po file doesn't check for plural header.
Solution: Add a check that the plural header is present when needed.
https://github.com/vim/vim/commit/9cfc7d885cb3bf37362b11df19a38992893fb385
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/po/check.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/po/check.vim b/src/nvim/po/check.vim index 086d67a88f..a441a3fee2 100644 --- a/src/nvim/po/check.vim +++ b/src/nvim/po/check.vim @@ -157,6 +157,23 @@ if executable("msgfmt") endif endif +" Check that the plural form is properly initialized +1 +let plural = search('^msgid_plural ', 'n') +if (plural && search('^"Plural-Forms: ', 'n') == 0) || (plural && search('^msgstr\[0\] ".\+"', 'n') != plural + 1) + if search('^"Plural-Forms: ', 'n') == 0 + echomsg "Missing Plural header" + if error == 0 + let error = search('\(^"[A-Za-z-_]\+: .*\\n"\n\)\+\zs', 'n') - 1 + endif + elseif error == 0 + let error = plural + endif +elseif !plural && search('^"Plural-Forms: ', 'n') + " We allow for a stray plural header, msginit adds one. +endif + + if error == 0 " If all was OK restore the view. call winrestview(wsv) |