Show: Delphi C++
Display Preferences

FMX.Types.TLang.Lang

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Lang: string read FLang write SetLang;

C++

__property System::UnicodeString Lang = {read=FLang, write=SetLang};

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

See Also

Personal tools
In Other Languages
Previous Versions
Assistance