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 - DONE
  • Write a test - NEEDS to be done

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

Issue fork drupal-3218674

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

PROMES created an issue. See original summary.

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

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should 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.

cilefen’s picture

Category: Support request » Bug report

This looks like a misplaced bug report.

anybody’s picture

Status: Active » Closed (duplicate)

Hi, 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.

tobiasb’s picture

Version: 9.3.x-dev » 9.4.x-dev
Status: Closed (duplicate) » Active

This not a duplicated issue. l.d.o does not provide english translation. therefore drupal should not check for english translation.

rootwork’s picture

Adding novice tag; task is to take comment #5 and incorporate it into the issue summary (and potentially update issue title as well).

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.

jordan.jamous’s picture

Title: Translation file not found for English » Drupal install throwing "Translation file not found" notice for "en" langcode when "translate_english" is set to false
Issue summary: View changes
Issue tags: -Novice, -Needs issue summary update
jordan.jamous’s picture

Status: Active » Needs review
StatusFileSize
new685 bytes

Patch

Status: Needs review » Needs work

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.

rcodina’s picture

Patch on #9 cleanly applies on 10.1.x. I've just launched tests against that branch.

johnzzon’s picture

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

sorson’s picture

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

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.

karimbou’s picture

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.

joran lafleuriel’s picture

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

anybody’s picture

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

anybody’s picture

Issue tags: +Needs tests

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

promes’s picture

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.

ressa made their first commit to this issue’s fork.

ressa’s picture

Priority: Normal » Major
Issue tags: -Portland2022

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?

anybody’s picture

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

ressa’s picture

Wouldn'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!

ressa’s picture

The 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 :)

jonabh’s picture

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

tobiasb changed the visibility of the branch 11.x to hidden.

tobiasb’s picture

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

tobiasb’s picture

Issue summary: View changes
StatusFileSize
new245.94 KB

Seems 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)

ressa’s picture

Thanks @tobiasb, is the MR ready for review? Because the status is "Needs work", so could be missed by people ...

tobiasb’s picture

@ressa

The issue is tagged with "Needs tests", which needs to be done.

ressa’s picture

Issue summary: View changes

Great, I have added "Write a test" under "Remaining tasks" in the Issue Summary, to make it clearer, what still needs to be done.

grevil made their first commit to this issue’s fork.

grevil’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests

Added kernel tests. Ready to review!

grimreaper’s picture

Status: Needs review » Reviewed & tested by the community

Hello,

Thanks for the MR, I have the problem with https://www.drupal.org/project/sobki_profile_bootstrap

Before:

