Skip to content
Guide

Localize an App

Add one App-owned label to PHP and React in every shipped locale.

Localize an App

Add the category label from Data Model and Migrations to the existing flat JSON object in each App-relative file:

FileEntry
resources/lang/en.json"workshop.note.category.label": "Category"
resources/lang/ko.json"workshop.note.category.label": "분류"
resources/lang/zh.json"workshop.note.category.label": "分类"

Preserve existing entries and valid JSON commas. React reads it with t('workshop.note.category.label'); request-time PHP uses __('workshop.note.category.label'). From the Core root, clear the cached catalog and check the keys:

Code example
Shell
task artisan -- nexia-runtime:clear-translation-catalog-cache
task artisan -- nexia-runtime:validate-translations

Verify

Reload the Note form in each locale. The label should resolve and the same field error should remain associated with its input.

Put keys in declarations

Navigation, descriptors and other contributions are discovered outside a request. Supply labelKey, descriptionKey or the appropriate text-role key; do not translate eagerly or embed locale maps in the declaration. The host resolves text at the payload boundary.

Resource fields use workshop.note.*. Permission labels use permissions.keys.workshop.note.<action>.label and .description; navigation uses the App's own prefix. A stable Resource or App key is an identifier, not text to translate.

Catalogs must be flat JSON objects with string values. Keys contain dots and no colon; owned path segments use lowercase snake_case, with stable kebab-case identifiers and exact enum tokens supported. Match placeholders across locales and use natural copy. The generator merges keys rather than replacing your catalog; Chinese generator fallback still needs editorial review before release.

Reuse status and validation wiring

NoteStatus owns status values and label keys. Its filter options and descriptor enum labels derive from that enum. Change the enum and locale entries together instead of duplicating a status list in React.

The generated form maps server field names to Resource label keys and passes field errors through the SDK form schema. Add workshop.note.category.label once rather than hard-coding another error label.

For malformed catalogs or missing labels, start with nexia-apps:doctor-package-app workshop. See Resource contracts for descriptor label fields and React components and hooks for form text roles.

Source of truth: docs/developers/content/en/building-apps/localize-an-app.md