And this will be an interesting conversion

Files: 
CommentFileSizeAuthor
#34 custom_strings_settings-1975490-34.patch10.52 KBParisLiakos
PASSED: [[SimpleTest]]: [MySQL] 58,852 pass(es).
[ View ]
#34 interdiff.txt749 bytesParisLiakos
#32 custom_strings_settings-1975490-32.patch10.31 KBParisLiakos
PASSED: [[SimpleTest]]: [MySQL] 58,979 pass(es).
[ View ]
#32 interdiff.txt1.3 KBParisLiakos
#30 interdiff.txt5.24 KBParisLiakos
#29 custom_strings_settings-1975490-29.patch9.48 KBParisLiakos
FAILED: [[SimpleTest]]: [MySQL] 58,875 pass(es), 8 fail(s), and 0 exception(s).
[ View ]
#25 drupal-locale_custom_strings_settings-1975490-25.patch10.44 KBParisLiakos
PASSED: [[SimpleTest]]: [MySQL] 57,917 pass(es).
[ View ]
#25 interdiff.txt543 bytesParisLiakos
#23 drupal-locale_custom_strings_settings-1975490-23.patch10.23 KBParisLiakos
FAILED: [[SimpleTest]]: [MySQL] 57,887 pass(es), 6 fail(s), and 0 exception(s).
[ View ]
#17 drupal-locale_custom_strings_settings-1975490-17.patch10.59 KBParisLiakos
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch drupal-locale_custom_strings_settings-1975490-17.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#16 drupal-locale_custom_strings_settings-1975490-16.patch0 bytesParisLiakos
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]
#16 interdiff.txt543 bytesParisLiakos
#11 drupal-locale_custom_strings_settings-1975490-11.patch10.38 KBParisLiakos
FAILED: [[SimpleTest]]: [MySQL] 55,893 pass(es), 7 fail(s), and 0 exception(s).
[ View ]
#11 interdiff.txt1.34 KBParisLiakos
#9 drupal-locale_custom_strings_settings-1975490-9.patch7.17 KBParisLiakos
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]
#3 drupal-locale_custom_strings_settings-1975490-3.patch6.64 KBParisLiakos
PASSED: [[SimpleTest]]: [MySQL] 54,736 pass(es).
[ View ]

Comments

This could move to settings as well..not really sure
See also here #1813762-27: Introduce unified interfaces, use dependency injection for interface translation

Title:Convert locale_custom_strings_* to configConvert locale_custom_strings_* to settings

i will roll a patch for settings

Status:Active» Needs review
StatusFileSize
new6.64 KB
PASSED: [[SimpleTest]]: [MySQL] 54,736 pass(es).
[ View ]

Can we add an example code to default.settings.php, please? If I'm not mistaken, we have done this for all new settings so far, and I think it really helps site builders / developers.

Status:Needs review» Needs work

Forgot to say, that it looks great already!!! Found one other little nit-pick:

+++ b/core/includes/bootstrap.inc
@@ -1539,7 +1539,7 @@ function t($string, array $args = array(), array $options = array()) {
+    $custom_strings[$options['langcode']] = settings()->get('locale_custom_strings_' . $options['langcode'], array());

This should be \Drupal::settings()

Status:Needs work» Postponed

#4: there is already one:)
#5: better wait for #1813762: Introduce unified interfaces, use dependency injection for interface translation, since it is rtbc and then inject settings to CustomStrings translator

Re #6: There is the following code in default.settings.php:

<?php
/**
* String overrides:
*
* To override specific strings on your site with or without enabling the Locale
* module, add an entry to this list. This functionality allows you to change
* a small number of your site's default English language interface strings.
*
* Remove the leading hash signs to enable.
*/
# $conf['locale_custom_strings_en'][''] = array(
# 'forum' => 'Discussion board',
# '@count min' => '@count minutes',
# );
?>

The example code should be changed to something like:

<?php
# $settings['locale_custom_strings_en'][''] = array(
# 'forum' => 'Discussion board',
# '@count min' => '@count minutes',
# );
?>

Also:
1. I think, but I'm not sure, the [''] key is bogus.
2. We should move the entire block up to where the rest of the $settings are.
3. I think the docs could be improved, in particular they should mention that the _en part is in fact dynamic and works for any (enabled) language.

Status:Postponed» Needs work

as per #6

Status:Needs work» Needs review
StatusFileSize
new7.17 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]

ook, injected settings into CustomStrings object, move the settings part together with rest of them, and added documentation about the langcode part.

I agree that '' is bogus, but not sure what to do here

Status:Needs review» Needs work

The last submitted patch, drupal-locale_custom_strings_settings-1975490-9.patch, failed testing.

StatusFileSize
new1.34 KB
new10.38 KB
FAILED: [[SimpleTest]]: [MySQL] 55,893 pass(es), 7 fail(s), and 0 exception(s).
[ View ]

meh, the installer needs parameteters as well

Status:Needs work» Needs review

Status:Needs review» Needs work
Issue tags:-Configuration system, -D8MI

The last submitted patch, drupal-locale_custom_strings_settings-1975490-11.patch, failed testing.

Status:Needs work» Needs review

