Table of Contents

Getting started with the language ComboBox

This page covers the shortest path to a working language picker: prerequisites, how to add the component, and what to expect at runtime. For the details of what the combo lists and how selection switches the language, see the user guide.

Prerequisites

  • TMS FNC Core installed and the runtime package added to the project.
  • TMS FNC Localization installed.
  • A VCL, FireMonkey, or TMS WEB Core application that already has a Localizer with its translations loaded — the combo lists the languages the localizer knows about.

Add the component

Drop a TTMSFNCLocalizationComboBox from the TMS FNC Localization palette tab onto a form, or create it in code. No population code is required — the combo fills itself from the available languages and selects the active one:

procedure TForm1.FormCreate(Sender: TObject);
begin
  { Usually dropped on the form at design time; shown here in code. }
  FLanguages := TTMSFNCLocalizationComboBox.Create(Self);
  FLanguages.Parent := Self;
  FLanguages.Position.X := 16;
  FLanguages.Position.Y := 16;
  FLanguages.Width := 200;

  { No population code is needed: the combo lists the available languages and
    selects the active one on its own, and switches the language when the user
    picks a different entry. Make sure a localizer has loaded the translations. }
end;

Run the application

Compile and run. The combo shows one entry per available language (its full description, such as Deutsch or Français) with the active language pre-selected. When the user picks a different entry, the application switches to that language immediately.

Language combo box showing the active application language selected Language combo box showing the active application language selected

See also