Unit CastleLocalization

Description

Localization system for handling localization. Use this in your games for easy localization. A basic example can be found at "examples/localization/custom". Note that this is not the only way to localize your Castle Game Engine games. You can as well use resourcestrings and standard FPC GetText unit directly, as shown in the example code in "examples/localization/gettext".

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Interface ICastleLocalizationCustom Interface for custom user classes using the localization.
Interface ICastleLocalization Interface for all user components using the localization.
Class TCastleLocalization Main comonent for localization, singleton as Localization.
Class TCastleLabelLocalizable A descendent of TCastleLabel that can be localised with CastleLocalization.
Class TCastleButtonLocalizable A descendent of TCastleButton that can be localised with CastleLocalization.
Class TCastleMenuButtonLocalizable A descendent of TCastleMenuButton that can be localised with CastleLocalization.
Class TCastleEditLocalizable A descendent of TCastleEdit that can be localised with CastleLocalization.

Types

TLanguageDictionary = specialize TDictionary<String, String>;
TFileLoaderAction = procedure(const AFileStream: TStream; const ALanguageDictionary: TLanguageDictionary);
TFileLoaderDictionary = specialize TDictionary<String, TFileLoaderAction>;
TOnLocalizationUpdatedEvent = procedure of object;
TOnLocalizationUpdatedEventList = specialize TList<TOnLocalizationUpdatedEvent>;
TOnUpdateLocalizationEvent = procedure(const ALocalizedText: String) of object;
TOnUpdateLocalizationEventList = specialize TList<TOnUpdateLocalizationEvent>;
TLocalizationIDList = specialize TDictionary<TOnUpdateLocalizationEvent, String>;

Variables

Localization: TCastleLocalization;

Description

Types

TLanguageDictionary = specialize TDictionary<String, String>;

Dictionary (LocalizationID/TranslatedText as String/String) for storing all translated strings of the current language.

TFileLoaderAction = procedure(const AFileStream: TStream; const ALanguageDictionary: TLanguageDictionary);

Procedure of a file loader called by CastleLocalization to fill the language dictionary from a file stream.

TFileLoaderDictionary = specialize TDictionary<String, TFileLoaderAction>;

Dictionaty (FileExtension/FileLoaderAction as String/TFileLoaderAction) to connect the known file loaders with it's file extensions.

TOnLocalizationUpdatedEvent = procedure of object;

Called by CastleLocalization to all subscribed procedures when a new language is set.

TOnLocalizationUpdatedEventList = specialize TList<TOnLocalizationUpdatedEvent>;
 
TOnUpdateLocalizationEvent = procedure(const ALocalizedText: String) of object;

Called by CastleLocalization to all subscribed components when a new language is set.

TOnUpdateLocalizationEventList = specialize TList<TOnUpdateLocalizationEvent>;
 
TLocalizationIDList = specialize TDictionary<TOnUpdateLocalizationEvent, String>;

List (dictionary) for the localization IDs of all subscribed components.

Variables

Localization: TCastleLocalization;

Singleton for TCastleLocalization.


Generated by PasDoc 0.15.0.