Support » Plugin: mTouch Quiz » [Plugin: mTouch Quiz] Change language

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there,

    Did you ever manage to change the language? I have the exact same question.

    Boris

    (@borissamardzija)

    Hi, I was also searching for this and had to dig a bit.

    This is the part of code that does it

    /// Initialize this plugin. Called by 'init' hook.
    add_action('init', 'mtq_init');
    function mtq_init() {
    	load_plugin_textdomain('mtouchquiz', 'wp-content/plugins/mtouch-quiz/lang/' );
    	add_action('admin_menu', 'mtq_menu');
    	$installed_db = get_option('mtouchquiz_db_version');
    	if ( $installed_db != mtq_database_version ) {
    		mtq_activate();
    	}
    }

    As you can see, it calls
    http://codex.wordpress.org/Function_Reference/load_plugin_textdomain

    The locale is the language code and/or country code you defined in the constant WPLANG in the file wp-config.php.

    We use the WPML plugin and we made two quizzes. One for English and one for Spanish. I noticed when looking in the mTouch Quiz plugin lang folder that some of the files are not named correctly.

    For example, the “mtouchquiz-es.mo” and “mtouchquiz-es.po” files are not correctly named. Both of these files should be “mtouchquiz-es_ES.mo” and “mtouchquiz-es_ES.po”.

    Renaming the files immediately displayed the spanish text, so that was the missing link with out problem.

    I would double check that your language files are named correctly.

    Plugin Author gmichaelguy

    (@gmichaelguy)

    The plugin will automatically load the language file that corresponds to the language you have wordpress set. So if you set the language to es_ES then you won’t have to do this. I will look at the naming issues and fix any that are incorrect. Note that I get these files from kind volunteers and I don’t really check their work and assume they did it correctly.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: mTouch Quiz] Change language’ is closed to new replies.