Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

YAML Translation Import

Security covered Drupal 9–11
View on drupal.org

Developer module that makes it possible to import YAML Translation files.

The initial idea of this module was to provide translations as the Symfony Translation component.

This workflow requires that "Enable interface translation" for your default language is enabled.

The translations provided in your custom code will be keyword messages, e.g. drupal.is.great. Those keywords will act as an ID. Since this keyword message is no actual translation, but a keyword that conveys the idea of the message, your keyword doesn't have to be changed, every time you want to update a label in the default language.

Translations can be added in a .yml file. By default those translation files are added in sites/default/translations. Translations are group in a file per language. The filename follows the this convention: translations.[language_id].yml.
E.g. When you want to add English translations, the filename will be translations.en.yml.

An example of a translation file:

drupal:
  is:
    great: 'Drupal is great!'
    amazing: 'Drupal is amazing!'
  uses:
    modules: 'Drupal uses modules'

The advantage of using YAML as a translation file format is that labels that belong together can be grouped. E.g. All labels related to "Drupal" can start with drupal. In your YAML file, all Drupal related translations are grouped together.

Another advantage of using a file, is that you can provide default labels. This module provides a backend screen on /admin/config/regional/translate/yaml/import where you can import your newly added translations or even update old translations.
This module can also be part of you deployments by using the drush command drush yti.

Depends on

Dependencies of the latest stable release

  • locale Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Sep 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-1.3 Stable 9–11 Sep 13, 2024