Issue #2137595 by olli, idebr, mitrpaka: 'Create @name' page title uses override-free configuration (eg. not localized) instead of the overridden configuration (eg. localized)
parent
77725b6084
commit
eb25a33d4e
|
@ -86,6 +86,9 @@ class ConfigTranslationUiTest extends WebTestBase {
|
|||
'access contextual links',
|
||||
'administer views',
|
||||
'administer account settings',
|
||||
'administer themes',
|
||||
'bypass node access',
|
||||
'administer content types',
|
||||
]
|
||||
);
|
||||
// Create and login user.
|
||||
|
@ -378,6 +381,34 @@ class ConfigTranslationUiTest extends WebTestBase {
|
|||
$this->assertLinkByHref("$translation_base_url/fr/add");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the node type translation.
|
||||
*/
|
||||
public function testNodeTypeTranslation() {
|
||||
$type = Unicode::strtolower($this->randomMachineName(16));
|
||||
$name = $this->randomString();
|
||||
$this->drupalLogin($this->adminUser);
|
||||
$this->drupalCreateContentType(array('type' => $type, 'name' => $name));
|
||||
|
||||
// Translate the node type name.
|
||||
$langcode = $this->langcodes[0];
|
||||
$translated_name = $langcode . '-' . $name;
|
||||
$edit = array(
|
||||
"translation[config_names][node.type.$type][name]" => $translated_name,
|
||||
);
|
||||
$this->drupalPostForm("admin/structure/types/manage/$type/translate/$langcode/add", $edit, t('Save translation'));
|
||||
|
||||
// Check the name is translated without admin theme for editing.
|
||||
$this->drupalPostForm('admin/appearance', array('use_admin_theme' => '0'), t('Save configuration'));
|
||||
$this->drupalGet("$langcode/node/add/$type");
|
||||
$this->assertRaw(t('Create @name', array('@name' => $translated_name)));
|
||||
|
||||
// Check the name is translated with admin theme for editing.
|
||||
$this->drupalPostForm('admin/appearance', array('use_admin_theme' => '1'), t('Save configuration'));
|
||||
$this->drupalGet("$langcode/node/add/$type");
|
||||
$this->assertRaw(t('Create @name', array('@name' => $translated_name)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests date format translation.
|
||||
*/
|
||||
|
|
|
@ -26,6 +26,9 @@ node.add:
|
|||
_node_add_access: 'node:{node_type}'
|
||||
options:
|
||||
_node_operation_route: TRUE
|
||||
parameters:
|
||||
node_type:
|
||||
use_current_language: TRUE
|
||||
|
||||
entity.node.preview:
|
||||
path: '/node/preview/{node_preview}/{view_mode_id}'
|
||||
|
|
Loading…
Reference in New Issue