Articles of mo

where to set the PO file for a plugin?

I have a Cimy user plugin and I want to make translations and then force the Cimy user to read from my translation. Should I define the language in wp-config.php in the root folder? I do not know where to change it? I have define(‘WPLANG’, ‘fa_IR’); in wp-config.php and it is reading from path \wp-content\languages […]

Load plugins'.mo and .po files from a directory

What I’m trying to do is simple: I have so much WordPress plugins, and 3/4 of them aren’t translated in my language, so I want and can translate them all without problems, but I would insert translations inside a directory, so everytime I update plugins I don’t have to re-upload in every plugins folder the […]

change only the theme language

My wordpress admin is in french. and my theme is in arabic. i have two files mo : arabic and french. i used this : add_filter( ‘locale’, ‘change_locale’ ); function change_locale(){ return ‘pt_AR’; } load_default_textdomain(); load_textdomain(‘responsive’, get_template_directory().’/languages/’); i have my site web in araic only if i deleted the file french if this file […]

POMO_Reader->substr() call endless loop?

I’m experiencing a somewhat endless loop in the file mo.php /wp-includes/pomo/mo.php when loading the site’s default text domain. The PHP error is: Fatal error: Maximum execution time of 30 seconds exceeded in …\wp-includes\pomo\streams.php on line 62 I can work around this by disabling the websites translation, but that’s not really helpful. I’ve updated to the […]

Action hook load_textdomain $domain variable

I use the load_textdomain action hook to list all active localization text domains with corresponding path to translation files. function mo_location( $domain, $mofile ) { if ( !is_array($GLOBALS[‘moloc’]) ) $GLOBALS[‘moloc’] = array(); $GLOBALS[‘moloc’][$domain] = $mofile; } add_action( ‘load_textdomain’, ‘mo_location’, 10, 2 ); For some reason the $domain variable is not filled with a “default” text […]

Generate PO File

I wish to localize some text in my child theme. I followed the instructions here: However, I just created empty po files (eg: he.po) and placed them in the languages directory. When I load my wordpress site (which has a line like __(‘some text’, ‘some-child-theme’); in the functions.php file), the po file stays empty […]

Translated my theme (translation not showing up)

I read a lot about what is the optimal to translate your website (french and english in my case) I set up a Multi site where I created two site one french and one in english I am now in the process of translating my theme(in french by default) I added this to […]

WordPress Multilingual Theme using Multisite

I have a site that needs to be billingual, English and French. I’ve created two sites in WPMU, and set the language settings of the second to fr_FR. Under the directory: /wp-content/languages/ I have fr_FR.po and files for the WordPress backend translations, and it is working well. I’ve also created a theme called “oak” […]

Localization: Textdomain of Child teme

I am creating a series of WP child themes which are dependent of a parent theme which I will be using as a framework. I need to have these themes (both parent and children) localized. from I understood I need to add the following to my theme: add_action(‘after_setup_theme’, ‘my_theme_setup’); function my_theme_setup(){ load_theme_textdomain(‘mytextdomain’, get_template_directory() . […]

Theme localization in WPML – .mo file error

We are creating a multi-lingual multi-site (on sub-domains/domain mapping) on WordPress. We recently bought WPML WordPress plugin and installed it on the basic language (English) version. Now we are trying to work on Theme Localization. Here we are following the steps as in this guide. Here we are being instructed to install a .mo file […]