Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: HeCAPTe 1.0.2 — Minor update available for module hecapte_captcha (1.0.2). Release: Attribution & Licensing 1.2.1 — Minor update available for module attribution (1.2.1). Release: MCP Sentinel 2.29.0 — Minor update available for module mcp_sentinel (2.29.0). Release: Audit Chain 1.10.9 — Minor update available for module audit_chain (1.10.9). Release: Menu Autopilot 1.4.7 — Minor update available for module menu_autopilot (1.4.7). Release: FileGate 1.11.3 — Minor update available for module file_gate (1.11.3). Release: Download Tracker 1.0.7 — Minor update available for module download_tracker (1.0.7). Release: Directory2Block Slideshow 1.0.8 — Minor update available for module directory2block_slideshow (1.0.8). 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.

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.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

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

Releases

Version Type Core Release date
2.0.3 Stable Mar 31, 2024