Could you please cross check lexiadesign
is the correct Text Domain of your FSE theme.
Agter this you can use given functions for Internationalization of Strings of your theme or plugin.
-
esc_html__()
: This is used to translate and escape HTML attributes.
For Ex.<?php echo esc_html__('Download Lexia', 'your-theme-textdomain'); ?>
-
esc_html_e()
: This is used to translate and echo translated text.
For Ex.<?php echo esc_html_x('Download Lexia', 'Sample heading', 'your-theme-textdomain'); ?>
WordPress uses Gettext
for translation.
In order to generate translation
files (.pot, .po, .mo), we can use tools like Poedit.
These files have the translations of all translatable strings of our theme.
Also you need to load these .po
and .mo
file by adding the given code to functions.php
file of the theme.
function fse_theme_load_textdomain() {
load_theme_textdomain( 'your-theme-textdomain', get_template_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'fse_theme_load_textdomain' );
Inside language folder we need to keep our language .po .mo
files.