Skip to content

fedms_locale

The localization module — provides language entities, configures content/config translation, and ships Ahoy commands for managing the framework's translation strings.

GitLab

fedms/components/locale

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
# Re-extract framework translation strings into fedms_locale.de.po
l3d ahoy fedms_locale extract-translation

# Import the .po file with --override=all
l3d ahoy fedms_locale import-translation

# Export only fedms_locale config (for committing translation updates)
l3d ahoy fedms_locale export-config

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
- drupal:config_translation
- drupal:content_translation
- drupal:locale
- toolbar_language_switcher:toolbar_language_switcher

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

  1. Developer adds new translatable strings to PHP / Twig / YAML.
  2. After the change lands on develop, someone (often automated) runs l3d ahoy fedms_locale extract-translation to re-extract.
  3. A translator updates the .po file (typically through a translation platform).
  4. The updated .po is committed to the repo.
  5. On every install / update, the .po is imported automatically.

Adding a new language

  1. Add the language entity to config/install/language.entity.<code>.yml.
  2. Add a corresponding <code>.po file with the framework translations.
  3. Update ahoy.yml to extract and import the new language.
  4. 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