public function testSeparatorTranslation() { // Create an entity.
$entity = EntityTest::
create([ 'name' =>
$this->
randomString(),
$this->fieldStorage->
getName() =>
[ 'value' => '2016-09-20',
'end_value' => '2016-09-21',
],
]);
// Verify the untranslated separator.
$display = EntityViewDisplay::
collectRenderDisplay($entity, 'default'
);
$build =
$display->
build($entity);
$output =
$this->container->
get('renderer'
)->
renderRoot($build);
$this->
assertStringContainsString('UNTRANSLATED',
(string) $output);
// Translate the separator.
ConfigurableLanguage::
createFromLangcode('nl'
)->
save();
/** @var \Drupal\language\ConfigurableLanguageManagerInterface $language_manager */
$language_manager =
$this->container->
get('language_manager'
);
$language_manager->
getLanguageConfigOverride('nl', 'core.entity_view_display.entity_test.entity_test.default'
) ->
set('content.' .
$this->fieldStorage->
getName() . '.settings.separator', 'NL_TRANSLATED!'
) ->
save();