add t() in all early update requirements

Created on 25 October 2017, over 7 years ago
Updated 21 May 2025, 13 days ago

Problem/Motivation

This is a follow up to #2914292: Remove hard coded reference to node/2179269 . In that issue a link that is displayed when an update requirement isn't mean is shown with the html tags. To remove the html the string was wrapped in the t() function. That was considered out of scope so this issue is to look at all the strings that are displayed early in the update process to determine if the t() function can be safely used.

xjm explains the history in the original issue ( #13 ). It is here for convenience.
I also suspect these requirements don't have t() on purpose because they might have been used in early bootstrap when t() was not available.

The specific lines were added in #2168011: Remove all 7.x to 8.x update hooks and disallow updates from the previous major version , but they were based on lines moved from update_prepare_d8_bootstrap(), which in turn was based on update_prepare_d7_bootstrap(). Before that, they were originally added in #864464: Upgrade path broken if not run from at least Drupal 6.16 like seven years ago. And those lines were added alongside existing untranslated strings dating back to #233091: Move code from update.php into includes/update.inc . And so on. Basically, these have been untranslated as long as update.php has been around.

It could be that we can translate these strings now after all the refactoring that's happened in Drupal 8, but if so, we should discuss that in a dedicated issue and add t() in all the places that they're missing in early update requirements, rather than just adding one offhand here. So tagging "Needs followup" to file such an issue.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

Not showing html tags

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

database update system

Created by

🇳🇿New Zealand quietone

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

Comments & Activities

Not all content is available!

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

  • 🇺🇸United States dww

    Triaging the update.module component. This issue is about core/includes/update.inc, which the @file comment says is "Drupal database update API." Moving to a more appropriate component.

    Also, tagging as a bug to be smashed.

    Confirmed that this file still includes untranslated UI text. I'm not immediately sure if when these methods are running if "enough" Drupal is bootstrapped to be able to negotiate an appropriate language and translate anything. I suspect not.

    Perhaps the better task here is to "Add comments to update.inc to explain why t() is not used in early requirements checks" or something. 😅

  • 🇺🇸United States dww

    p.s. It looks like only update_system_schema_requirements() includes the untranslated UI text. There are other usages of t() in this file (e.g. in _update_fix_missing_schema()).

Production build 0.71.5 2024