Makes it possible to have custom files in your translations directory, and therefore also to deploy translations.

To deploy translations you can typically use this workflow.

Make sure you have a translation file you can update

There are 2 options that this module provides:

Provide a translation file that is project specific

This module provides one default translation file that you can use in your project. If you place a file called project_specific-custom.LANGUAGE.po in your translations folder, it will get automatically imported on locale updates. This file should look something like this:

msgid ""
msgstr ""
"Project-Id-Version: Custom\\n"
"MIME-Version: 1.0\\n"
"Content-Type: text/plain; charset=UTF-8\\n"
"Content-Transfer-Encoding: 8bit\\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\\n"

# A quote from Scully in X files season 3, episode "Pusher".
msgid "Please explain to me the scientific nature of the whammy"
msgstr "Forklar meg whammyens vitenskapelige natur"

Provide translation files common for your agency/organization/distribution

This module also makes it easy to add your own custom translation files to be expected in the translation directory by exposing a hook for this.

Here is one example:

/**
 * Implements hook_custom_translation_deployments_files().
 */
function mymodule_custom_translation_deployments_files() {
  $items = [];
  $items[] = [
    'name' => 'custom',
    'project_type' => 'module',
    'core' => '8.x',
    // We set the version to something static, but not to "dev".
    'version' => 'mycompany',
    'server_pattern' => 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po',
    'status' => 1,
  ];
  return $items;
}

Make sure you have translations in version control

Next step is to have your translation files in version control. For example keeping them in PROJECT_ROOT/translations. You can do this by setting the path to translations in the settings for "File system".

Add a file and add a step for importing it in your deploy

Last step is to keep a custom translation file called either custom-mycompany.nb.po (like the hook example) or project_specific-custom.nb.po (the default custom file provided by this module) in your translations directory (example for Norwegian). Then in your deploy job you make sure you update translations. For example by calling drush locale-update.

Supporting organizations: 
Development and maintenance

Project information

Releases