Problem/Motivation

When language and interface translation are enabled, then administrators can include the site language as a language for which interface strings can be translated.
This allows site builders to override default UI text such as "Add new comment" by a different string in the same language.
This is not included in the hook_help text, but should be.

Proposed resolution

Add this functionality to the hook_help text of the interface translation and/or language modules.

Remaining tasks

Update the hook_help text.

User interface changes

This is a UI text change.

API changes

None.

Data model changes

None.

Comments

ifrik created an issue. See original summary.

duaelfr’s picture

Issue tags: +Novice
ifrik’s picture

Category: Bug report » Task
ndobromirov’s picture

Hi all,

I will be working on this today and hopefully there will be a patch :).

BR.

ndobromirov’s picture

Status: Active » Needs review
StatusFileSize
new1.85 KB

Hi all, here is the promised patch :)

dubois’s picture

Assigned: Unassigned » dubois

Nevermind. I should have refreshed.

lachezar.valchev’s picture

Hi,

I am getting this into review :)

Regards,
Lachezar

dubois’s picture

Applies cleanly but looking at some language tweaks. Will upload patch ASAP.

lachezar.valchev’s picture

Status: Needs review » Needs work

Hi,

So, the patch applies nicely, but I think we need to add additional sentence with link to the language edit form where you actually enable the functionality. Currently the text in the patch link only to the translations interface, but it could be confusing if you have not enable the option first.

Regards,
Lachezar

dubois’s picture

Added link & revised language.

dubois’s picture

Status: Needs work » Needs review
dubois’s picture

And another patch with insight from ndobromirov.

ndobromirov’s picture

New iteration for the text.
Added a link both to the translate interface and the languages configuration.

Note that this feature has nothing to do with default language configuration, but the convention that the strings in code are written in English. Because of this it works only for the English language.

Added a new patch :)

BR,
Nikolay Dobromirov.

lachezar.valchev’s picture

Hi,

After review: the patch applies nice, but there is a spelling mistake marked below for the word "configured".

+++ b/core/modules/locale/locale.module
@@ -158,6 +158,8 @@ function locale_help($route_name, RouteMatchInterface $route_match) {
+      $output .= '<dd>' . t('You can override the default English interface text strings that are hard-coded in the PHP files of Drupal and contributed modules from <a href=":translate">User interface translation</a> page. This is available only for the English language when it has been cofigured from <a href="!languages">Languages</a> page.', array(':translate' => \Drupal::url('locale.translate_page'), '!languages' => \Drupal::url('entity.configurable_language.collection'))) . '</dd>';

There is a spell mistake.

lachezar.valchev’s picture

Status: Needs review » Needs work

Changed the status to Needs work.

ifrik’s picture

Thanks for the patch.

Besides the typing error in "configured" there are two more changes necessary.
The placeholder !languages needs to be :languages, just like the one used in :translate.

And "Drupal" should be replaced by "your site". These help texts are also displayed for different distrubtions, so users might not be aware that they are actually using Drupal.

gábor hojtsy’s picture

  1. +++ b/core/modules/locale/locale.module
    @@ -158,6 +158,8 @@ function locale_help($route_name, RouteMatchInterface $route_match) {
    +      $output .= '<dt>' . t('Overriding default English strings comming from code') . '</dt>';
    

    coming, not comming?

  2. +++ b/core/modules/locale/locale.module
    @@ -158,6 +158,8 @@ function locale_help($route_name, RouteMatchInterface $route_match) {
    +      $output .= '<dd>' . t('You can override the default English interface text strings that are hard-coded in the PHP files of Drupal and contributed modules from <a href=":translate">User interface translation</a> page. This is available only for the English language when it has been cofigured from <a href="!languages">Languages</a> page.', array(':translate' => \Drupal::url('locale.translate_page'), '!languages' => \Drupal::url('entity.configurable_language.collection'))) . '</dd>';
    

    Not sure this text is very accurate. It misses "the" before both pages for one. Second, you can modify any translation for any language. The switch for English is disabled by default (and in fact was introduced) because it is a possible performance issue. So overriding English is only available for English because its overriding English :D

ifrik’s picture

Status: Needs work » Needs review
StatusFileSize
new2.66 KB
new2.09 KB

I've taken these changes up so that we can get this in before RC1.

Taken up the comments in #16 and #17

Status: Needs review » Needs work
jhodgdon’s picture

This looks pretty good! One nitpick:
with other English text string
==>
with other English text strings

gábor hojtsy’s picture

Agreed. Current text sounds great.

ifrik’s picture

Status: Needs work » Needs review
StatusFileSize
new2.01 KB
new2.09 KB

Done!

gábor hojtsy’s picture

Issue tags: +D8MI, +sprint, +language-ui
gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community
gábor hojtsy’s picture

Assigned: dubois » Unassigned

Status: Reviewed & tested by the community » Needs work

Status: Needs work » Needs review
gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Testbot fluke.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for your work on this issue!

This is a pretty long sentence; I had to read it several times before I understood it (and I still am not sure I do). Could we make this two sentences? Also, it's unclear what "this option" refers to.

How about something like:
You can also <em>override</em> the default English text strings on the <a href=":translate">User interface translation</a> page. Go to the <a href=":languages">languages</a> page... and enable the <em>This is the exact text in the UI</em> option [etc.]

jhodgdon’s picture

Status: Needs work » Needs review
Issue tags: +rc deadline
StatusFileSize
new2.18 KB

https://groups.drupal.org/node/484788 Apparently this needs to be "rc deadline" because it changes translatable UI text strings

New patch changing that into hopefully better text... did not bother with interdiff because only 2 lines are in this patch anyway, and 1 is changed. Duh.

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Its not really an RC deadline because new string additions are fine after RC as per the policy in my understanding. Anyway, not removing tag because its RTBC either way.

xjm’s picture

Status: Reviewed & tested by the community » Fixed

Quite clear now, thanks! Committed and pushed to 8.0.x.

  • xjm committed 0eed649 on 8.0.x
    Issue #2572637 by ifrik, dubois, ndobromirov, jhodgdon, Gábor Hojtsy,...
gábor hojtsy’s picture

Issue tags: -sprint

Super, thanks all!

Status: Fixed » Needs work

The last submitted patch, 30: locale-add-translate-english-ui-text-help-2572637-30.patch, failed testing.

jhodgdon’s picture

Status: Needs work » Fixed
ndobromirov’s picture

Status: Fixed » Closed (fixed)

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