...
[notice] Performed install task: sobki_profile_bootstrap_set_front_page
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/address/address-2.0.4.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/ai/ai-1.1.2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/ai_provider_azure/ai_provider_azure-1.1.0-beta2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/animated_gif/animated_gif-2.1.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/antibot/antibot-2.0.4.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/cache_control_override/cache_control_override-2.0.1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/clientside_validation/clientside_validation-4.1.2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/cqri/cqri-1.0.0-alpha2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/ctools/ctools-4.1.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/dashboard/dashboard-2.0.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/default_content/default_content-2.0.0-alpha3.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/11.x/drupal/drupal-11.2.2.fr.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/drupal/drupal-11.2.2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/editor_advanced_link/editor_advanced_link-2.3.1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/entity_reference_revisions/entity_reference_revisions-8.x-1.12.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/entity_vdts/entity_vdts-1.0.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/extlink/extlink-2.0.4.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/fences/fences-3.0.7.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/field_formatter/field_formatter-3.0.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/field_group/field_group-4.0.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/field_tools/field_tools-8.x-1.0-alpha13.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/geocoder/geocoder-8.x-4.29.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/geofield/geofield-8.x-1.64.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/geofield_map/geofield_map-11.0.5.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/gin/gin-5.0.3.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/gin_login/gin_login-2.1.3.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/health_check/health_check-3.1.0.fr.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/health_check/health_check-3.1.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/inline_entity_form/inline_entity_form-3.0.0-rc21.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/key/key-8.x-1.20.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/language_switcher_extended/language_switcher_extended-8.x-1.2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/layout_builder_at/layout_builder_at-3.0.1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/layout_builder_browser/layout_builder_browser-8.x-1.8.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/layout_builder_operation_link/layout_builder_operation_link-2.2.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/layout_builder_reorder/layout_builder_reorder-2.0.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/layout_builder_restrictions/layout_builder_restrictions-3.0.4.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/layout_builder_restrictions_by_role/layout_builder_restrictions_by_role-1.0.0-rc1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/leaflet/leaflet-10.3.7.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/link_attributes/link_attributes-2.1.1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/linked_field/linked_field-8.x-1.7.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/linkit/linkit-7.0.7.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/media_entity_download/media_entity_download-8.x-2.4.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/media_entity_link/media_entity_link-2.0.5.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/media_library_edit/media_library_edit-3.0.4.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/media_library_form_element/media_library_form_element-2.1.2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/media_thumbnails/media_thumbnails-2.0.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/menu_admin_per_menu/menu_admin_per_menu-8.x-1.7.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/menu_block/menu_block-8.x-1.14.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/menu_link_attributes/menu_link_attributes-8.x-1.5.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/menu_manipulator/menu_manipulator-4.0.0.fr.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/menu_manipulator/menu_manipulator-4.0.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/menu_trail_by_path/menu_trail_by_path-2.2.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/metatag/metatag-2.1.1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/metatag_async_widget/metatag_async_widget-1.2.3.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/navigation_extra_tools/navigation_extra_tools-1.2.1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/paragraph_view_mode/paragraph_view_mode-3.2.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/paragraphs/paragraphs-8.x-1.19.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/paragraphs_viewmode/paragraphs_viewmode-8.x-1.2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/pathauto/pathauto-8.x-1.13.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/redirect/redirect-8.x-1.11.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/responsive_preview/responsive_preview-2.2.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/robotstxt/robotstxt-8.x-1.6.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/role_delegation/role_delegation-8.x-1.4.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/scheduler/scheduler-2.2.1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/scheduler_content_moderation_integration/scheduler_content_moderation_integration-3.0.4.fr.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/scheduler_content_moderation_integration/scheduler_content_moderation_integration-3.0.4.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/section_library/section_library-2.0.1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/simple_megamenu/simple_megamenu-2.2.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/simple_sitemap/simple_sitemap-4.2.2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/sitemap/sitemap-8.x-2.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/sobki_theme_admin/sobki_theme_admin-1.0.1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/svg_image/svg_image-3.2.1.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/system_stream_wrapper/system_stream_wrapper-2.1.0.fr.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/system_stream_wrapper/system_stream_wrapper-2.1.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/tablefield/tablefield-3.0.0.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/token/token-8.x-1.15.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/translatable_menu_link_uri/translatable_menu_link_uri-2.1.3.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/ui_examples/ui_examples-1.0.2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/ui_icons/ui_icons-1.1.0-beta6.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/ui_patterns/ui_patterns-2.0.4.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/ui_skins/ui_skins-1.1.0-alpha3.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/ui_styles/ui_styles-8.x-1.16.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/ui_suite_bootstrap/ui_suite_bootstrap-5.2.0-beta2.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/views_custom_cache_tag/views_custom_cache_tag-8.x-1.4.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/webform/webform-6.3.0-beta3.en.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/yoast_seo/yoast_seo-8.x-2.2.en.po.
 [notice] Translations imported: 5351 added, 1982 updated, 0 removed.
 [notice] The configuration was successfully updated. 400 configuration objects updated.
 [notice] Performed install task: install_finish_translations
...

After:

...
[notice] Performed install task: sobki_profile_bootstrap_set_front_page
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/11.x/drupal/drupal-11.2.2.fr.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/health_check/health_check-3.1.0.fr.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/menu_manipulator/menu_manipulator-4.0.0.fr.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/scheduler_content_moderation_integration/scheduler_content_moderation_integration-3.0.4.fr.po.
 [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/system_stream_wrapper/system_stream_wrapper-2.1.0.fr.po.
 [notice] Translations imported: 5351 added, 1982 updated, 0 removed.
 [notice] The configuration was successfully updated. 400 configuration objects updated.
 [notice] Performed install task: install_finish_translations
...

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

anybody’s picture

Thanks @grimreaper for the confirmation, so let's hope this can be merged soon. Our logs have been flooded for years with this now ...

ressa’s picture

Thanks for the review @grimreaper :)

tobiasb’s picture

Issue summary: View changes
quietone’s picture

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

I think the title doesn't need to state that 'Drupal' is doing something.

catch’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • catch committed 76737efb on 11.3.x
    Issue #3218674 by promes, anybody, tobiasb, ressa, jordan.jamous, grevil...

  • catch committed 84b3f93f on 11.x
    Issue #3218674 by promes, anybody, tobiasb, ressa, jordan.jamous, grevil...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ressa’s picture

Thanks! 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?