All announcements, questions and issues related to the TsiLang Components Suite.
StefanP
Posts: 8 Joined: Mon Jul 18, 2005 7:45 am
Post
by StefanP » Thu Oct 06, 2016 11:43 am
I have code like the following in a standalone .pas file (not a form).
Code: Select all
const
// Filters for data events
DataTextFilters: array[0..2] of string = (
'equals',
'starts with',
'contains'
);
These string are not found when I open the TsiLang expert and use
"File->Const->Without form..."
Simple string constants are found and can be translated.
What should I do?
Regards
StefanP
isiticov
Site Admin
Posts: 2416 Joined: Thu Nov 21, 2002 3:17 pm
Post
by isiticov » Fri Oct 07, 2016 3:31 am
Best regards,
Igor Siticov.
zeras
Posts: 11 Joined: Sun Feb 18, 2018 10:23 am
Post
by zeras » Sat Feb 19, 2022 6:30 pm
I have same problem.
If I put like your instruction all to "const" section, I will get error message E2036, that a variable is needed.
Is there another way to translate string arrays like
[code]
{ //wird nicht übersetzt
TxtZnTyl : array[TmpZnZyl] of String = ( //01.05.18 vorher war AnsiString
'EFZ',
'M1',
'M2',
'M3',
'M4',
'M5',
'M6',
'D1',
'D2',
'D3'
);
[/code]
isiticov
Site Admin
Posts: 2416 Joined: Thu Nov 21, 2002 3:17 pm
Post
by isiticov » Sun Feb 20, 2022 4:24 am
Hello,
As described here
http://www.tsilang.com/delphiglobalizat ... aq.html#11 you would need just to modify a little your code like the following:
Code: Select all
var
sEFZ: string = 'EFZ';
sM1: string = 'M1';
sM2: string = 'M2';
sM3: string = 'M3';
sM4: string = 'M4';
sM5: string = 'M5';
sM6: string = 'M6';
sD1: string = 'D1';
sD2: string = 'D2';
sD3: string = 'D3';
const
TxtZnTyl : array[TmpZnZyl] of PString = ( //01.05.18 vorher war AnsiString
@sEFZ,
@sM1,
@sM2,
@sM3,
@sM4,
@sM5,
@sM6,
@sD1,
@sD2,
@sD3
);
Translate the strings above with TsiLang Expert and use the array elements like
TxtZnTyl[0]^ instead of just TxtZnTyl[0].
Best regards,
Igor Siticov.