fedms_locale¶
The localization module — provides language entities, configures content/config translation, and ships Ahoy commands for managing the framework's translation strings.
GitLab¶
What it ships¶
Languages¶
language.entity.de— German.- Rewrites
language.entity.en— English (the default).
Customers can add more languages via the Drupal admin UI
(/admin/config/regional/language).
Ahoy commands¶
From the module's ahoy.yml:
1 2 3 4 5 6 7 8 | |
The first command uses Potx to
walk the FedMS codebase and extract every translatable string into
the .po file. The second command imports the .po into the live
database.
Module dependencies¶
1 2 3 4 | |
How translation works in FedMS¶
There are three kinds of translatable content:
| Kind | Stored in | Translated via |
|---|---|---|
| Framework strings | PHP / Twig / YAML source | .po files (this module's responsibility) |
| Config (labels, descriptions) | Config entities | config_translation |
| Content (events, sessions, pages, attachments) | Content entities | content_translation |
fedms_locale provides the language entities and the toolbar
language switcher; the actual translation flows use Drupal core's
locale/translation modules.
The .po workflow¶
- Developer adds new translatable strings to PHP / Twig / YAML.
- After the change lands on
develop, someone (often automated) runsl3d ahoy fedms_locale extract-translationto re-extract. - A translator updates the
.pofile (typically through a translation platform). - The updated
.pois committed to the repo. - On every install / update, the
.pois imported automatically.
Adding a new language¶
- Add the language entity to
config/install/—language.entity.<code>.yml. - Add a corresponding
<code>.pofile with the framework translations. - Update
ahoy.ymlto extract and import the new language. - Open an MR.
When not to change this module¶
- Tenant-specific content translations — those live in the tenant's database, not in this module.
- Theme translations — those belong to the theme.
Next steps¶
fedms_content— translatable content entities.- Drupal core localization docs at drupal.org/docs/multilingual-guide.