Lazarus
Miscellaneous => Translations => Topic started by: luca on October 15, 2014, 12:59:26 pm
-
Enabling i18n flag in my project all the captions are correctly extracted in po file.
I didn't found Treeview Items caption.
Did I miss something?
Regards
Luca
-
Not sure, but things you're missing is saying what Lazarus version and operating system you are using...
-
Translated are only captions declared as TTranslateString, but TTreeNode.Text is declared as a string so it does not appear in *.po files.
Solution: declare your captions as resource strings and assign them at run-time.
-
Hi,
thx for the clarification.
Do you have an example code on how to get around the problem by using "ResourceStrings"?
Dietmar
-
There is a sample with a resource string in my test project you've already downloaded (i.e. TransTest).
Unit1.pas:
resourcestring
SUnsupportedLanguage = 'ERROR: Other languages not supported';
...
ShowMessage(SUnsupportedLanguage);
And in the concerned .po files (for instance TransTest.fr.po):
#: unit1.sunsupportedlanguage
msgctxt "unit1.sunsupportedlanguage"
msgid "ERROR: Other languages not supported"
msgstr "ERREUR: Autre langues non supportées"