* * *

Author Topic: Treeview Items Translation  (Read 2389 times)

luca

  • New member
  • *
  • Posts: 43
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: 2370
  • 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 1.9 r54600M FPC 3.0.2 x86_64-linux-qt Chakra, Qt 4.8.7, Plasma 5.9.4
Lazarus 1.6.4 r54278 FPC 3.0.2 i386-win32-win32/win64 Wine 2.4










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

dietmar

  • New member
  • *
  • Posts: 35
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 1.6.4 with FPC 3.0.2 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"


 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus