diff --git a/core/lib/Drupal/Core/StringTranslation/TranslatableString.php b/core/lib/Drupal/Core/StringTranslation/TranslatableString.php index 819b244..37bc5b8 100644 --- a/core/lib/Drupal/Core/StringTranslation/TranslatableString.php +++ b/core/lib/Drupal/Core/StringTranslation/TranslatableString.php @@ -40,7 +40,7 @@ class TranslatableString implements SafeStringInterface { * * @var string */ - protected $TranslatableString; + protected $translatableString; /** * The translation arguments. @@ -91,7 +91,7 @@ public function __construct($string, array $arguments = array(), array $options * @return string * The string stored in this wrapper. */ - public function getUnTranslatableString() { + public function getUntranslatedString() { return $this->string; } @@ -135,8 +135,8 @@ public function getArguments() { * The translated string. */ public function render() { - if (!isset($this->TranslatableString)) { - $this->TranslatableString = $this->getStringTranslation()->translateString($this); + if (!isset($this->translatableString)) { + $this->translatableString = $this->getStringTranslation()->translateString($this); } // Handle any replacements. @@ -144,9 +144,9 @@ public function render() { // replacement is not stored so that different sanitization strategies can // be used in different contexts. if ($args = $this->getArguments()) { - return $this->placeholderFormat($this->TranslatableString, $args); + return $this->placeholderFormat($this->translatableString, $args); } - return $this->TranslatableString; + return $this->translatableString; } /** diff --git a/core/lib/Drupal/Core/StringTranslation/TranslationManager.php b/core/lib/Drupal/Core/StringTranslation/TranslationManager.php index 649902b..836abd8 100644 --- a/core/lib/Drupal/Core/StringTranslation/TranslationManager.php +++ b/core/lib/Drupal/Core/StringTranslation/TranslationManager.php @@ -160,7 +160,7 @@ public function translate($string, array $args = array(), array $options = array * {@inheritdoc} */ public function translateString(TranslatableString $translated_string) { - return $this->doTranslate($translated_string->getUnTranslatableString(), $translated_string->getOptions()); + return $this->doTranslate($translated_string->getUntranslatedString(), $translated_string->getOptions()); } /** diff --git a/core/modules/locale/src/LocaleConfigManager.php b/core/modules/locale/src/LocaleConfigManager.php index 035892f..79628e1 100644 --- a/core/modules/locale/src/LocaleConfigManager.php +++ b/core/modules/locale/src/LocaleConfigManager.php @@ -219,10 +219,10 @@ protected function processTranslatableData($name, array $active, array $translat } else { if (locale_is_translatable($langcode)) { - $value = $this->translateString($name, $langcode, $item->getUnTranslatableString(), $item->getOption('context')); + $value = $this->translateString($name, $langcode, $item->getUntranslatedString(), $item->getOption('context')); } else { - $value = $item->getUnTranslatableString(); + $value = $item->getUntranslatedString(); } if (!empty($value)) { $translated[$key] = $value; diff --git a/core/modules/locale/src/LocaleConfigSubscriber.php b/core/modules/locale/src/LocaleConfigSubscriber.php index 36c6d09..1c10480 100644 --- a/core/modules/locale/src/LocaleConfigSubscriber.php +++ b/core/modules/locale/src/LocaleConfigSubscriber.php @@ -156,7 +156,7 @@ protected function processTranslatableData($name, array $config, array $translat $this->processTranslatableData($name, $config[$key], $item, $langcode, $reference_config); } else { - $this->saveCustomizedTranslation($name, $item->getUnTranslatableString(), $item->getOption('context'), $config[$key], $langcode); + $this->saveCustomizedTranslation($name, $item->getUntranslatedString(), $item->getOption('context'), $config[$key], $langcode); } } } @@ -191,7 +191,7 @@ protected function resetExistingTranslations($name, $translatable, $reference_co } } elseif (!is_array($reference_config)) { - $this->saveCustomizedTranslation($name, $translatable->getUnTranslatableString(), $translatable->getOption('context'), $reference_config, $langcode); + $this->saveCustomizedTranslation($name, $translatable->getUntranslatedString(), $translatable->getOption('context'), $reference_config, $langcode); } } diff --git a/core/modules/locale/src/Tests/LocaleExportTest.php b/core/modules/locale/src/Tests/LocaleExportTest.php index ffa6edc..061c161 100644 --- a/core/modules/locale/src/Tests/LocaleExportTest.php +++ b/core/modules/locale/src/Tests/LocaleExportTest.php @@ -111,7 +111,7 @@ public function testExportTranslation() { // Ensure no customized translations exist in the file. $this->assertNoRaw('msgstr "janvier"', 'French custom translation not present in exported file.'); // Ensure the untranslated strings exist in the file, and with right quotes. - $this->assertRaw($this->getUnTranslatableString(), 'Empty string present in exported file.'); + $this->assertRaw($this->getUntranslatedString(), 'Empty string present in exported file.'); } /** @@ -171,7 +171,7 @@ public function getCustomPoFile() { * @return string * A .po file fragment with an untranslated string. */ - public function getUnTranslatableString() { + public function getUntranslatedString() { return <<< EOF msgid "February" msgstr "" diff --git a/core/tests/Drupal/Tests/UnitTestCase.php b/core/tests/Drupal/Tests/UnitTestCase.php index d5ff9f6..0b845d3 100644 --- a/core/tests/Drupal/Tests/UnitTestCase.php +++ b/core/tests/Drupal/Tests/UnitTestCase.php @@ -227,7 +227,7 @@ public function getStringTranslationStub() { $translation->expects($this->any()) ->method('translateString') ->willReturnCallback(function (TranslatableString $wrapper) { - return $wrapper->getUnTranslatableString(); + return $wrapper->getUntranslatedString(); }); $translation->expects($this->any()) ->method('formatPlural')