Translation with CodeStyling Localization is not working with Marketpress

Hello,
I´m trying to translate Marketpress with CodeStyling Localization, but I get a warning, and it won´t update the translated words to my site.

I have seen another thread about this issue and it won´t fix my problem..

I appreciate your help

Best regards Rasmus

  • Vaughan

    Hi @Rasmus Skov,

    Looking at the code in MP.

    function localization() {
    		// Load up the localization file if we're using WordPress in a different language
    		// Place it in this plugin's "languages" folder and name it "mp-[value in wp-config].mo"
    		$mu_plugins = wp_get_mu_plugins();
    		$lang_dir = dirname(plugin_basename($this->plugin_file)) . '/marketpress-includes/languages/';
    		$custom_path = WP_LANG_DIR . '/marketpress/mp-' . get_locale() . '.mo';
    
    		if ( file_exists($custom_path) ) {
    			load_textdomain('mp', $custom_path);
    		} elseif ( in_array($this->plugin_file, $mu_plugins) ) {
    			load_muplugin_textdomain('mp', $lang_dir);
    		} else {
    			load_plugin_textdomain('mp', false, $lang_dir);
    		}
    
    		//setup language code for jquery datepicker translation
    		$temp_locales = explode('_', get_locale());
    		$this->language = ($temp_locales[0]) ? $temp_locales[0] : 'en';
    	}

    It runs a check first.

    If you have a language translation in the wp-content/languages for marketpress, then it will use load_textdomain, if not it will use load_plugins_textdomain. At least that's how I understand it.

    Let me just ask the developer for some clarification on this for you.

    Hope this helps