diff --git a/core/lib/Drupal/Core/Datetime/DateFormatter.php b/core/lib/Drupal/Core/Datetime/DateFormatter.php index fc78d9e..31f06cc 100644 --- a/core/lib/Drupal/Core/Datetime/DateFormatter.php +++ b/core/lib/Drupal/Core/Datetime/DateFormatter.php @@ -232,9 +232,6 @@ public function getSampleDateFormats($langcode = NULL, $timestamp = NULL, $timez * formats, NULL otherwise. */ protected function dateFormat($format, $langcode) { - if ($format == 'custom') { - return NULL; - } if (!isset($this->dateFormats[$format][$langcode])) { $original_language = $this->languageManager->getConfigOverrideLanguage(); $this->languageManager->setConfigOverrideLanguage(new Language(array('id' => $langcode))); diff --git a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php index c4dfa10..54c8a85 100644 --- a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php +++ b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php @@ -176,6 +176,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Request $ if ($form_element = $this->createFormElement($schema)) { $parents = array('config_names', $name); $form['config_names'][$name] += $form_element->getTranslationBuild($this->sourceLanguage, $this->language, $source_config, $translation_config, $parents); + // Merge, if there any form attributes from element. if ($attributes = $form_element->getFormAttributes()) { $form = array_merge_recursive($form, $attributes); } diff --git a/core/modules/config_translation/src/FormElement/ElementInterface.php b/core/modules/config_translation/src/FormElement/ElementInterface.php index e58ce86..c9fb0b9 100644 --- a/core/modules/config_translation/src/FormElement/ElementInterface.php +++ b/core/modules/config_translation/src/FormElement/ElementInterface.php @@ -71,7 +71,7 @@ public function getTranslationBuild(LanguageInterface $source_language, Language public function setConfig(Config $base_config, LanguageConfigOverride $config_translation, $config_values, $base_key = NULL); /** - * Allows providing form attributes for the configuration form. + * Allows to provide form attributes for the configuration form. * * @return array * An array of form attributes. diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php index 807307c..f8def2a 100644 --- a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php @@ -446,6 +446,9 @@ public function testDateFormatTranslation() { $this->drupalGet($translation_page_url); $this->assertText($label); + // Make sure date library added from the element form. + $this->assertRaw('core/modules/system/js/system.date.js'); + // Update translatable fields. $edit = array( 'translation[config_names][core.date_format.' . $id . '][label]' => $id . ' - FR',