Status:Needs review» Needs work
Issue tags:+Configuration system, +D8MI

The last submitted patch, drupal-locale_custom_strings_settings-1975490-11.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new543 bytes
new0 bytes
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]

StatusFileSize
new10.59 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch drupal-locale_custom_strings_settings-1975490-17.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

oh sigh, empty patch...interdiff is correct

Status:Needs review» Needs work
Issue tags:-Configuration system, -D8MI

The last submitted patch, drupal-locale_custom_strings_settings-1975490-17.patch, failed testing.

Status:Needs work» Needs review
Issue tags:+Configuration system, +D8MI

Looks very good to me, but I'm not into the locale system enough to RTBC this myself.

Status:Needs review» Needs work
Issue tags:+Configuration system, +D8MI

The last submitted patch, drupal-locale_custom_strings_settings-1975490-17.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new10.23 KB
FAILED: [[SimpleTest]]: [MySQL] 57,887 pass(es), 6 fail(s), and 0 exception(s).
[ View ]

ok lets reroll this one

Status:Needs review» Needs work

The last submitted patch, drupal-locale_custom_strings_settings-1975490-23.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new543 bytes
new10.44 KB
PASSED: [[SimpleTest]]: [MySQL] 57,917 pass(es).
[ View ]

oh, forgot a line during reroll

  1. +++ b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
    index 0a94658..2e4b7cf 100644
    --- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
    +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
    @@ -7,13 +7,12 @@
    +use Drupal\system\Tests\System\CustomStringsTestBase;
    ...
    -class MenuRouterTest extends WebTestBase {
    +class MenuRouterTest extends CustomStringsTestBase {
    +++ b/core/modules/system/lib/Drupal/system/Tests/System/CustomStringsTestBase.php
    @@ -0,0 +1,59 @@
    +abstract class CustomStringsTestBase extends WebTestBase {

    This baseclass really feel wrong. Can't we not just add this to the WebTestBase?

  2. +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
    @@ -7,13 +7,12 @@
    -use PDO;

    A little be out of scope, but fine.

  3. +++ b/core/modules/system/lib/Drupal/system/Tests/System/CustomStringsTestBase.php
    --- a/sites/default/default.settings.php
    +++ b/sites/default/default.settings.php
    +++ b/sites/default/default.settings.php
    +++ b/sites/default/default.settings.php
    @@ -463,6 +463,23 @@
    @@ -463,6 +463,23 @@
    # $settings['session_write_interval'] = 180;
    /**
    + * String overrides:
    + *
    + * To override specific strings on your site with or without enabling the Locale
    + * module, add an entry to this list. This functionality allows you to change
    + * a small number of your site's default English language interface strings.
    + *
    + * Remove the leading hash signs to enable.
    + *
    + * The "en" part of the variable name, is dynamic and can be any langcode of
    + * any enabled language. (eg locale_custom_strings_de for german).
    + */
    +# $settings['locale_custom_strings_en'][''] = array(
    +#   'forum'      => 'Discussion board',
    +#   '@count min' => '@count minutes',
    +# );
    +
    +/**
      * Base URL (optional).
      *
      * If Drupal is generating incorrect URLs on your site, which could
    @@ -589,20 +606,6 @@
    @@ -589,20 +606,6 @@
    # $conf['system.performance']['js']['gzip'] = FALSE;
    /**
    - * String overrides:
    - *
    - * To override specific strings on your site with or without enabling the Locale
    - * module, add an entry to this list. This functionality allows you to change
    - * a small number of your site's default English language interface strings.
    - *
    - * Remove the leading hash signs to enable.
    - */
    -# $conf['locale_custom_strings_en'][''] = array(
    -#   'forum'      => 'Discussion board',
    -#   '@count min' => '@count minutes',
    -# );
    -
    -/**

    Is there a reason why this was moved in the file?

Priority:Normal» Critical

Status:Needs review» Needs work

.

Status:Needs work» Needs review
StatusFileSize
new9.48 KB
FAILED: [[SimpleTest]]: [MySQL] 58,875 pass(es), 8 fail(s), and 0 exception(s).
[ View ]

Is there a reason why this was moved in the file?

So it is grouped with the rest of the settings section. also see #7

StatusFileSize
new5.24 KB

meh, the interdiff ;)

Status:Needs review» Needs work

The last submitted patch, custom_strings_settings-1975490-29.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new1.3 KB
new10.31 KB
PASSED: [[SimpleTest]]: [MySQL] 58,979 pass(es).
[ View ]

+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -918,6 +925,41 @@ protected function writeSettings($settings) {
+   * Adds custom translations.

I think we should describe that the custom translations are added to the settings object.

Otherwise this looks really good.

StatusFileSize
new749 bytes
new10.52 KB
PASSED: [[SimpleTest]]: [MySQL] 58,852 pass(es).
[ View ]

probably something like that

Status:Needs review» Reviewed & tested by the community

Nice!

Issue tags:+sprint, +language-ui

Status:Reviewed & tested by the community» Fixed

This looks great. Committed/pushed to 8.x, thanks!

Issue tags:-sprint

Superb, thanks!

Added a quick change notice at https://drupal.org/node/2109883

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