Overview
Translation importer is a really simple module built to automatically import translation catalogs (.po files) whenever these are updated. Original idea and code are from dcycleproject. This approach required an update hook to import translations. That works perfectly but that's also unnecessary extra work for translators who normally do not need to touch module .install files.
With this module the translations workflow is reduced to minimal amount of steps:
- Checkout translation catalogs from Git.
- Push changes back to Git.
Translation catalogs are full catalogs and these catalogs should be the only source for translations as translation import will always overwrite existing translations. Catalog extracts, translations updates, merges and whatnot are tasks that require other modules. These modules are related but quite different because with a dev - staging - production workflow translation modules are not required in staging or production environment at all. Translation importer is all you need on these environments to keep translations up to date.
Installation & configuration
This module requires no configuration but the source directory for translation catalogs can be configured with "file_translations_path" -variable. This module does not have any UI.
Usage
Translation importer module uses catalogs:// file stream to get the
translation catalogs. Files are automatically detected from that stream as long as they are named correctly in form of "langcode-textgroup.po".
Examples:
- fi-default.po
- en-gb-field.po
- sv-webform.po
- etc...
Translations directory defaults to "conf_dir()"/translations, so usually that is sites/default/translations. If these defaults are followed, this module requires no configuration whatsoever.
This module will not add new languages or enable any localization modules. It is recommended to use this module with a deploy module or similar deployment strategy. Catalog changes are detected whenever hook_flush_caches is ran. By default that only happens when `drush updb` is invoked. Catalog updates are checked even if there is no other pending updates.
Related modules
These modules can be used in other parts of the workflow to automate tasks and reduce the amount of manual steps.
- Drush Language Commands is Drush command module that can be used to import and export catalogs per text group.
- Translation template extractor to update 'default' catalog sources from source code.
- Localization update is the tool to update translations for 'default' text group.
Project information
- Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Multilingual
- 10 sites report using this module
- Created by mikran on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
This release adds new configuration options and allows for different kinds of translation deployment workflows.
Development version: 7.x-1.x-dev updated 27 Apr 2018 at 11:23 UTC