Make WordPress Core

Opened 5 weeks ago

Last modified 5 days ago

#60298 reopened defect (bug)

Text embedded in theme template is not translatable

Reported by: wildworks's profile wildworks Owned by: audrasjb's profile audrasjb
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: needs-patch
Focuses: Cc:

Description (last modified by sabernhardt)

Related to an issue reported on Gutenberg:

Default block themes embed some text inside the template as content or attributes. However, template files are HTML files and cannot use PHP translation functions like pattern files. As a result, English will always be displayed, even if the user changes the site language.

As far as I've researched, the following passages are untranslatable text.

Twenty Twenty-Three

Twenty Twenty-Four

Change History (14)

#1 @sabernhardt
5 weeks ago

  • Component changed from Themes to Bundled Theme
  • Description modified (diff)

"Posts" in Twenty Twenty-Four was reported in issue 711.

#2 @poena
5 weeks ago

Twenty Twenty-Four, patterns/footer.php, in the footer menu fallbacks, the labels are not translatable.
Props @onemaggie, @luminuu

<!-- wp:navigation-link {"label":"Team","url":"#"} /-->
<!-- wp:navigation-link {"label":"History","url":"#"} /-->
<!-- wp:navigation-link {"label":"Careers","url":"#"} /-->

<!-- wp:navigation-link {"label":"Privacy Policy","url":"#"} /-->
<!-- wp:navigation-link {"label":"Terms and Conditions","url":"#"} /-->
<!-- wp:navigation-link {"label":"Contact Us","url":"#"} /-->

<!-- wp:navigation-link {"label":"Facebook","url":"#"} /-->
<!-- wp:navigation-link {"label":"Instagram","url":"#"} /-->
<!-- wp:navigation-link {"label":"Twitter/X","url":"#"} /-->
Last edited 5 weeks ago by poena (previous) (diff)

#3 @poena
5 weeks ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.5

#4 @poena
4 weeks ago

The texts "Newer Posts" and "Older Posts" are in the query pagination block.
This block requires a parent query loop block, so it can't be placed alone in a pattern file to add the translation.

We can either:

  • Wait for the block editor / Gutenberg to support ancestor in the query pagination block, and create patterns with only the pagination:
  • Create patterns for the query
  • Remove the text strings and use the defaults: Previous Page and Next Page. This would be a change on live sites where the user has not customized their templates.

For the single headings that are not translatable we could create very small patterns, that are hidden from the block inserter. But I would like to hear some more opinions about if this is really the best practise.

Last edited 4 weeks ago by poena (previous) (diff)

This ticket was mentioned in PR #6012 on WordPress/wordpress-develop by @poena.

4 weeks ago

  • Keywords has-patch added; needs-patch removed

Updates text labels in footer.php.

Trac ticket:

#6 @poena
4 weeks ago

  • Keywords needs-patch added; has-patch removed

@mukesh27 commented on PR #6012:

3 weeks ago

@carolinan The changes look good. Are you going to open PR for Twenty Twenty-Three?

@poena commented on PR #6012:

3 weeks ago

@carolinan The changes look good. Are you going to open PR for Twenty Twenty-Three?

Not right now, I ran into problems withe upstreams Gutenberg PR.

#10 @poena
2 weeks ago

  • Keywords commit added

Could we commit the change to footer.php in Twenty twenty-Four, and then re-open the issue for the remaining text strings?

#11 @audrasjb
2 weeks ago

  • Keywords has-patch added; needs-patch removed
  • Owner set to audrasjb
  • Status changed from new to accepted

Yeah sounds good to me @poena let's handle this theme by theme.
I'll commit the TT4 PR right now.

#12 @audrasjb
2 weeks ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 57588:

Twenty Twenty-Four: Add missing translation functions to text strings.

This changeset updates some text labels in footer.php to make them translatable.

Props wildworks, sabernhardt, poena, onemaggie, luminuu, mukesh27.
Fixes #60298.

#13 @audrasjb
2 weeks ago

  • Keywords needs-patch added; commit has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to address the other missing text labels.

#15 @poena
5 days ago

  • Milestone changed from 6.5 to 6.6
Note: See TracTickets for help on using tickets.