Table of Contents

Getting started with TMS FNC Localization

TMS FNC Localization adds a translation layer to a Delphi or C++Builder application without rewriting the UI. It collects the translatable text in your forms, stores each language's translations, and switches the active language at runtime — optionally generating the translations for you through an AI engine. This guide covers the prerequisites, the packages to install, and a first end-to-end language switch. Reach for it when you are setting up localization in a project for the first time; the individual components each have their own in-depth guides for day-to-day work.

Requirements

Requirement Details
IDE Delphi 11.1 Alexandria or C++ Builder 11.1 Alexandria or later
Frameworks VCL Win32/Win64 · FMX Win32/Win64, macOS, iOS, Android, Linux · WEB Core (Chrome, Edge, Firefox, Safari)
Dependency TMS FNC Core must be installed before Localization

Core concepts

A localized application typically combines a few of the registered components:

  • Collector — discovers the localizable components and properties in the running application so their captions can be translated.
  • Localizer — the runtime engine. It loads the translation files, switches the active language, and notifies the rest of the application when the language changes.
  • String Catalog — stores application strings (and their translations) that are not tied to a specific control.
  • Localization Editor — creates and edits the translations for each language.
  • Localization ComboBox — lets the user pick the active language.

Translations can also be generated automatically: the editor can call an AI translation service to fill in missing translations for you.

First language switch

The shortest useful setup drops a localizer, points it at the folder of translation file(s), and switches the active language by locale. The equivalent runtime setup:

procedure TForm1.FormCreate(Sender: TObject);
begin
  { Create a localizer in code (or drop TTMSFNCLocalizationLocalizer on the form). }
  FLocalizer := TTMSFNCLocalizationLocalizer.Create(Self);

  { Localize automatically as the application starts and idles. }
  FLocalizer.LocalizationStartMode := lsmAutoHook;

  { Point the localizer at the folder that holds the translation files. }
  FLocalizer.LocalizationFolder := TPath.Combine(TPath.GetDocumentsPath, 'Translations');

  { Remember the last language the user selected between runs. }
  FLocalizer.PersistLanguageSelection := True;

  { React to a language change. }
  FLocalizer.OnLanguageChange := HandleLanguageChange;
end;

procedure TForm1.SwitchToFrench;
begin
  { Activate a language by locale; returns False when no translation exists. }
  if not FLocalizer.TrySetLocale('fr') then
    ShowMessage('No French translation is available.');
end;

TrySetLocale returns False when no translation exists for the requested locale, so you can fall back gracefully. Set LocalizationStartMode to lsmAutoHook to localize automatically as the application creates dynamic forms, lsmIdleHook to localize as the application idles or lsmManual to call PerformLocalization yourself.

Next steps

  • Browse the components for component-specific guides and API reference.
  • See the API reference for the full class-level documentation.