## WordPress filter load_textdomain_mofile not working inside a child theme’s functions.php but works form inside a plugin

Question
Function in a plugin is behaving differently than function in the functions.php inside a child theme. I have a custom simple plain plugin with nothing but the following code in it and it works perfectly. It translates wpamelia plugin correctly with ...
0
1 month 0 Answers 41 views

## wordpress __() gettext problem

Question
I am using WPML string translation to translate strings in my site. When I check the theme file the gettext functions are written without a second argument eg: __('some text to translate') But after updating the WPML plugins the string translations stopped ...
0
3 months 0 Answers 51 views

## How to load translation in JavaScript?

Question
I am struggling to load translation in JavaScript for my simple plugin. Translation works for PHP, but not in JS. What seems to be the problem, how can I debug this? I have loaded text domain in my plugin method ...
0
5 months 0 Answers 55 views

## How to reload wordpress textdomains at runtime

Question
I'm currently using this to reload my theme and plugin textdomain in order to send e-mails (admin move, in admin language) in the user language. add_filter("theme_locale", array($this, "theme_locale"), 9999, 2); add_filter("plugin_locale", array($this, "plugin_locale"), 9999, 2); $this->load_textdomains(); remove_filter("theme_locale", array($this, "theme_locale"), 9999, 2); remove_filter("plugin_locale", array(\$this, "plugin_locale"), 9999, ...
0
5 months 0 Answers 52 views

## How can I translate the name of my Plugin for other languages?

Question
How can I translate the name of plugin for other languages? For example: When Wordpress is in pt-BR language, the plugin would be "Meu plugin". If the Wordpress is in en-XX language, the plugin name would be "My plugin". Thanks!
0
6 months 0 Answers 39 views

## Load textdomain from global languages directory

Question
I am creating translations for my plugin. To fetch .mo files from my-plugin/languages directory , I use the function //Load translation function load_plugin_textdomain() { load_plugin_textdomain( 'my-plugin', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' ); } add_action( 'plugins_loaded', 'load_plugin_textdomain' ); How can ...
0
4 years 0 Answers 36 views

## Two text domains in one plugin

Question
From start: A = main plugin(the library), B = child plugin I develop a plugin B that will depend on another plugin A in order to work properly. I do this because I'm one of the persons who don't like ...
0
6 years 0 Answers 34 views