Recent

Author Topic: [SOLVED] Translations - Can I reinitialize consts?  (Read 3703 times)

Dibo

  • Hero Member
  • *****
  • Posts: 1057
[SOLVED] Translations - Can I reinitialize consts?
« on: April 15, 2011, 04:58:06 pm »
Hi,

I am using "resourcestring" for translate units. This works fine, but I have some const arrays which uses translated strings from resourcestring:
Code: Pascal  [Select][+][-]
  1. resourcestring
  2.   rsString1 = 'String1';
  3.   rsString2 = 'String2';
  4.   rsString3 = 'String3';
  5.  
  6. const
  7.   GROUP: array[0...2] of string = (rsString1, rsString2, rsString3);
  8.  
Now, when user change language, strings in resourcestring section are translated but const GROUP still have "old" values. I know that I can resign from array or reinit values manually but I am wondering if I can reinit this automaticaly somehow. I supose that consts values are generated on compiling.

Regards.
« Last Edit: April 16, 2011, 03:01:44 pm by Dibo »

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: [SOLVED] Translations - Can I reinitialize consts?
« Reply #1 on: April 16, 2011, 03:03:21 pm »
Ok I solved problem by creating array of pointers instead of string:
Code: Pascal  [Select][+][-]
  1. resourcestring  
  2.   rsString1 = 'String1';  
  3.   rsString2 = 'String2';  
  4.   rsString3 = 'String3';  
  5.  
  6. const  
  7.   GROUP: array[0...2] of PString = (@rsString1, @rsString2, @rsString3);
  8.  

But If someone have another idea please comment.
Regards

circular

  • Hero Member
  • *****
  • Posts: 4467
    • Personal webpage
Re: [SOLVED] Translations - Can I reinitialize consts?
« Reply #2 on: April 16, 2011, 04:35:25 pm »
Interesting solution.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018