Recent

Author Topic: TreeView Nodes text translation  (Read 6905 times)

jcmontherock

  • Sr. Member
  • ****
  • Posts: 271
TreeView Nodes text translation
« on: June 30, 2021, 04:24:19 pm »
Hello,

I have a Treeview control in my application. When I try to change language and translate nodes text, there are not translated. Do we have to rebuild all TreeView to have text translated ? With others controls we do not have this problem. All node text to be translated are in po file. See example.
Windows 11 UTF8-64 - Lazarus 4RC1-64 - FPC 3.2.2

AlexTP

  • Hero Member
  • *****
  • Posts: 2481
    • UVviewsoft
Re: TreeView Nodes text translation
« Reply #1 on: June 30, 2021, 06:55:31 pm »
I guess this is not supported and must not be supported: like e.g. for TMemo and TListbox lines.

jcmontherock

  • Sr. Member
  • ****
  • Posts: 271
Re: TreeView Nodes text translation
« Reply #2 on: July 01, 2021, 06:22:55 pm »
I finally find how to do: at TV creation I save the node index and the address of the resource string in a record and restore it at language change. You can even save the the pointer in the TV Node.Data.
Hoping it will be helpful for somebody.
« Last Edit: July 01, 2021, 07:14:44 pm by jcmontherock »
Windows 11 UTF8-64 - Lazarus 4RC1-64 - FPC 3.2.2

 

TinyPortal © 2005-2018