-
Notifications
You must be signed in to change notification settings - Fork 0
Translations
Translation strings are automatically generated using your configurations. Even if you don't actively use i18n, translations are required to provide a visually pleasing frontend. Translations are maintained on two levels (called domains): application domain and fallback messages domain. If the application domain doesn't contain the translation, it is looked up in the main messages domain.
In case of our example app (authors, books), translations could look like this:
# /user/translations/app_books.en.yaml
title.books: Favorite books
entity.verbose: Book
entity.verbose_plural: Books
label.author: Author
label.rating: Rating
# rating fields are under construction. For now, just translate the choices
choice.rating.1: 1
choice.rating.2: 2
choice.rating.3: 3
choice.rating.4: 4
choice.rating.5: 5# /user/translations/app_authors.en.yaml
label.count_books: No. books# /user/translations/messages.en.yaml
label.name: Name
label.surname: Surname
text.dashboard.empty.verbose: "No known verbose"
action.entity.create.verbose: "Create verbose"
text.entity.create.verbose: Create
text.entity.edit.verbose: EditTranslations can be maintained in other formats than YAML as well. Read the docs
There are a few types of translation strings:
- label.<name>: Application fields/columns
- choice.<fieldname>.<value>: Application field choice
- entity.verbose: Domain specific translation for application entity (e.g. Book, Author, Commpetition, Car)
- entity.verbose_plural: Idem ditto, but plural (e.g. Books, Authors, Competitions, Cars)
Static application translations, used to bring your frontend to life:
- text.dashboard.empty.verbose: Shown if there are no entries for this application (e.g. There aren't any Cars in stock)
-
action.entity.create.verbose: Create button with entity name.
verboseis replaced by the entity translation. - text.entity.create.verbose: Create button
- text.entity.edit.verbose: Edit button
You can also store these in domain (= application) specific translations, to create some more variety.