How to Localize an Application
Kittox supports full localization of both the framework interface and your application's metadata. You can also build multi-language applications where each user selects their language at login.
Step 1: Localize the framework interface
The framework locale folder is KittoX/Home/Locale/. Italian is included out of the box:
KittoX/Home/Locale/
it/
LC_MESSAGES/
Kitto.po # Source strings (editable with Poedit)
Kitto.mo # Compiled binary (used at runtime)To add a new language:
- Copy the
it/folder and rename it with the language code (e.g.de/,fr/,es/) - Open
Kitto.powith Poedit - Translate all
msgstrentries - Save — Poedit generates the
.mofile automatically
The .po file covers all framework strings: form buttons (Save, Confirm, Cancel, Edit, Close, Delete, Save All, etc.), error messages, login labels, confirmation dialogs, and client-side JavaScript strings.
Step 2: Localize your application metadata
Your application's locale folder ({App}/Home/Locale/) follows the same structure. Use the _() marker in YAML files:
Field labels and hints:
Fields:
Doll_Name: String(40) not null
DisplayLabel: _(Name)
Date_Bought: Date
DisplayLabel: _(Birth Date)
Picture: Blob
DisplayLabel: _(Photo)
Hint: _(Select a picture)Allowed values:
Fields:
Dress_Size: String(4)
AllowedValues:
XS: _(Extra Small)
S: _(Small)
M: _(Medium)See the HelloKitto and TasKitto examples for complete working samples.
Step 3: Mark strings in Delphi code
In custom controllers and rules, use _() from EF.Localization:
uses
EF.Localization;
procedure TCheckDuplicateInvitations.BeforeAdd(const ARecord: TKRecord);
begin
if ARecord.Store.Count('INVITEE_ID', ARecord.FieldByName('INVITEE_ID').Value) > 1 then
RaiseError(_('Cannot invite the same girl twice.'));
end;Step 4: Enable multi-language support
To let users choose their language at login, add to your Config.yaml:
LanguageId: en
LanguagePerSession: TrueLanguageId sets the default language for the login page. When LanguagePerSession is True, a language selector appears on the login dialog. The selector lists all locale subfolders found in Home/Locale/.
See also
- Localization Reference — full reference, file structure, client-side strings
- Login — language selector on the login page
