Skip to content

Localization

Summary

Your server controls all user-facing text. The client renders what you send. This page covers locale settings, work date, and UI strings.

Locale

Set locale on the ScreenContract to control date and number formatting:

json
{
  "locale": {
    "date_format": "DD-MM-YYYY",
    "decimal_separator": ",",
    "thousand_separator": "."
  }
}
SettingDefaultEffect
date_formatDD-MM-YYYYDate display and parsing order. Options: "DD-MM-YYYY", "MM-DD-YYYY"
decimal_separator,Decimal point in numbers (, for European, . for US/UK)
thousand_separator.Thousand grouping (. for European, , for US/UK)

The client uses date_format when parsing date field shortcuts (e.g., 1203 → March 12 in DD-MM, or December 3 in MM-DD).

You only need to send locale once. The client caches it for the session.

Work date

Set work_date on the ScreenContract to define the reference date for date field shortcuts:

json
{
  "work_date": "10-03-2026"
}

When the user types t in a Date field, it expands to this date instead of the system date. This is useful for accounting periods where users post entries on a specific date.

If work_date is not set, the client uses today's system date.

UI strings

Set ui_strings on the ScreenContract to localize all client UI text:

json
{
  "ui_strings": {
    "save_confirm_title": "Gem ændringer?",
    "save_confirm_message": "Du har ændringer der ikke er gemt.",
    "save_confirm_save": "Gem",
    "save_confirm_discard": "Kassér",
    "save_confirm_cancel": "Annullér",
    "quit_title": "Afslut",
    "quit_message": "Vil du afslutte?",
    "quit_yes": "Ja",
    "quit_no": "Nej",
    "logout": "Log ud",
    "saved": "Gemt.",
    "saving": "Gemmer...",
    "loading": "Indlæser...",
    "created": "Oprettet.",
    "deleted": "Slettet.",
    "cancelled": "Annulleret.",
    "no_changes": "Ingen ændringer.",
    "copied": "Kopieret.",
    "error_prefix": "Fejl",
    "save_error_prefix": "Fejl ved gem",
    "login_error": "Ugyldigt brugernavn eller adgangskode.",
    "server_unavailable": "Server ikke tilgængelig.",
    "connecting": "Forbinder..."
  }
}

All UI string keys

KeyDefault (English)Used for
save_confirm_title"Save Changes?"Save confirmation modal title
save_confirm_message"You have unsaved changes."Save confirmation message
save_confirm_save"Save"Save button label
save_confirm_discard"Discard"Discard button label
save_confirm_cancel"Cancel"Cancel button label
quit_title"Quit"Quit confirmation title
quit_message"Do you want to quit?"Quit confirmation message
quit_yes"Yes"Quit yes button
quit_no"No"Quit no button
logout"Log Out"Logout option in quit modal
created"Created."Status after creating a record
deleted"Deleted."Status after deleting a record
saved"Saved."Status after saving
saving"Saving..."Status during save
loading"Loading..."Status during screen fetch
cancelled"Cancelled."Status after cancel
no_changes"No changes."Status when saving with no dirty fields
copied"Copied."Status after clipboard copy
error_prefix"Error"Prefix for general errors
save_error_prefix"Save error"Prefix for save errors
login_error"Invalid username or password."Login failure message
server_unavailable"Server unavailable."Connection failure
connecting"Connecting..."Connection in progress

Partial override

If ui_strings is absent, the client uses English defaults. If a specific key is absent or empty, the client falls back to the English default for that key. You only need to send the strings you want to override.

When to send

Send ui_strings with the main menu or the first screen. The client caches the strings for the session. You do not need to include them on every response.

Error handling and status messages

Your server controls error and status messages through the status field on the ScreenContract:

json
{
  "status": "Saved."
}
{
  "status": "Cannot save: Name is required."
}

The client shows the status text in the bottom bar. Use your localized language for these messages.