Closed Al-Muhandis closed 6 years ago
I made a temporary solution. The fact is that SetDefaultLanguage works only in LCL. In web app while I made such crutch that it was possible to work with files .po ` procedure TWebhookBot.LangTranslate(const ALang: String);
var L, F: String; begin if Length(ALang)>2 then L:=LeftStr(ALang, 2) else L:=ALang; F:='languages'+PathDelim+ApplicationName+'.%s.po'; TranslateResourceStrings(F, L, ''); end; `
It is also sad that the web app size after that has increased significantly. Apparently the module Translations in uses....
Hello @Al-Muhandis . All raised messages are assigned to global (unsafe) variables, so you can translate them using your favorite translation tool.
@silvioprog obrigado!
You're welcome! :-)
Hi! I saw the information in the wiki that BF supports i18n. What does this mean? I used this feature in desktop applications (language determine from machine) but in web... For example, I want all string constants (not from templates of course) from the resourcestrings section to be taken from .po file in the client / user language. I will need to use SetDefaultLang ('en'{ru/es/ar}, LangDirectory); for load .po strings?