Forum > Translations

Translating Components


Hi, I am trying to provide translations for my project, and I am able to (by following the wiki), create po files and translate resourcestrings in the code.  However, the automatic po file generation seems to create some entries at  the top of the po file with the captions etc for the components, eg button captions, label captions etc like so for example:

--- Code: ---#: TFRMMAIN.CAPTION
msgid "Test App"
msgstr ""
--- End code ---

These do not seem to be read in along with the resourcestring ones.  
I have tried both:

--- Code: ---TranslateUnitResourceStrings('main', PODirectory + 'i18n.%s.po', Lang, FLang)
--- End code ---

which works, and:

--- Code: ---TranslateUnitResourceStrings('TFRMMAIN', PODirectory + 'i18n.%s.po', Lang, FLang)
--- End code ---

as an attempt to get it working, in case this is what it expects, but this does not seem to work.

So, my question essentially is - is this possible or do I need to create resourcestrings for all of the component captions etc. and then set them at FormCreate?  If this is the case then why do the Lazarus tools create these entries at the top of the po files??


Is it possible to translate my apps through .po files? Post the wiki link please


[0] Message Index

Go to full version