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

Re: Bug#464511: detect a fully vaild .po file as non-valid



On Fri, Feb 08, 2008 at 07:15:18AM +0100, Christian Perrier wrote:
> Quoting Eddy Petri?or (eddy.petrisor@gmail.com):
> >> Currently, the regex used by lintian to validate po file names is:
> >>
> >>     /^[a-z]{2,2}(_[A-Z]{2,2})?\.po$/
> >>
> >> so it expects language codes in the form:
> >>
> >>     nn
> >>     nn_NN
> 
> My suggestion for PO files:
> 
> nn_NNN is OK *as long as there is a valid locale on the system for
> it*. So, for instance fr_AU.po ("French as spoken in Australia") is an
> invalid PO file.
> 
> nn or nnn are OK *as long as there is at least one valid nn_XX or nnn_XXX
> locale on the system*

Please be careful with suggestions of this kind. I'm sure that it
depends on the handling and usage of the PO files. So I guess that
C/C++ based languages directly install <NAME>.po into
/usr/share/locale/<NAME>/LC_MESSAGES/<PACKAGE>.mo but I'm not sure.
Maybe it depends also on the build system.

Accessing files in this directory is described in the libc
documentation (non-free).

<quote>
   * The language to be used can be specified in several different ways.
     There is no generally accepted standard for this and the user
     always expects the program understand what s/he means.  E.g., to
     select the German translation one could write `de', `german', or
     `deutsch' and the program should always react the same.

   * Sometimes the specification of the user is too detailed.  If s/he,
     e.g., specifies `de_DE.ISO-8859-1' which means German, spoken in
     Germany, coded using the ISO 8859-1 character set there is the
     possibility that a message catalog matching this exactly is not
     available.  But there could be a catalog matching `de' and if the
     character set used on the machine is always ISO 8859-1 there is no
     reason why this later message catalog should not be used.  (We
     call this "message inheritance".)
</quote>
 
If there are multiple equivalent possibilities to name PO files such as
german.po and de.po we should indeed prefer de.po.

But I'm not sure we can just follow your guide. Does nn_NNN always
correspond to a proper locale? Probably. I'm sure that this is true in
at least 95%. But always?

This is a rather technically problem and we should not forget to read
about the requirements for gettext (are other systems using PO files?)
also for other languages such as PHP, ...
 
> PS: nds_DE and nds_NL are valid locales...:-)

But is it (will it be) supported by gettext?

There is also another question and Christian is aware of it. If there
exists a translation into a dialect of a language such as de_AT but no
de what to do? Force a rename of de_AT to de and once there are
complains about dialect related problems let's develop de_AT and de
independ of each other? Otherwise a LANG=de user will not see de_AT
translations ...

Let's ask: Is it necessary to determine this now? If there is really a
need to a have a PO file called nn_NNN let's allow it.

Jens


Reply to: