How to translate backend and embed parts

The backend (the server part) and the embedded comment engine share the same set of so-called messages, all of them located under resources/i18n/ in the project root.

You can see the list of available languages by logging into the Administration UI as a superuser and navigating to ConfigurationStatic: the section Available UI languages lists all installed translations.

Each translation is a text-based YAML file, providing a mapping between Message ID and Message translation. The file name must be a RFC 5646 tag of the target language, and its extension yaml.

Here’s an example for English:

# en.yaml
- id: accountCreatedConfirmEmail
  translation: Account is successfully created. Please check your email and click the confirmation link it contains.
- id: actionAddComment
  translation: Add Comment
- id: actionApprove
  translation: Approve
- id: actionCancel
  translation: Cancel

And below is an example how the same messages look in Russian:

# ru.yaml
- id: accountCreatedConfirmEmail
  translation: Аккаунт успешно зарегистрирован. Мы отправили вам емэйл, пожалуйста, подтвердите свой адрес, перейдя по содержащейся в нём ссылке.
- id: actionAddComment
  translation: Добавить комментарий
- id: actionApprove
  translation: Утвердить
- id: actionCancel
  translation: Отмена


If you’d like to contribute your own translation for a language that is missing, follow these steps:

  1. Fork the Comentario repository.
  2. Make a copy of an existing translation (resources/i18n/en.yaml is always the most complete one) into a new resources/i18n/<language_tag>.yaml.
  3. Translate every message.
  4. Commit the file into your fork.
  5. Submit a Merge Request for merging your changes into the dev branch.

See also