plugin translation is not working
i have fix this just put renaming the languages files in the plugin to realia-ar.po and realia-ar.mo
i have fix this just put renaming the languages files in the plugin to realia-ar.po and realia-ar.mo
Custom post type translation
If anybody else is looking for the anwser , Here it is function load_txtdomain() { $locale = apply_filters( ‘plugin_locale’, get_locale(), ‘my-plugin’ ); load_textdomain( ‘my-plugin’, WP_LANG_DIR . ‘/my-plugin-‘ . $locale . ‘.mo’ ); } add_action(‘plugins_loaded’,’load_txtdomain’);
Problem is that events callendar is inited before qtranslate, Tribe__Events__Main::instance() : // let’s initialize tec silly-early to avoid fatals with upgrades from 3.x to 4.x add_action( ‘plugins_loaded’, array( $this, ‘plugins_loaded’ ), 0 ); simple hack was to create a plugin named 1fix with code: add_action( ‘plugins_loaded’, ‘__fix_tribe_init’, 0 ); function __fix_tribe_init(){ global $locale; if(preg_match(‘/^\/ru\//’,$_SERVER[‘REQUEST_URI’])) { … Read more
I recently developed a trilingual website, and used a plugin named Polylang. It will work perfect for your wanted result, even though it may require some time to set up and get going.
Rather than use a plugin that uses the eval() function, you could write a simple shortcode to handle translations. something like this: The issue you would face is that the strings wouldn’t be picked up automatically by a tool like POEdit, you would need to manually add the strings to the translation PO files. /** … Read more
Not all strings are translated
Debug WordPress gettext function
Translation not working for Constant strings in Plugin
I found the solution ! The problem was I loaded plugin domain only when plugins are loaded, not for the activation plugin. It resolves my problem… MyPLugin.php class WPGroupSubs { public function __construct(){ // Install needed components on plugin activation /* need to add this */ register_activation_hook( __FILE__, array( $this, ‘load_text_domain’ ) ); register_activation_hook( __FILE__, … Read more