Search code examples
wordpresslocalizationpoeditpo

Half of the po/mo file strings are working, Wordpress Localization


I'd like to change theme (Flatsome) language on admin control panel site. One of the page UX Builder that i can...but the customizer page (..>appereance>customize) does not change.

I made the localization:

define('THEME_PATH', get_template_directory());

 load_theme_textdomain( 'flatsome', THEME_PATH . '/languages' );

 $locale = get_locale();

 $locale_file = THEME_PATH . "/languages/$locale.php";

 if ( is_readable( $locale_file ) ) require_once( $locale_file );

I've change all the string like I want with __() and _e() Then I scanned the project, locally (with POedit) and created the POT and PO files.

I did my translation. After finished, I transfered the PO and MO files to FTP. Like I said, half of them has changed. I tried so many things now I think totally stuck.


Solution

  • Yes, I solved the problem. If anyone come across this kind of problem. After WP updated 3.7, the main folder for themes is under wp-content/languages/themes/

    And also if you are translating plugin it is wp-content/languages/plugins/

    if your theme mo file doesn't work or half of them is working then take your po mo files to these directories, but this time make theme {text-domain}-{locale}.mo and {text-domain}-{locale}.po