Commit eb25a33d authored by alexpott's avatar alexpott
Browse files

Issue #2137595 by olli, idebr, mitrpaka: 'Create @name' page title uses...

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 77725b60
...@@ -86,6 +86,9 @@ protected function setUp() { ...@@ -86,6 +86,9 @@ protected function setUp() {
'access contextual links', 'access contextual links',
'administer views', 'administer views',
'administer account settings', 'administer account settings',
'administer themes',
'bypass node access',
'administer content types',
] ]
); );
// Create and login user. // Create and login user.
...@@ -378,6 +381,34 @@ public function testContactConfigEntityTranslation() { ...@@ -378,6 +381,34 @@ public function testContactConfigEntityTranslation() {
$this->assertLinkByHref("$translation_base_url/fr/add"); $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. * Tests date format translation.
*/ */
......
...@@ -26,6 +26,9 @@ node.add: ...@@ -26,6 +26,9 @@ node.add:
_node_add_access: 'node:{node_type}' _node_add_access: 'node:{node_type}'
options: options:
_node_operation_route: TRUE _node_operation_route: TRUE
parameters:
node_type:
use_current_language: TRUE
entity.node.preview: entity.node.preview:
path: '/node/preview/{node_preview}/{view_mode_id}' path: '/node/preview/{node_preview}/{view_mode_id}'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment