To: vim_dev@googlegroups.com Subject: Patch 8.0.1839 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1839 Problem: Script to check .po file doesn't check for plural header. Solution: Add a check that the plural header is present when needed. Files: src/po/check.vim *** ../vim-8.0.1838/src/po/check.vim 2018-04-30 15:44:21.164299549 +0200 --- src/po/check.vim 2018-05-08 16:05:44.489440582 +0200 *************** *** 157,162 **** --- 157,179 ---- 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) *** ../vim-8.0.1838/src/version.c 2018-05-13 19:06:06.531783844 +0200 --- src/version.c 2018-05-13 22:36:38.194495430 +0200 *************** *** 763,764 **** --- 763,766 ---- { /* Add new patch number below this line */ + /**/ + 1839, /**/ -- There is no right or wrong, there is only your personal opinion. (Bram Moolenaar) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///