Lazarus

Miscellaneous => Translations => Topic started by: luca on October 15, 2014, 12:59:26 pm

Title: Treeview Items Translation
Post 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
Title: Re: Treeview Items Translation
Post by: BigChimp on October 15, 2014, 01:11:35 pm
Not sure, but things you're missing is saying what Lazarus version and operating system you are using...
Title: Re: Treeview Items Translation
Post by: Blaazen on October 15, 2014, 01:20:42 pm
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.
Title: Re: Treeview Items Translation
Post by: dietmar on April 04, 2015, 11:03:52 pm
Hi,

thx for the clarification.
Do you have an example code on how to get around the problem by using "ResourceStrings"?

Dietmar
Title: Re: Treeview Items Translation
Post by: ChrisF on April 05, 2015, 05:09:34 am
There is a sample with a resource string in my test project you've already downloaded (i.e. TransTest).

Unit1.pas:
Code: [Select]
resourcestring
  SUnsupportedLanguage = 'ERROR: Other languages not supported';
...
ShowMessage(SUnsupportedLanguage);

And in the concerned .po files (for instance TransTest.fr.po):
Code: [Select]
#: unit1.sunsupportedlanguage
msgctxt "unit1.sunsupportedlanguage"
msgid "ERROR: Other languages not supported"
msgstr "ERREUR: Autre langues non supportées"

TinyPortal © 2005-2018