Problem/Motivation

On Drupal status report page, in other languages than English, the string “Translation update status” is not translated.

Proposed resolution

- Locate the untranslated strings.
- Check for other untranslatable strings in installation code.
- Wrap the strings in t() to allow translation.

Remaining tasks

Write tests

User interface changes

“Translation update status” shown translated.

API changes

None

Data model changes

None

Original report by rkoller

While translating i ran into an issue on the status report page. I've set my search scope to Drupal core and the latest version. On the status report page a few strings are still shown in english. normally i copy and past the particular string and look it up in the translation interface. but in that particular case i had no luck:

https://localize.drupal.org/translate/languages/de/translate?project=dru...

but when i removed the project the string was found and it is listed as translated even

https://localize.drupal.org/translate/languages/de/translate?project&sta...

I asked in the #random channel how drupal behaves in other languages. @ulfg replied and confirmed that it is the same with the swedish localization. so it isnt a german only issue but more of a general one? I havent investigated further if that issue applies to more strings. ah and screenshots are appended for both languages. hope that helps. cheers r.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rkoller created an issue. See original summary.

rkoller’s picture

Title: Translated string isn't shown on status report page probably to a faulty project dependency » A translated string isn't shown on the status report page probably due to a faulty project assignment
Gábor Hojtsy’s picture

Status: Active » Postponed (maintainer needs more info)

Right so related projects are:

Drupal core: 8.0-alpha2 (4), 8.0-alpha3 (4), 8.0-alpha4 (4), 8.0-alpha8 (4), 8.0-alpha7 (4), 8.0-alpha6 (4), 8.0-alpha5 (4), 8.0-alpha9 (4), 8.0-alpha10 (4), 8.0-alpha11 (4), 8.0-alpha12 (4), 8.0-alpha13 (4), 8.0.0-alpha14 (4), 8.0.0-alpha15 (4), 8.0.0-beta1 (4), 8.0.0-beta2 (4), 8.0.0-beta3 (4), 8.0.0-beta4 (4), 8.0.0-beta6 (4), 8.0.0-beta7 (4), 8.0.0-beta9 (4), 8.0.0-beta10 (4), 8.0.0-beta11 (4), 8.0.0-beta12 (4), 8.0.0-beta13 (4), 8.0.0-beta14 (4), 8.0.0-beta15 (4), 8.0.0-beta16 (4), 8.0.0-rc1 (4), 8.0.0-rc2 (4)

Which version of Drupal are you using?

rkoller’s picture

I am using the latest regular version 8.2.5 (german) . But what @ulfg was using when testing i don't know. I've asked on slack, but he is offline right now or away.

Gábor Hojtsy’s picture

Title: A translated string isn't shown on the status report page probably due to a faulty project assignment » "Translation update status" in locale.install is not translated
Project: localize.drupal.org » Drupal core
Version: 7.x-1.x-dev » 8.4.x-dev
Component: Existing language complaint » locale.module
Status: Postponed (maintainer needs more info) » Active

Ok I did this:

$ git grep "Translation update status"
core/modules/locale/locale.install:              'title' => 'Translation update status',
core/modules/locale/locale.install:              'title' => 'Translation update status',
core/modules/locale/locale.install:            'title' => 'Translation update status',
core/modules/locale/locale.install:          'title' => 'Translation update status',
core/modules/locale/src/Form/TranslationStatusForm.php:   *   Translation update status as an array keyed by Project ID and langcode.
core/modules/locale/src/Form/TranslationStatusForm.php:   *   Translation update status as an array keyed by language code and
core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php:    $this->assertNoText(t('Translation update status'), 'No status message');
core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php:    $this->assertText(t('Translation update status'), 'Status message');
core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php:    $this->assertText(t('Translation update status'), 'Status message');
core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php:    $this->assertText(t('Translation update status'), 'Status message');

So as you can see only tests include this string wrapped in translation markers. Tests are not parsed for strings to avoid them littering what translators need to work on for useful translations :) If you look at locale.install, this looks like a core bug several times over:

          else {
            $requirements['locale_translation'] = array(
              'title' => 'Translation update status',
              'value' => t('Missing translations'),
              'severity' => REQUIREMENT_INFO,
              'description' => t('Missing translations for: @languages. See the <a href=":updates">Available translation updates</a> page for more information.', array('@languages' => implode(', ', $untranslated), ':updates' => \Drupal::url('locale.translate_status'))),
            );
          }
        }
        else {
          $requirements['locale_translation'] = array(
            'title' => 'Translation update status',
            'value' => t('Up to date'),
            'severity' => REQUIREMENT_OK,
          );
        }
      }
      else {
        $requirements['locale_translation'] = array(
          'title' => 'Translation update status',
          'value' => \Drupal::l(t('Can not determine status'), new Url('locale.translate_status')),
          'severity' => REQUIREMENT_WARNING,
          'description' => t('No translation status is available. See the <a href=":updates">Available translation updates</a> page for more information.', array(':updates' => \Drupal::url('locale.translate_status'))),
        );
      }

Also more than those 3 cases are in the file :)

rkoller’s picture

Oh cool, thanks for the explanation! I have to wrap my head around it a bit more to completely understand it. Still a little bit ahead of my deeper Drupal knowledge, still at the beginning. ;) But i will investigate that pattern a little bit further in the next days. I have the suspicion that it isn't the only occasion of that pattern. Happened with a few more strings but there i was unable to build a solid proof like the one i've shown; i only had a gut feeling something is off. so i suppose and fear there might be more :/ will keep you posted. in case i discover more of those shall i post it within that issue as well?

Gábor Hojtsy’s picture

If those strings have the same root case yes, otherwise no.

cilefen’s picture

This issue is ironic.

UlfG’s picture

We are also currently at version 8.2.5. (@ulfg on slack)

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Sutharsan’s picture

Issue summary: View changes
Issue tags: +Novice
snehi’s picture

Assigned: Unassigned » snehi
FileSize
2.44 KB

Created an initial patch. Please review it.

snehi’s picture

Status: Active » Needs review
Sutharsan’s picture

Issue summary: View changes
FileSize
27.32 KB

Patch looks good, thanks for the work. The title is now translated (see screenshot).

I've checked that all interface texts "Translation update status" are now wrapped in t(). All occurrences of 'title' => in locale.install now use t().

The "Translation update status" string is covered in the test script, but the tests uses English interface language (see LocaleUpdateInterfaceTest). Not sure if we need additional test coverage to prove that the string actually is translated.

Berdir’s picture

Assigned: snehi » Unassigned
Status: Needs review » Reviewed & tested by the community

We can't have test coverage of every single translatable string, while I can see us adding test coverage for complex cases, this is a pretty trivial oversight, so I'd say RTBC :)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 12: 2848085-12.patch, failed testing. View results

snehi’s picture

Status: Needs work » Reviewed & tested by the community

Setting back to RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 12: 2848085-12.patch, failed testing. View results

Anonymous’s picture

Status: Needs work » Reviewed & tested by the community

Revert status after DrupalCI failure.

larowlan’s picture

Status: Reviewed & tested by the community » Fixed

crediting @Gabor Hojtsy for research/mentoring/guidance on how to resolve this.

  • larowlan committed 412c756 on 8.5.x
    Issue #2848085 by snehi, rkoller, Sutharsan, Gábor Hojtsy: "Translation...
larowlan’s picture

Committed as 412c756 and pushed to 8.5.x - thanks

Status: Fixed » Closed (fixed)

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