TsiLang and GetText procedure
TsiLang and GetText procedure
Hi there,
i'm trying on the GetText procedure for TsiLang, but i'm facing some problem.
If i'm using ,like say, WinXp with chinese support. The GetText procedure can't work properly as it seems that it cannot retrieve the text correctly.
But if i running my software under native chinese enviroment(e.g, Win98 big5 version). It work correctly.
How can i resolve this issue under WinXp wiv chinese support ? i didn't wan to develop my software and then switch to other OS to c the result.
Regards,
Ang Lik Huar
i'm trying on the GetText procedure for TsiLang, but i'm facing some problem.
If i'm using ,like say, WinXp with chinese support. The GetText procedure can't work properly as it seems that it cannot retrieve the text correctly.
But if i running my software under native chinese enviroment(e.g, Win98 big5 version). It work correctly.
How can i resolve this issue under WinXp wiv chinese support ? i didn't wan to develop my software and then switch to other OS to c the result.
Regards,
Ang Lik Huar
Re: TsiLang and GetText procedure
What you do you mean by chinese support? Are you sure you set the system locale to chinese? If not, go to Control Panel/Regional and language Options. Switch to Advanced tab. Select Chinese (xxx) from the language list.magicang wrote:If i'm using ,like say, WinXp with chinese support.
It should work then...
What exactly does it return? Question marks, black squares, or just garbage?magicang wrote:The GetText procedure can't work properly as it seems that it cannot retrieve the text correctly.
Hi,
Thanks for the quick reply !!
I think i found the problem. Because i add a new language, althought i have increase siLangDispatcher to my new language no. and i load my language file dynamically. This cause the problem.
Now, i manual set the file name for the siLangDispatcher once and run my program. It works.
Does it means that if i add a new language, i need to manaually set the file name for siLangDispatcher again ?
Regards,
magic
Thanks for the quick reply !!
I think i found the problem. Because i add a new language, althought i have increase siLangDispatcher to my new language no. and i load my language file dynamically. This cause the problem.
Now, i manual set the file name for the siLangDispatcher once and run my program. It works.
Does it means that if i add a new language, i need to manaually set the file name for siLangDispatcher again ?
Regards,
magic
Hello,
If you need to load translations dynamically in run-time the preferable way to do it is:
...
if FileExists(TheNewFileName) then
begin
siLangDispatcher1.FileName := TheNewFileName;
siLangDispatcher1.LoadAllFromFile(TheNewFileName);
siLangDispatcher1.ActiveLanguage := TheWorkingLanguageNumber;
end;
...
If you need to load translations dynamically in run-time the preferable way to do it is:
...
if FileExists(TheNewFileName) then
begin
siLangDispatcher1.FileName := TheNewFileName;
siLangDispatcher1.LoadAllFromFile(TheNewFileName);
siLangDispatcher1.ActiveLanguage := TheWorkingLanguageNumber;
end;
...
Best regards,
Serghei Gaivan
Serghei Gaivan
Hi,
Now i having another problem.
The translation work great under winXp with chinese support. But while i bring the same .exe file and same .sil file to a native chinese OS. I got problem again.
This time, the showmessage dialog doesn't translate. I use somethings like ShowMessage(TsiLang.GetText('xxx')), it work under winxp but doesn't work in native chinese os and it return blank string to me.
any advice ?
Thanks a lot !!
Now i having another problem.
The translation work great under winXp with chinese support. But while i bring the same .exe file and same .sil file to a native chinese OS. I got problem again.
This time, the showmessage dialog doesn't translate. I use somethings like ShowMessage(TsiLang.GetText('xxx')), it work under winxp but doesn't work in native chinese os and it return blank string to me.
any advice ?
Thanks a lot !!
Hi Dorin,
I think i have found the problem. It seems that althought it have load the language file, some of the things is not refresh.
Look into the source code of TsiLang , i add one more code beside the code u give me and it's work now.
if FileExists(TheNewFileName) then
begin
siLangDispatcher1.FileName := TheNewFileName;
siLangDispatcher1.LoadAllFromFile(TheNewFileName);
siLangDispatcher1.ActiveLanguage := TheWorkingLanguageNumber;
siLang.Loaded; // ?? Force the siLang to refresh it's data ?? Tsilang Bugs ???
end;
Regards,
Magic Ang
I think i have found the problem. It seems that althought it have load the language file, some of the things is not refresh.
Look into the source code of TsiLang , i add one more code beside the code u give me and it's work now.
if FileExists(TheNewFileName) then
begin
siLangDispatcher1.FileName := TheNewFileName;
siLangDispatcher1.LoadAllFromFile(TheNewFileName);
siLangDispatcher1.ActiveLanguage := TheWorkingLanguageNumber;
siLang.Loaded; // ?? Force the siLang to refresh it's data ?? Tsilang Bugs ???
end;
Regards,
Magic Ang