Plugin Localization and Translation — a practical guide to WordPress plugin translation with clear examples you can reuse in real projects.
WordPress Plugin Development Series (66/95). Prefer one article? Read the complete WordPress plugin development tutorial.
Short description
Wrap UI strings with translation functions and load `.mo` files on `init`/`plugins_loaded`.
Load text domain
add_action('init', function () {
load_plugin_textdomain('acme-tools', false, dirname(plugin_basename(__FILE__)) . '/languages');
});
echo esc_html__('Settings saved.', 'acme-tools');