Drupal 8: Reimport all translation files
Reimporting all project translation files in Drupal 8 can't be done with a simple click or command. Use the following steps to get it done. Note that all customized translations in your project will not get updated because they are already manually overridden.
The blog post assumes you know how to use SQL queries and Drush commands.
Execute the following query on your Drupal database in order to delete the current translation status of each project (they will get regenerated):
Reset the locale_file timestamp and last checked date for all projects:
Reset the general locale last checked date:
Rebuild Drupal cache:
Check and update all project translations:
All projects should be updated now.
In case you want no customized translations (translations added via the Drupal UI Translate Interface), you can reset them before executing the previous commands:
The blog post assumes you know how to use SQL queries and Drush commands.
Execute the following query on your Drupal database in order to delete the current translation status of each project (they will get regenerated):
DELETE FROM key_value WHERE collection='locale.translation_status';
Reset the locale_file timestamp and last checked date for all projects:
UPDATE locale_file SET timestamp = 0; UPDATE locale_file SET last_checked = 0;
Reset the general locale last checked date:
drush ev "\Drupal::state()->set('locale.translation_last_checked', 0);"
Rebuild Drupal cache:
drush cr
Check and update all project translations:
drush locale-check && drush locale-update && drush cr
All projects should be updated now.
In case you want no customized translations (translations added via the Drupal UI Translate Interface), you can reset them before executing the previous commands:
UPDATE locales_target SET customized = 0;This makes sure every translation gets updated during an import.
Comments
Add new comment