Translations
Uchi comes with support for I18n and L10n built in. And if you don’t want to translate your admin backend, the translation setup can instead be used to customize pretty much all interface elements in whatever language you prefer.
Uchi does not come with any actual translations by default, since this is way too application specific.
We rely on Rails’ I18n backend for this, see the Rails Internationalization (I18n) API guide for details.
How to add translations
All Uchi-specific translations live under an uchi namespace.
Field translations are located under uchi.repository.[model i18n key].field.[field name]. The model i18n key is the repository model’s model_name.i18n_key, e.g. account for Account and admin/account for Admin::Account. If you want to change the label of a field, use the label key, and to set a helpful hint text use the hint key. Like so:
uchi:
repository:
account:
field:
paid_until:
hint: "When does the account expire?"
label: "Paid until"
How to translate breadcrumbs
The label of the root item in breadcrumbs can be translated using the translation key uchi.breadcrumb.root.label.
How to translate the search input placeholder
The search input placeholder uses one of two translation keys:
| Search | Key | Default |
|---|---|---|
| Repository index page | uchi.common.search |
Search |
| Global search | uchi.search.label |
Search |
uchi:
common:
search: "Find records"
search:
label: "Search everything"
uchi.common.search applies to the index pages of all repositories. uchi.search.label is also used for the search link in the navigation.