4. Basic principles
• Developer centric workflow
• We prefer editing files over GUI
• All translation files (.po) are stored in git *
• All UI strings in custom code and theme are translatable.
5. 3 sources of translatable strings
• Strings in core and contrib modules
• Strings in custom modules and theme
• Custom translations that override the others
7. Translate core and contrib strings
Enable
module
Download
gettext
Save file
Import
translations
Add file
to Git
Interface Translation module
8. Translate core and contrib strings
Developer
• Download and import module translations (drush 9+):
drush pm:enable extra_field
• Add translations to Git:
git add ../translations
9. Translate core and contrib strings
Stage
• Import translations from file:
drush locale:check
drush locale:update
10. Translate core and contrib strings
Interface Translation settings
• Never check for updates
• Only use local translation source
• Only overwrite imported translations
• Translations directory outside of drupal root:
../translations
Development config override
• Use local _and remote_ translation source
$config['locale.settings']['translation']['use_source']
= 'remote_and_local';
18. Translations that override the others
Export with
potx module
Import
translations
Add file
to Git
Make
po file
19. Translations that override the others
Developer
• Create translation file:
../translations/custom-translations.{langcode}.po
• Import translation to verify: drush locale (drush 9.5+):
drush locale:import nl
../translations/custom-translations.nl.po
--type=customized --override=all
• Add translations to Git:
git add translations/custom-translations.*
20. Translations that override the others
Stage
Import custom translations from file to override other
translations (drush 9.5+):
drush locale:import nl
../translations/custom-translations.nl.po
--type=customized --override=all
22. If you don't want to store translations in git
• Use https://github.com/drupal-composer/drupal-l10n
• Use local source in dev (do not override in settings.php)
23. How to deploy Drupal interface translations
https://medium.com/limoengroen/how-to-deploy-dr
upal-interface-translations-5653294c4af6
24. Image attributions
• DrupalJam 2008 by Bert Boerland; CC by-nc-sa 2.0
• DrupalJam 2010 by Boris Doesborg; CC by-nc-sa 2.0
• DrupalJam 2011 by Gerard Mourits; CC by 2.0
• DrupalJam 2014 by Daniël Smidt; CC by-nc-sa 2.0