Admin Notice is only localized when displaying the “Plugins” Backend Page

Note: Revised because that ‘__FILE__’ as in dirname(plugin_basename(‘__FILE__’)), was just a typo in the post/question. But one thing you did not include in your post, is about how are you loading the Bootstrapping class, and where is the file located? Is it in a subfolder like includes, i.e. your-plugin/ includes/ class-bootstraping.php languages/ your-plugin.pot your-plugin.php (main … Read more

How to find posts that are missing translation? (wpml)

To whom it may concern: finally I found a way – and it turns out to be rather simple: there is a wpml function or actually a filter that checks whether a post or page has a translation or not: wpml_element_has_translations https://wpml.org/wpml-hook/wpml_element_has_translations/ It returns TRUE if a translation exists and FALSE if there is no translation. … Read more

multisite same language different translation

If this is just your own personal project with plugins you developed and they plugin won’t be more widely distributed, you could just put subdirectories inside the languages directory that correspond to the site ID and load them conditionally: function myplugin_load_textdomain() { $current_site_id = get_current_blog_id(); load_plugin_textdomain( ‘myplugin’, false, basename( dirname( __FILE__ ) ) . ‘/languages/’ … Read more