Locale Translation Context

Component ID

2800689

Component name

Locale Translation Context

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

242

Component created

Component changed

Component body

This module adds context filtering capabilities to the core translation interface.

Impacted pages

Configuration > Regional and Language > Translate interface > Translate

Allow to filter the translated strings by context.

Configuration > Regional and Language > Translate interface > Export

Allow to export strings for a specific context.

Use case

Using contexts when writing custom code is a good practice. It allows to clearly separate your custom strings from the core and contrib modules strings, and to be able to translate the same string differently if the context of the word is not the same.

Example of a translation string using context:
t('This is my custom string', array(), array('context' => 'custom_project');

Unfortunately, the Drupal core does not provide any functionalities in the admin interface to make use of the strings translation contexts. This module adds basic functionalities to manipulate contexts.