|
<< Click to Display Table of Contents >> Navigation: Telegram > 2023 > 09 > 29 > Telegram_2023-09-29T15 |
2023-09-29T15:34:58
could you please suggest the best strategy to localize iw app on the user choice language? we are using master html templates. Thank you
2023-09-29T15:36:18
I was also looking for an alternative, but ended up implementing my own solution
2023-09-29T15:37:16
one thing to be aware of: you need to turn the IW template cache OFF (if you are using one of the latest versions)
2023-09-29T15:41:43
Portuguese/English
2023-09-29T15:43:23
are you choosing the translated text to render on server side? do you have a dictionary? are you using JS to get the translated text?
2023-09-29T15:44:16
do you have different html templates for every language?
2023-09-29T15:44:27
All text comes from the Server Side; every form/frame/unit has its own translation file;every language has its own folder
2023-09-29T15:44:38
no, just one template
2023-09-29T15:44:57
I came to my mind with this \solutions\.
2023-09-29T15:46:11
thank you. Any other ideas will be appreciatted
2023-09-29T15:46:54
I ended up writing code like this for every string
type: code procedure TfrmLogin.TranslateUI;
begin
btnChangePassword.Caption := fTranslator.Translate('btnChangePassword');
lblEmail.Caption := fTranslator.Translate('lblEmail');
lblPassword.Caption := fTranslator.Translate('lblPassword');
btnLogin.Caption := fTranslator.Translate('btnLogin');
lnkForgotPassword.Caption := fTranslator.Translate('lnkForgotPassword');
lnkCreateAccount.Caption := fTranslator.Translate('lnkCreateAccount');
btnCancel.Caption := fTranslator.Translate('btnCancel');
lblPageTitle.Caption := fTranslator.Translate('lblPageTitleWelcome');
end;
2023-09-29T15:50:42
a lot of work. :-)
2023-09-29T15:52:59
a bit, but once is done, is done ??
I can't see a way to automate this process yet
2023-09-29T15:53:52
specially strings used in classes, like type descriptions
2023-09-29T15:56:12
for example:
type: code function TSEOLKeywordStatusHelper.Description: string;
begin
case Self of
Candidates: Result := Translate('msgStatusCandidates');
Discarded: Result := Translate('msgStatusDiscarded');
NegativeKeyword: Result := Translate('msgStatusNegativeKeyword');
TrustedKeyword: Result := Translate('msgStatusTrustedKeyword');
NegativeTrustedKeyword: Result := Translate('msgStatusNegativeTrustedKeyword');
NotCandidates: Result := Translate('msgStatusNotCandidates');
AllKeywords: Result := Translate('msgStatusAllKeywords');
end;
end;
2023-09-29T15:56:43
it allows me to translate everything in my app... a bit of work, but the results are very good