Skip to content

Theme translations not working after "Internationalization improvements in 6.7" #66547

Closed as not planned
@tigriweb

Description

@tigriweb

Description

Hi,

After the i18n improvements in WordPress 6.7, standard theme i18n strings are not working.

I’ve tested this on FSE patterns (404 page, footer) and in functions.php.

Step-by-step reproduction instructions

  1. Create an FSE pattern for the 404 page with the i18n string: <?php echo esc_attr_x( 'Page not found', '404 error page', 'your-theme-name' ); ?>
  2. Create a /languages/pl_PL.mo file containing the translated data.
  3. Load the theme text domain:
add_action( 'after_setup_theme', function() {
	load_theme_textdomain( 'your-theme-name', get_template_directory() . '/languages' );
} );
  1. Set the pl_PL language in wp-admin.
  2. Go to the 404 page. The string does not display the translation.
  3. You can also test the following code in functions.php:
echo esc_attr_x( 'Page not found', '404 error page', 'your-theme-name' );

add_action( 'init', function() {
	echo esc_attr_x( 'Page not found', '404 error page', 'your-theme-name' );
} );

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.7-RC1, 6.8.

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

Internationalization (i18n)Issues or PRs related to internationalization efforts[Priority] HighUsed to indicate top priority items that need quick attention[Type] BugAn existing feature does not function as intended

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions