Problem/Motivation
After enabling English (not translatable) in a working site, I get daily a lot of messages: Translation file not found.
Steps to reproduce
- Create a new Drupal site and install it with Dutch (or any language).
- No other languages are enabled.
- After setting up the site with some additional modules and using it for some time.
- Enable English as extra language.
- Make sure translate_english is set to false in locale.settings.yml
At every cron run, you will now get lots of messages: Translation file not found. And all appears to be for English translations like: Translation file not found: https://ftp.drupal.org/files/translations/all/token/token-8.x-1.9.en.po.
These will appear daily even when the 'Check for updates' setting is: weekly.
Proposed resolution
* Do not request for translation files when for langcode en and when the remote uri is build with default server pattern.
Remaining tasks
Fix the problem- DONEWrite a test - NEEDS to be done
User interface changes
None.
Introduced terminology
None.
API changes
None.
Data model changes
None.
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3218674
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:
- 3218674-drupal-install-throwing
changes, plain diff MR !12001
- 11.x
changes, plain diff MR !9903
Comments
Comment #3
cilefen commentedThis looks like a misplaced bug report.
Comment #4
anybodyHi, I guess this is the correct issue: #2879998: Localization update feature logs 404 errors too aggressively or perhaps in your case #3022876: Core localization file download URL is wrong
Closing this as duplicate.
Comment #5
tobiasbThis not a duplicated issue. l.d.o does not provide english translation. therefore drupal should not check for english translation.
Comment #6
rootworkAdding novice tag; task is to take comment #5 and incorporate it into the issue summary (and potentially update issue title as well).
Comment #8
jordan.jamous commentedComment #9
jordan.jamous commentedPatch
Comment #12
rcodinaPatch on #9 cleanly applies on 10.1.x. I've just launched tests against that branch.
Comment #13
johnzzonI encountered this on a project, where English was an installed but not default language.
This patch seems to clean up the log when installing from existing config. Thanks!
Comment #14
sorson commentedChanging
$languages = \Drupal::languageManager()->getLanguages();to$languages = locale_translatable_language_list();in /core/includes/install.core.inc didn't solve my problem. Still getting errors like "Admin Toolbar (3.3.0). File not found at https://ftp.drupal.org/files/translations/all/admin_toolbar/admin_toolba..." errors for all module translations. I also got a lot of strings in a wrong other language.I have currently only English as language and "Enable interface translation to English" is true.
I really need a solution for this annoying problem. Running Drupal 9.5.7
Comment #16
karimbou commentedSame issue since Drupal 9.x
drush locale:check locale:update show errors 404 aswells as updating from backoffice.
The reason, it's trying to get en.po files which doesn't exists instead of en-GB.po files.
Comment #17
joran lafleuriel commentedThanks.... no more log entries with 'tanslation files not found'...
Comment #18
anybody@tobiasb based on your comment #5 I assume you mean that there should be a hard exclusion for "en" in code?
So Drupal skips early for cases like
https://ftp.drupal.org/files/translations/all/simple_sitemap/simple_site....en.po.
right?
Looking at the code by @jordan.jamous the solution seems totally fine!
Comment #19
anybody@jordan.jamous could you create your patch as MR?
We should also add a test which reproduces the issue (simply checks the log entry for that case) to ensure it's broken without and working with the patch. The steps can be seen above, I think it's jus the case if English is enabled, but not the standard language?
Comment #20
promesI have this problem in two sites, both have only English and Dutch installed and enabled. Site 1: Dutch as default, site 2: English is default.
Comment #23
ressaI am seeing a lot of English translation file not found errors for all contrib modules (for example
https://ftp.drupal.org/files/translations/all/metatag/metatag-2.0.2.en.po.) at every Cron run, in a site where the default language is not English, and it's filling up the database log.Since this might be affecting all installations using any other language than English (which is a lot) I think that this is not a small issue, so raising Priority.
I have created an MR based on the patch by @jordan.jamous (thanks!) to hopefully get this issue moving. Perhaps someone can create a test?
Comment #24
anybodyTotally agree with @ressa and can confirm it does ;)
Comment #25
ressaWouldn't it be great to get this annoying issue fixed? It makes the log files both useless and balloon ...
It would be nice if someone could check if the current MR actually works (it didn't work for me) as well as create a test. Thanks!
Comment #26
ressaThe logs are still getting filled up by this ... we must be talking about gigabytes, if not terabytes of wasted HDD space on a global basis :)
Comment #27
jonabhI have the same issue, any progress on this?
(working with drupal 10.4.6)
any why system is looking for translation file at drupal.org and not locally?
Comment #30
tobiasbWe need to find the place where drupal tries to fetch the translation from l.d.o, so that we ca avoid the step.
The installer needs all languages for InstallerTranslationMultipleLanguageKeepEnglishTest.
And I believe we
locale_translation_batch_status_check()is right place to start.Comment #31
tobiasbSeems to work fine. It still try to find a translation for en (see screenshot), but not for remote, when the remote uri is build with default server pattern. (ftp.drupal.org)
Comment #32
ressaThanks @tobiasb, is the MR ready for review? Because the status is "Needs work", so could be missed by people ...
Comment #33
tobiasb@ressa
The issue is tagged with "Needs tests", which needs to be done.
Comment #34
ressaGreat, I have added "Write a test" under "Remaining tasks" in the Issue Summary, to make it clearer, what still needs to be done.
Comment #36
grevil commentedAdded kernel tests. Ready to review!
Comment #37
grimreaperHello,
Thanks for the MR, I have the problem with https://www.drupal.org/project/sobki_profile_bootstrap
Before:
After:
So only remaining warnings are not for "en". And except FR for Core, I think remaining warnings are for modules currently without translation files. I have not checked as this issue is for "en".
Comment #38
anybodyThanks @grimreaper for the confirmation, so let's hope this can be merged soon. Our logs have been flooded for years with this now ...
Comment #39
ressaThanks for the review @grimreaper :)
Comment #40
tobiasbComment #41
quietone commentedI think the title doesn't need to state that 'Drupal' is doing something.
Comment #42
catchCommitted/pushed to 11.x and cherry-picked to 11.3.x, thanks!
Comment #48
ressaThanks! Since this is a pain point for many multilingual installations, and could be a reason to upgrade from Drupal 10 to Drupal 11, and help speed up that process, it could be included in 11.3.0 release highlights?