Problem/Motivation

If you are using an install profile to customize the installation experience, you'd better be using only strings that core itself uses, because your custom strings will never be translated.

This is because the early installer only ever downloads and reads translations for core. If there's a custom profile in play, its strings are completely ignored.

Drupal CMS runs into this because it uses a custom install profile, and it has to do some very dubious workarounds in order to get its translations loaded in the early installer. This is clearly a bug, because the installer supports custom profiles, and translation, but this scenario falls through the cracks.

Proposed resolution

install_download_translation() needs to download the profile's translations too! Additionally, \Drupal\Core\StringTranslation\Translator\FileTranslation needs to read translations not just for core, but also for the profile.

Release notes snippet

TBD

Issue fork drupal-3605554

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Issue summary: View changes
gábor hojtsy’s picture

I think this makes a ton of sense. Drupal CMS still still need to custom-download the .po file for the site template recipe chosen so its a shift in how the same code will be used in the CMS installer, but core could still do the profile already, it would make slightly less custom code in the CMS installer :)

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Status: Active » Needs review

This was going to be way too hard to test functionally, so I did it as a reasonably high-level kernel test which confirms that translations are downloaded for custom profiles, but not core profiles.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.77 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

phenaproxima’s picture

Status: Needs work » Needs review

As far as I can tell (and I added more test coverage to confirm this), the version is passed through unaltered.

gábor hojtsy’s picture

Status: Needs review » Needs work

#3594389: Remove unecessary core dev version replacement in locale project info just landed. so much for dealing with the -dev suffix. Sorry, I was not aware that it works without that removed.

phenaproxima’s picture

Status: Needs work » Needs review

That simplifies things :) Removed the -dev special-casing.

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Yay, now this looks all good to me :)

quietone’s picture

Title: If using a custom profile, its translations are never loaded or downloaded » Translations are never loaded or downloaded for a custom profile