backdrop-issues icon indicating copy to clipboard operation
backdrop-issues copied to clipboard

Untranslated strings in update.php

Open robertgarrigos opened this issue 4 months ago • 11 comments

Description of the bug

There are some strings in update.php that are not translated.

Additional information

Add any other information that could help, such as:

  • Backdrop CMS version: 1.32.0

I will propose a PR

robertgarrigos avatar Sep 16 '25 16:09 robertgarrigos

A PR is ready for reviewing. There is one check failed, but I believe it's not a matter of the code but of the check itself.

robertgarrigos avatar Sep 16 '25 16:09 robertgarrigos

Even in Drupal 7, none of the strings used in the updated.php file is translated, despite drupal_language_initialize() is called.

avpaderno avatar Sep 16 '25 21:09 avpaderno

That's not true in backdrop. Some of the strings ARE translated, but not all of them. This PR fixes it.

robertgarrigos avatar Sep 17 '25 14:09 robertgarrigos

The code looks good to me, except for the first change (the PHP version check) which results in a fatal error. I haven't fully tested but I suspect the rest of the changes are safe.

herbdool avatar Sep 17 '25 15:09 herbdool

I meant that not even the code in the Drupal 7's update.php file uses t() for the strings shown in the update page. I am not sure whether the translation of those strings is expected not to work, nor if that applies to Backdrop too.

avpaderno avatar Sep 18 '25 22:09 avpaderno

@avpaderno, backdrop already uses t() to translate some of the strings in update.php. I'm just adding the rest of them.

robertgarrigos avatar Sep 20 '25 11:09 robertgarrigos

Thanks, @herbdool, I'll check that fatal error.

robertgarrigos avatar Sep 20 '25 11:09 robertgarrigos

@herbdool, left that line without t() function to avoid the fatal error.

robertgarrigos avatar Sep 20 '25 16:09 robertgarrigos

There are still lines without translatable strings, for example line 503 and 505.

    backdrop_set_title('Requirements problem');
    $task_list = update_task_list('requirements');
    $status_report = 'Resolve the problems and <a href="' . check_url(backdrop_requirements_url($severity)) . '">try again</a>.';
    $status_report .= '<br><br>';

avpaderno avatar Sep 21 '25 11:09 avpaderno

thanks @avpaderno just added those lines also to the commit

robertgarrigos avatar Sep 22 '25 19:09 robertgarrigos

Some code comments in the PR.

bugfolder avatar Dec 30 '25 03:12 bugfolder

Added @bugfolder's suggestions to PR

robertgarrigos avatar Jan 08 '26 07:01 robertgarrigos

Looks mostly good, some tweaks to indentation suggested to make PHPCS happier.

bugfolder avatar Jan 08 '26 14:01 bugfolder

Commited

robertgarrigos avatar Jan 08 '26 21:01 robertgarrigos

There's one uncommitted suggestion: https://github.com/robertgarrigos/backdrop/pull/9/files#r2672588650

bugfolder avatar Jan 08 '26 21:01 bugfolder

Done. Thanks.

robertgarrigos avatar Jan 09 '26 06:01 robertgarrigos

Code LGTM!

There's only one failing test, and it appears unrelated to this PR. This is RTBC.

bugfolder avatar Jan 09 '26 14:01 bugfolder