FMX.Types.TLang.Lang
Delphi
property Lang: string read FLang write SetLang;
C++
__property System::UnicodeString Lang = {read=FLang, write=SetLang};
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | published | FMX.Types.pas FMX.Types.hpp |
FMX.Types | TLang |
Description
Specifies the currently selected language.
Use the Lang property to retrieve the current language from the TLang instance. The language is specified through the conventional two-letter code.
Switching the Language of Your Application at Run-time
There are special cases where switching between languages does not work as expected if the language that you switch to is English (en
). As a workaround, we recommend that you use LoadLangFromStrings instead of setting TLang.Lang to switch between languages at run-time.
The following code snippet shows how to use LoadLangFromStrings:
- Note: The code snippet below assumes that you added the desired langages in the Language Designer.
Delphi:
//Lang1.Lang := 'en'; // do not use this
LoadLangFromStrings(Lang1.LangStr['en']); // use this instead
C++:
//Lang1->Lang = "en"; // do not use this
LoadLangFromStrings(Lang1->LangStr["en"]); // use this instead