Closed as not planned
Closed as not planned
Description
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
- 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' ); ?>
- Create a
/languages/pl_PL.mo
file containing the translated data. - Load the theme text domain:
add_action( 'after_setup_theme', function() {
load_theme_textdomain( 'your-theme-name', get_template_directory() . '/languages' );
} );
- Set the
pl_PL
language in wp-admin. - Go to the 404 page. The string does not display the translation.
- 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
Type
Projects
Status
✅ Done