To support deployment of interface translations we need some method to transfer custom translations between different sites. Interface strings which are customized (either with the build-in translation interface or by importing a translation file) are identified as customized with a flag in the database. These strings should be mad available to share them between sites. The current tools are the manual po file export and import functions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

We can also introduce a file name pattern where the strings are imported as custom (vs. as files sourced from l.d.o for specific projects). I'd love to not have two formats supported in the interface translation code, and .po files are the de facto standard formats (not .yml files) for translation distribution. The localization update system in itself has this deployment task where the files need to be copied over to the live server, not just for custom strings. (I assume after a QA on the staging site, a serious website would not let the live site download .po files from l.d.o because they might be different from the ones QAed). The single directory .po file sourcing was introduced to ease staging and deployment and we should be able to tie custom strings into this with .po files as well I strongly believe.

Sutharsan’s picture

Title: Store custom translations in yml files » Make customized translations deployable

Using po files for the file format prevents that we have to solve problems with plural formula's, plurals and very long strings. And makes it easy to re-use existing import/export code. And storing the customized translations in a po file together with the downloaded po files, would not introduce a different deployment mechanism. I agree that the preferred staging procedure would be to download from l.d.o on a development/test site. Migrate it with a VCS to the acceptance site and then with VCS to production. Acceptance and production import the translations only once (per release) and don't use the automated download or import. Translation deployment now only requires an export and import mechanism for customized translations.

Changing the title bacause a yml file format is not the purpose, but deployability is the purpose of this issue

Gábor Hojtsy’s picture

Category: feature » task
Issue tags: +D8MI

I think this is better categorized as a missing integration piece (task or bug). Sounds like it would be a little modification to the preg pattern on filenames and documenting the feature. As-in it can be done after dec 1st.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

geek-merlin’s picture

Issue summary: View changes

I've rolled this in contrib here:
https://www.drupal.org/project/customtranslations

It's a quite trivial approach so i'd be happy if we can mimic this in core and obsolete the module.

geek-merlin’s picture

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

esolitos’s picture

Yet another feature that would make D8 more multilingual-friendly.

/u/axelrutz: Are you planning to create a patch?

geek-merlin’s picture

> /u/axelrutz: Are you planning to create a patch?

Currently i don't see any bandwidth for it...

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

geek-merlin’s picture

The module mentioned in #7 is deprecated in favor of Drush Language Commands. We can steal code there.

davidferlay’s picture

FileSize
9.94 KB
32.76 KB

Hi here !

I made some tests on my end and it seems to me that core Drush has already all of the things we need (although i faced something strange in my tests):

  • drush locale:import fr $(pwd)/web/profiles/sdd/fr_custom.po --type=customized --override=all

So I don't see any use case for https://www.drupal.org/project/drush_language )

import

davidferlay’s picture

Version: 8.6.x-dev » 8.7.6
Category: Task » Feature request
Issue tags: +drush, +translation, +import
davidferlay’s picture

Status: Active » Needs work
geek-merlin’s picture

Version: 8.7.6 » 8.9.x-dev
Related issues: +#2631584: Provide a proper API for updating translations

Where ever such a tool lives, it will be much simpler and more maintainable if #2631584: Provide a proper API for updating translations lands. There's already a patch to review there, so any help there will help here too.

davidferlay’s picture

FileSize
88.32 KB

FYI I updated my comment #15)

geek-merlin’s picture

As a maintainer of drush_language, i'm happy to collaborate to get this into drush and some day into core's console component. (And deprecate drush_language)

In #15, you tested drush locale:import. Do we have something like drush locale:export --only-custom too?

Also i'd say we need an equivalent of drush_language's locale-export-alland locale-import-all, which iterates over all language files in a directory.

andypost’s picture

Status: Needs work » Active

proper status cos there's no patches yet

andypost’s picture

davidferlay’s picture

Hi geek.merlin aka axel.rutz !

In #15, you tested drush locale:import. Do we have something like drush locale:export --only-custom too?

Yes indeed, the actual command we use in our workflow is drush locale:import fr /var/www/html/translations/fr.po --type=customized --override=all (as you can see here) which worked just fine in my tests

Also i'd say we need an equivalent of drush_language's locale-export-alland locale-import-all, which iterates over all language files in a directory.

I couldn't agree more with you! In my opinion, importing multiple files at once is the main missing puzzle piece we could implement in drush and looks like we could start from code of drush_language.

Exporting command would be the ice on the cake but should have a lesser priority since it's possible via UI

Will you be going to to Amsterdam next week for DrupalCon ? If yes, I'll be there too and we can discuss it over beers

geek-merlin’s picture

@davidferlay Unfortunately no beers and other 'dam goodies for me. But glad to work together on this and might do some reviews!

davidferlay’s picture

Maybe next time then @axel.rutz)

Meanwhile I just filled this issue in Drush github repo so that we get things moving :

davidferlay’s picture

Hi there @axel.rutz,

Regards

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.