[Lazarus] Pochecker (was Fuzzy traslations ignored)

Giuliano Colla giuliano.colla at fastwebnet.it
Fri Oct 10 10:04:26 CEST 2014


Il 10/10/2014 04:50, Jesus Reyes ha scritto:
> If I understand correctly, the error here is that some tools cannot 
> easily edit .po files and instead want .pot files?
> or what?
>

No, the error is that a .po file is just a translation, while a master 
template file, i.e. a file containing only original messages and no 
translations should have .pot extension.
e.g. lazaruside.pot should be the master template file for lazarus IDE, 
and lazaruside.pt_BR.po the translation file for Brazilian Portuguese.
But we have instead lazaruside.po as a template file, i.e. with the same 
extensions as that of a normal translation.

The master template is generated (by the Translations unit) from the 
resource files. Then existing translations are updated accordingly.
Tools like PoChecker must easily locate the master template, to update 
or check translations against it.
Editing tools accept a .pot file as a starting point to generate the 
first copy of your localized versions (for a new translation).

Except that case, humans only deal with translations (.po files), while 
programs deal both with templates and with translations (.pot and .po 
files). A different extension (as suggestet by gettext) is the easiest 
way to tell them apart.


> If the concern is that we don't follow what gettext docs say, should 
> we be worried also that we don't use .mo files?
>

I wouldn't give a damn on what gettext says either, if it weren't that 
by not following its rule we generate troubles:

1) we have template files and translation files (which are two different 
beasts) with the same extension, and programs must figure out, by other 
means, which one is which.
It's much easier and cleaner to tell them apart by a different extension.
Moreover, sometimes the figuring out fails, as in the case of the files 
on the debian/po directory, where translation files are mistaken for 
templates.

2) We cannot use the translation tools as they should be used, to 
generate a new translation. We must manually create a first translation 
file by copying the template to a renamed file, and then editing it, 
thus loosing part of the header that the translation tools generate when 
they realize that they are generating a new translation.

> If I remember correctly, one of the reasons (but not the only) to use 
> .po files directly (without .mo conversion) was because any text 
> editor could be used to edit them, but text editors usually don't mind 
> what extension a text file has (even, it could be argued if .txt 
> extension should be used, but not please :)).
>

.po and .mo are a different matter. A .mo is just a .po compiled, a 
binary version of the source. If it's more pactical to use the source, 
instead of the binary (and I agree that it is), that's a choice which 
doesn't create any confusion. We have files with an extension which 
tells exactly what they are: source translation files. We don't need 
binaries, and this means that we don't need to compile anything to 
modify a translation.

Giuliano

-- 
Giuliano Colla

Project planning question: when it's 90% done, are we halfway or not yet?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141010/496adde0/attachment-0003.html>


More information about the Lazarus mailing list