admin管理员组

文章数量:1125719

Hi I've been trying to translate a string on my website using the translation function __( and _e and I'm not seeing it working on my site.

for example i have a string on my site

__( 'Show articles', 'my_theme' )

show articles remains as it is as i switch my website to different languages my site is using MLP.

Hi I've been trying to translate a string on my website using the translation function __( and _e and I'm not seeing it working on my site.

for example i have a string on my site

__( 'Show articles', 'my_theme' )

show articles remains as it is as i switch my website to different languages my site is using MLP.

Share Improve this question asked Feb 5, 2024 at 10:57 Dev LadyDev Lady 1 2
  • 1 Did you add a translated string in the .pot file? – Tony Djukic Commented Feb 5, 2024 at 16:35
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Bot Commented Feb 5, 2024 at 16:35
Add a comment  | 

1 Answer 1

Reset to default 0

Confirm that the translation functions are being loaded. Sometimes, issues with function loading can prevent translations from working.

Basic example of loading translations in your theme's functions.php file

function my_theme_load_textdomain() {
    load_theme_textdomain( 'my_theme', get_template_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'my_theme_load_textdomain' );

本文标签: