diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml index 93743e4..5018607 100644 --- a/core/config/schema/core.data_types.schema.yml +++ b/core/config/schema/core.data_types.schema.yml @@ -408,6 +408,9 @@ core.base_field_override.*.*.*: label: 'Base field bundle override' core.date_format.*: + type: date_format_entity + +date_format_entity: type: config_entity label: 'Date format' mapping: @@ -424,6 +427,27 @@ core.date_format.*: type: date_format label: 'PHP date format' +date_format_entity_locked: + type: date_format_entity + mapping: + pattern: + type: string + +core.date_format.html_date: + type: date_format_entity_locked +core.date_format.html_datetime: + type: date_format_entity_locked +core.date_format.html_month: + type: date_format_entity_locked +core.date_format.html_time: + type: date_format_entity_locked +core.date_format.html_week: + type: date_format_entity_locked +core.date_format.html_year: + type: date_format_entity_locked +core.date_format.html_yearless_date: + type: date_format_entity_locked + # Generic field settings schemas. field.storage_settings.*: diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationDateFormatUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationDateFormatUiTest.php new file mode 100644 index 0000000..7f68682 --- /dev/null +++ b/core/modules/config_translation/src/Tests/ConfigTranslationDateFormatUiTest.php @@ -0,0 +1,63 @@ +save(); + } + + $user = $this->drupalCreateUser(array( + 'administer site configuration', + 'translate configuration', + )); + $this->drupalLogin($user); + } + + /** + * Tests date format translation behaviour. + */ + public function testDateFormatUI() { + $this->drupalGet('admin/config/regional/date-time'); + + // Assert translation link unlocked date format. + $this->assertLinkByHref('admin/config/regional/date-time/formats/manage/medium/translate'); + + // Assert translation link locked date format. + $this->assertLinkByHref('admin/config/regional/date-time/formats/manage/html_datetime/translate'); + + // Date pattern is visible on unlocked date formats. + $this->drupalGet('admin/config/regional/date-time/formats/manage/medium/translate/de/add'); + $this->assertField('translation[config_names][core.date_format.medium][pattern]'); + + // Date pattern is not visible on locked date formats. + $this->drupalGet('admin/config/regional/date-time/formats/manage/html_datetime/translate/es/add'); + $this->assertNoField('translation[config_names][core.date_format.html_datetime][pattern]'); + } + +}