Recent

Author Topic: Treeview Items Translation  (Read 6778 times)

luca

  • Jr. Member
  • **
  • Posts: 83
Treeview Items Translation
« 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

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Treeview Items Translation
« Reply #1 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...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: Treeview Items Translation
« Reply #2 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.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

dietmar

  • Full Member
  • ***
  • Posts: 170
Re: Treeview Items Translation
« Reply #3 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
Lazarus 2.2.0RC1 with FPC 3.2.2 (32 Bit) on Windows10 (64Bit)

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Treeview Items Translation
« Reply #4 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