while installing d7 in dutch i found a string that is not in a t function:

in includes/database/mysql/install.inc

'MySQL, MariaDB, or equivalent'

Comments

bojanz’s picture

Status: Needs work » Needs review
batigolix’s picture

Issue tags: -install, -dashboard
StatusFileSize
new466 bytes

DONT USE PATCH BELOW

batigolix’s picture

Issue tags: +install, +dashboard
batigolix’s picture

Issue tags: +install, +dashboard
StatusFileSize
new1.74 KB

new patch for dashboard module

batigolix’s picture

Issue tags: +l10n
StatusFileSize
new4.28 KB

another patch for missing t in install script

Status: Needs review » Needs work

The last submitted patch, install-missing-t-201010191431.patch, failed testing.

David_Rothstein’s picture

Title: String not in t function » Fix the use of translated strings in the installer DatabaseTasks class
Version: 7.0-beta1 » 7.x-dev

Thanks! It looks like we do indeed need to clean up the way this part of the code uses translations. However, most of the strings in this patch are already translated elsewhere, via the calling code:

  /**
   * Run SQL tests to ensure the database can execute commands with the current user.
   */
  protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) {
    try {
      db_query($query);
      $this->pass(st($pass));
    }
    catch (Exception $e) {
      $this->fail(st($fail, array('%query' => $query, '%error' => $e->getMessage(), '%name' => $this->name())));
      return !$fatal;
    }
  }

Notice how it already translates them and does proper substitution of %query, %error, etc. We don't want to translate them twice; however, the question is, with the current method, will the string extractor ever be able to pick up these strings and know they are translatable (or do we need to file another issue for that somewhere, and if so, where)?

-      $message = '<p>In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the <a href="http://drupal.org/getting-started/install">installation handbook</a>. If you are unsure what any of this means you should probably contact your hosting provider.</p>' . $message;
+      $message = t('<p>In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the <a href="http://drupal.org/getting-started/install">installation handbook</a>. If you are unsure what any of this means you should probably contact your hosting provider.</p>') . $message;

This part (the last hunk of the patch) does look to me like it needs to be translated inline. However, since this is in the installer, we need to use st(), not t(). Also, HTML such as <p> should not be in the translatable string unless it is part of the sentence. In other words, it should actually look like this:

$message = '<p>' . st('......') . '</p>' . $message;
SebCorbin’s picture

StatusFileSize
new552 bytes

Why not use this patch ? These strings are still untranslated for now...

David_Rothstein’s picture

@SebCorbin, the patch you posted is for the dashboard module and isn't related to this issue.

Could you post it as a separate issue under the "dashboard.module" component instead? (I think it makes sense, but translation of region names is actually tricky.) When you create the new issue, you can feel free to link to it here so interested people can follow up on it. Thanks!

David_Rothstein’s picture

@SebCorbin posted that patch at #1049658: Dashboard region strings are untranslated where it is now being discussed. (Thanks!)

To clarify, it seems there have been several patches posted in this issue for the dashboard module (I didn't realize that wasn't the first one), for reasons I don't really understand :) This issue started out being about translations in the database installation code, and that's what the previous most recent patch in #5 was about, so let's continue reviewing and working on that one.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.