My theme is not translated

Make sure you put your function inside after_setup_theme action hook add_action( ‘after_setup_theme’, ‘load_translation’ ); function load_translation() { if( is_dir( get_stylesheet_directory() . ‘/languages’ ) ) { load_theme_textdomain(‘adifier’, get_stylesheet_directory() . ‘/languages’); } else { load_theme_textdomain(‘adifier’, get_template_directory() . ‘/languages’); } Also, you have to make sure your theme domain is matched with the translated file. For an easier … Read more

Transate plugin with js & wp_localize_script

In your PHP you are localizing the script using wp_localize_script(). The way you’ve used it will create an object in JS named messageClip with the string as the copy property, but then in your JavaScript you’re not actually using this. In your JavaScript just get rid of const message etc. and use: buttonclip.on(‘success’, function(e){ e.trigger.textContent … Read more

String translation with or without po file

the .po files are just the human readable version of the translation, but it is not actually used by wordpress for anything. What you need is to generate a .mo version (it is the .po file in some binary encoding form) with a tool like poedit.