Drupal install throwing "Translation file not found" notice for "en" langcode when "translate_english" is set to false

Created on 14 June 2021, over 3 years ago
Updated 28 March 2023, almost 2 years ago

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 D9.4.x site and install it with Dutch (or any lanuage).
  • 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

in install.core.inc, fetch translatable languages only instead of all languages.

🐛 Bug report
Status

Needs work

Version

10.1

Component
Language system 

Last updated about 20 hours ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇳🇱Netherlands promes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands sorson

    Changing $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

  • 🇫🇷France karimbou

    Same 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.

  • 🇫🇷France ratjaune

    Thanks.... no more log entries with 'tanslation files not found'...

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7 updated deps
    last update over 1 year ago
    30,340 pass, 1 fail
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MariaDB 10.3.22
    34:27
    28:19
    Running
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    30,340 pass, 1 fail
  • 🇩🇪Germany Anybody Porta Westfalica

    @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?

  • 🇩🇪Germany Anybody Porta Westfalica

    @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?

  • 🇳🇱Netherlands promes

    I 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.

  • First commit to issue fork.
  • Pipeline finished with Failed
    5 months ago
    Total: 480s
    #316975
  • 🇩🇰Denmark ressa Copenhagen

    I 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?

  • 🇩🇪Germany Anybody Porta Westfalica

    Totally agree with @ressa and can confirm it does ;)

  • 🇩🇰Denmark ressa Copenhagen

    Wouldn't it be great to fix this annoying issue? 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 a create a test. Thanks!

Production build 0.71.5 2024