Skip to main content

UI texts

Every piece of interface text — menu items, error messages, button labels — comes from the texts array in your data file, and every text you leave out shows as its key.

Two texts are outside your control. The loading screen shows a fixed English Loading with the progress percentage. And until the data file has loaded and a language is chosen, there are no texts to look up: if the very first load fails, the error screen shows the raw keys, no-internet and try-again.

Shape​

"texts": [
{ "language": "en", "key": "menu-overview", "value": "Overview" },
{ "language": "de", "key": "menu-overview", "value": "Übersicht" }
]

Flat triples, one entry per key per language.

The keys​

Which keys you need depends on which screens your app uses. The cheapest policy is to define all of them.

The default app​

KeyWhere it appearsExample (en)
menu-overviewMenu item opening the station listOverview
menu-selectionMenu item opening the keypad, and the keypad screen's titleEnter number
menu-languageMenu item opening the language screen. Hidden when only one language is offered.Change language
menu-share-appMenu item opening the share sheet, and the share sheet's title. Hidden unless share is set and the device can share.Recommend audioguide
enter-pinPrompt on the PIN screenPlease enter the PIN code you received at the ticket desk.
pin-errorShown when the code does not matchThe PIN code is not correct.
no-internetHeadline on the error screen when the data could not be loadedThe audioguide could not be loaded
try-againThe error screen's retry buttonTry again

Pages the default app does not use​

KeyPageExample (en)
menu-overview, start-toursc-page-tour-listOverview, Start tour
station-listsc-page-station-list, sc-page-station-image-listStations
viewsc-page-station-image-listView
menu-mapsc-page-mapMap

The library exports this list as the TranslationKey type, see UI components.

When a text is missing​

A missing key does not break the page. The app first tries the key with - and _ swapped, then falls back to the key itself, lower-cased and with its first hyphen and first underscore each turned into a space — try-again reads try again. Readable enough to notice in testing, which is the point: check every screen in every language before you publish.

A complete starting set​

Copy this and translate it. The two demo files (Animals, Leon) are real-world versions of the same thing.

"texts": [
{ "language": "en", "key": "menu-overview", "value": "Overview" },
{ "language": "en", "key": "menu-selection", "value": "Enter number" },
{ "language": "en", "key": "menu-language", "value": "Change language" },
{ "language": "en", "key": "menu-share-app", "value": "Recommend audioguide" },
{ "language": "en", "key": "enter-pin", "value": "Please enter the PIN code you received at the ticket desk." },
{ "language": "en", "key": "pin-error", "value": "The PIN code is not correct." },
{ "language": "en", "key": "no-internet", "value": "The audioguide could not be loaded" },
{ "language": "en", "key": "try-again", "value": "Try again" },

{ "language": "de", "key": "menu-overview", "value": "Übersicht" },
{ "language": "de", "key": "menu-selection", "value": "Nummer eingeben" },
{ "language": "de", "key": "menu-language", "value": "Sprache wechseln" },
{ "language": "de", "key": "menu-share-app", "value": "Audioguide empfehlen" },
{ "language": "de", "key": "enter-pin", "value": "Bitte geben Sie den PIN-Code ein, den Sie an der Kassa erhalten haben." },
{ "language": "de", "key": "pin-error", "value": "Der PIN-Code ist nicht korrekt." },
{ "language": "de", "key": "no-internet", "value": "Der Audioguide konnte nicht geladen werden" },
{ "language": "de", "key": "try-again", "value": "Erneut versuchen" }
]

Writing them​

  • Keep them short. These are phone screens. Overview fits; Overview of all available stations does not.
  • Match your house voice. The formal or informal address (Sie or du, vous or tu) should be the same here as in your station texts.
  • enter-pin is where you explain the PIN. It is the only place a visitor learns where the code comes from, so name it: at the ticket desk, on the back of the ticket, in the confirmation email.
  • no-internet covers every load failure — a wrong data URL, a CORS problem, a host that is down, as well as a missing connection. "The audioguide could not be loaded" is more honest than "No internet connection".
  • No HTML in a value. It is shown as text.

Checking coverage​

The checklist script reports every key that is missing from a language. Run it before every publish.