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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
Issue tags: +D8MI
FileSize
9.63 KB
1.63 KB

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

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

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

.

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

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

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.