On Wed, May 21, 2008 at 12:24 PM, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
>
> Dominique Pelle wrote:
>
>> I noticed that several gettext *.po files of Vim contain mismatches
>> between the error codes in the original English string and the
>> translated string.
>>
>> For example, in the Italian vim7/src/po/it.po file, I see:
>>
>> msgid "E690: Missing \"in\" after :for"
>> msgstr "E69: Manca \"in\" dopo :for"
>>
>> (notice the mismatch E690 vs E69)
>>
>> msgid "E207: Can't delete backup file"
>> msgstr "E193: Non riesco a cancellare il file di backup"
>
> These two were fixed recently.  The it.po file is actively maintained.
>
>> I see such mismatches in many other po files, at least
>> in the following: ca.po, de.po, es.po, fr.po, it.po, ja.po,ja.sjis.po,
>> no.po, pl.po, ru.po, sk.po, uk.po, vi.po, zh_TW.po
>>
>> I can find such mismatches by searching with the following
>> command:
>>
>> $ cd vim7/src/po
>> $ vim -c ':argdo /msgid "\("\n"\)\?[EW]\([0-9]\+\):.*\nmsgstr
>> "\("\n"\)[EMAIL PROTECTED]' *.po
>
> Can you make a patch to add this to src/po/check.vim ?
>
> Please also report the found mistakes to each po file maintainer.


I attach a patch to src/po/check.vim that checks
consistency between error codes in msgid and msgstr
in po files.  I don't often write vim scripts, so perhaps
there is a more elegant way of checking this.

I will report the errors it finds to each po file maintainer
this coming weekend.

po files are in CVS but there are no patches for them as
far as I know.  So CVS does not contain the latest po files.
Is there a place where one can download all the latest po
files submitted by po file maintainers?  I'd like to run the
checks on the latest po files, since some of them (it.po for
example) have already fixed that kind of issues.

Regards
-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Index: src/po/check.vim
===================================================================
RCS file: /cvsroot/vim/vim7/src/po/check.vim,v
retrieving revision 1.2
diff -c -r1.2 check.vim
*** src/po/check.vim	23 Nov 2005 21:10:37 -0000	1.2
--- src/po/check.vim	22 May 2008 20:44:03 -0000
***************
*** 1,7 ****
  " Vim script for checking .po files.
  "
! " Go through the file and verify that all %...s items in "msgid" are identical
! " to the ones in "msgstr".
  
  if 1	" Only execute this if the eval feature is available.
  
--- 1,8 ----
  " Vim script for checking .po files.
  "
! " Go through the file and verify that:
! " - all %...s items in "msgid" are identical to the ones in "msgstr".
! " - all error and warning codes match in "msgid" and in "msgstr".
  
  if 1	" Only execute this if the eval feature is available.
  
***************
*** 56,61 ****
--- 57,76 ----
    endif
  endwhile
  
+ " Check that error codes match in msgid and msgstr strings.
+ "
+ " Examples of mismatches found with msgid "E123: ..."
+ " - msgstr "E321: ..."    error code mismatch
+ " - msgstr "W123: ..."    warning instead of error
+ " - msgstr "E123 ..."     missing colon
+ " - msgstr "..."          missing error code
+ "
+ 1
+ if search('msgid "\("\n"\)\?\([EW][0-9]\+:\).*\nmsgstr "\("\n"\)\?[^"[EMAIL PROTECTED]@!') > 0
+   echo 'Mismatching error/warning code in line ' . line('.')
+   let error = 1
+ endif
+ 
  if error == 0
    echo "OK"
  endif

Raspunde prin e-mail lui