Well, before adventured myself, helping Lazarus with translations, i did some
research about how things were done in this matter.
Seems that majority used this method, so i followed it.
Some considerations:
- Using "i18n option enabled" you have two different behavior of IDE automatic
language generation:
1) Projects: IDE generated .po file with project´s name, which concentrates
all resources from all files in project.
2) Packages: For every form in package, a correspondent file (.lrt) is
generated and a correspondent file (.po) file is generated.
This could end with a bunch of files in language
directory, each one requiring translation. Example: If a package generates 4
language files, for each
language you got 4 files. So if you have 10 supported
languages.....
- Concentrate all resources in one .pas file gives you more centralized control
over that strings. This is not the case with "i18n", since IDE can generate
resources from
.pas where they are declared. So you know that that string exists, but you
will need to do a search in files to locate it. This is more simply to do in
one file.
- I tought that having one method in mind is better than having to remember
that for projects i need to do one way, and with packages another way.
Maybe it´s a good opportunity to discuss some standards about this matter.
There is a lot to do in this field. Reach a common sense may avoid big
headaches in future.
Marcelo.
>Marcelo Borges de Paula ?????:
>>
>> Hello again,
>>
>> The right files was lazdatadeskstr.*. It was generated from
>> lazdatadeskstr.rst.
>
>If you look inside new PO files you will see that resource strings are
>still there, though these files are bigger then they need to be (some
>extra strings seem to be taken from LRT file).
>
>> When "i18n option" is enabled, IDE creates correspodent language files
>> with project name in target language directory. Similar to what happens
>> with package, the resources are generated from all files in project.
>> In this case, all resource strings was moved in recent updated to
>> "lazdatadeskstr.pas". So any improvements may alter this file to include
>> new resources.
>
>New resources still can be included to lazdatadeskstr.pas and PO files
>will be updated correctly with them.
>
>> After that, the developer must use tool "updatepofiles" to update
>> existent .po files from lazdatadeskstr.rst. With this method no files
>> are generated automatically (.po or .lrt), and there is no need to
>> mantain the "i18n option" enabled.
>> Take a look in "localize.bat" or "localize.sh" in Lazarus root.
>
>You don't need to do extra steps to update localization now, what's
>wrong with this?
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus