Skip to content

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:

  1. Copy the it/ folder and rename it with the language code (e.g. de/, fr/, es/)
  2. Open Kitto.po with Poedit
  3. Translate all msgstr entries
  4. Save — Poedit generates the .mo file 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:

yaml
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:

yaml
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:

pascal
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:

yaml
LanguageId: en
LanguagePerSession: True

LanguageId 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

Released under Apache License, Version 2.0.