bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature request: expose message validation in libgettextpo


From: James Henstridge
Subject: Re: feature request: expose message validation in libgettextpo
Date: Thu, 08 Sep 2005 20:09:45 +0800
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050727)

Bruno Haible wrote:

>James Henstridge wrote:
>  
>
>>The libgettextpo library provides a po_message_check_format() function
>>for performing format string checking on a po_message_t.  However this
>>is not the only message validity check that the gettext tools perform.
>>
>>The msgfmt program performs some other checks, such as consistent use of
>>newlines at the beginning and end of strings.
>>
>>A po_message_validate() function that performed all these checks would
>>be useful to programs that use libgettextpo to generate or edit PO
>>files.  As it is now, such applications either need to reimplement the
>>checks or omit them and risk producing broken PO files (and
>>reimplementing the checks is not ideal -- if gettext gets new checks,
>>the application needs to be updated too).
>>    
>>
>
>The other checks are implementable in a few lines of code, whereas the
>po_message_check_format() function is quite complex. As far as I know,
>the applications for which libgettextpo is made - namely PO file editors -
>also perform other checks - spell checking and such - that msgfmt doesn't
>do. The current API is therefore more inviting for the addition of other
>checks.
>  
>
I realise the checks are quite easy to implement.  I also realise that a
PO file editor may implement additional checks.

However, the main difference between msgfmt's checks and and a PO file
editor's extra checks is that if the produced PO files do not satisfy
msgfmt's checks the message catalog can't be compiled.  The same is not
true of spelling errors.

My main concern is if msgfmt grows new validity checks: while I can
easily implement msgfmt's current checks, I'd need to track changes to
gettext in case it adds new checks.  If the message validity checks were
exposed through libgettextpo, I'd benefit from any new checks added to
gettext automatically.

James.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]