TTMSFNCLocalizationLocalizer is the runtime engine of TMS FNC Localization. Drop it on a form or data module and it loads your translation files, switches the active application language on demand, remembers the user's choice between runs, and notifies the rest of the application when the language changes. It is a non-visual component — pair it with the String Catalog and Collector to supply and gather translatable content, and with the Localization ComboBox to let users pick a language.
You want class, property, method, and event details.
Quick start
Configure the localizer and apply the previously selected language:
Configure the localizer and apply the saved languagePascalC++
procedure TDataModule1.DataModuleCreate(Sender: TObject);
begin
{ Localizer, Collector and StringCatalog are dropped on this data module at design time. }
Localizer.LocalizationFolder := TPath.Combine(TPath.GetDocumentsPath, 'Translations');
Localizer.LocalizationStartMode := lsmManual;
Localizer.PersistLanguageSelection := True;
{ The localizer already read the folder set in the Object Inspector when the
data module loaded. The folder changed in code, so read it again. }
Localizer.RescanLanguages;
{ Apply the language the user selected on the previous run
(falls back to the source language when nothing was persisted). }
Localizer.PerformLocalization;
end;
void __fastcall TDataModule1::DataModuleCreate(TObject *Sender)
{
// Localizer, Collector and StringCatalog are dropped on this data module at design time.
Localizer->LocalizationFolder = System::Ioutils::TPath::Combine(System::Ioutils::TPath::GetDocumentsPath(), "Translations");
Localizer->LocalizationStartMode = TTMSFNCLocalizationStartMode::lsmManual;
Localizer->PersistLanguageSelection = true;
// The localizer already read the folder set in the Object Inspector when the
// data module loaded. The folder changed in code, so read it again.
Localizer->RescanLanguages();
// Apply the language the user selected on the previous run
// (falls back to the source language when nothing was persisted).
Localizer->PerformLocalization();
}