Skip to content

Conversation

@spaenleh
Copy link
Member

In this PR I set Gettext up.

  • documentation was added to the Readme
  • email templates support translations based on recipient's lang setting

Usage

To make some text in the app use translations imply wrap the text string with the gettext/2 macro:
Click here -> gettext("Click here") for example.
Interpolation is also possible: gettext("Hello %{name}", name: "John").
Pluralisation is supported with ngettext("One error", "%{count} errors", 3)

There is a simple mix task that can be used to update the translations: mix i18n

The translation template files are .pot files, they should not be touched. They are updated with mix gettext.extract.
The translation files are .po files, this is the files that are given to translators. They can be updates with the new, updated and removed keys with mix gettext.merge priv/gettext.

@spaenleh spaenleh requested a review from pyphilia January 12, 2026 11:50
@spaenleh spaenleh self-assigned this Jan 12, 2026
@spaenleh spaenleh added the feature New feature or request label Jan 12, 2026
@spaenleh spaenleh changed the title feat: setup Gettext for internationalisation in emails feat: setup Gettext for internationalisation in emails Jan 12, 2026
@spaenleh spaenleh merged commit b0450cd into main Jan 13, 2026
3 checks passed
@spaenleh spaenleh deleted the gettext-setup branch January 13, 2026 14:15
@graasper graasper mentioned this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request un-released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants