Forum > Translations

Treeview Items Translation

(1/1)

luca:
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

BigChimp:
Not sure, but things you're missing is saying what Lazarus version and operating system you are using...

Blaazen:
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.

dietmar:
Hi,

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

Dietmar

ChrisF:
There is a sample with a resource string in my test project you've already downloaded (i.e. TransTest).

Unit1.pas:

--- Code: ---resourcestring
  SUnsupportedLanguage = 'ERROR: Other languages not supported';
...
ShowMessage(SUnsupportedLanguage);

--- End code ---

And in the concerned .po files (for instance TransTest.fr.po):

--- Code: ---#: unit1.sunsupportedlanguage
msgctxt "unit1.sunsupportedlanguage"
msgid "ERROR: Other languages not supported"
msgstr "ERREUR: Autre langues non supportées"


--- End code ---

Navigation

[0] Message Index

Go to full version