Updated: Comment 0

Problem/Motivation

We currently do define static page titles on the routes definition using _title. Sadly this never get's translated.

Proposed resolution

Remaining tasks

User interface changes

API changes

Files: 
CommentFileSizeAuthor
#16 page_title-2084057-16.patch5.17 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 58,582 pass(es). View
#13 page_title-2084057-13.patch5.17 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] 58,648 pass(es), 1 fail(s), and 0 exception(s). View
#13 interdiff.txt628 bytesdawehner
#10 page_title-2084057-10.patch5.14 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 58,898 pass(es). View
#10 interdiff.txt661 bytesdawehner
#6 page_title_translate-2084057-6.patch5.14 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 59,006 pass(es). View
#6 interdiff.txt1.37 KBdawehner
#3 page_title_translate-2084057-PASS.patch5.82 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 58,560 pass(es). View
#1 page_title_translate-2084057-FAIL.patch1.63 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] 58,916 pass(es), 2 fail(s), and 0 exception(s). View
#1 help-1831846-PASS.patch9.63 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] 58,373 pass(es), 178 fail(s), and 21 exception(s). View

Comments

dawehner’s picture

Status: Active » Needs review
Issue tags: +D8MI
FileSize
9.63 KB
FAILED: [[SimpleTest]]: [MySQL] 58,373 pass(es), 178 fail(s), and 21 exception(s). View
1.63 KB
FAILED: [[SimpleTest]]: [MySQL] 58,916 pass(es), 2 fail(s), and 0 exception(s). View

There we go

Status: Needs review » Needs work

The last submitted patch, help-1831846-PASS.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
5.82 KB
PASSED: [[SimpleTest]]: [MySQL] 58,560 pass(es). View

Wrong patch ...

dawehner’s picture

Wrong patch ...

pwolanin’s picture

Status: Needs review » Needs work

disables 2 tests:

--- a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php
@@ -61,7 +61,7 @@ function tearDown() {
   /**
    * Tests the handling of HTML by drupal_set_title() and drupal_get_title()
    */
-  function testTitleTags() {
+  function ptestTitleTags() {
     $title = "string with <em>HTML</em>";
     // drupal_set_title's $filter is Title::CHECK_PLAIN by default, so the title should be
     // returned with check_plain().
@@ -88,7 +88,7 @@ function testTitleTags() {
   /**
    * Test if the title of the site is XSS proof.
    */
-  function testTitleXSS() {
+  function ptestTitleXSS() {
dawehner’s picture

Status: Needs work » Needs review
FileSize
1.37 KB
5.14 KB
PASSED: [[SimpleTest]]: [MySQL] 59,006 pass(es). View

There we go.

pwolanin’s picture

This looks good - should have been translated from the start.

pwolanin’s picture

Status: Needs review » Reviewed & tested by the community
aspilicious’s picture

+++ b/core/modules/system/tests/modules/test_page_test/lib/Drupal/test_page_test/Controller/Test.php
@@ -26,4 +26,17 @@ public function renderTitle() {
+    $build['#markup'] = 'Hello Durpal';

Durpal ==> intentional?

dawehner’s picture

FileSize
661 bytes
5.14 KB
PASSED: [[SimpleTest]]: [MySQL] 58,898 pass(es). View

.

pwolanin’s picture

That's the way I might tend to type it :) but looks better now.

webchick’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php
@@ -150,6 +150,18 @@ public function testRenderTitle() {
+    // Translate
+    $this->drupalGet('test-page-static-title');

(nitpick) That comment needs to be a sentence ending with a period, but...

How is that actually translating anything? Is the comment wrong, or the code?

dawehner’s picture

FileSize
628 bytes
5.17 KB
FAILED: [[SimpleTest]]: [MySQL] 58,648 pass(es), 1 fail(s), and 0 exception(s). View

Oh the comment is just stupid, here some a better one.

pwolanin’s picture

Status: Needs review » Reviewed & tested by the community

I find protected $translationManager; a little odd as the variable name, but already used all over core.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, page_title-2084057-13.patch, failed testing.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
5.17 KB
PASSED: [[SimpleTest]]: [MySQL] 58,582 pass(es). View

Reupload to not destroy the testrun.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.