Complete the code to make the theme text translatable using the correct function.
echo [1]('Welcome to my site', 'mytheme');
The __() function returns the translated string for the given text domain.
Complete the code to load the theme's text domain for translation.
load_theme_textdomain('mytheme', [1]);
get_template_directory() . '/languages' points to the theme's languages folder where translation files are stored.
Fix the error in this translation function call to correctly escape and translate the text.
echo esc_html_e([1], 'mytheme');
The text to translate must be a string literal, so it needs quotes like 'Hello World'.
Fill both blanks to create a translation-ready string with a placeholder for a dynamic value.
printf( [1], [2] );
Use __() to translate the string with a placeholder, and escape the dynamic value with esc_html() for safety.
Fill all three blanks to register a theme text domain and load translation files correctly.
function mytheme_setup() {
load_theme_textdomain([1], [2] . [3]);
}
add_action('after_setup_theme', 'mytheme_setup');The text domain is 'mytheme', the path is built by joining the template directory and the 'languages' folder.