WordPress.org

Ready to get started?Download WordPress

Forums

mTouch Quiz
[resolved] Change language (5 posts)

  1. Mixx
    Member
    Posted 2 years ago #

    I see the .po and .mo files for the dutch translation are already there, but how do i actually change the language of the plugin?

    http://wordpress.org/extend/plugins/mtouch-quiz/

  2. Stef Verbeeck
    Member
    Posted 1 year ago #

    Hi there,

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

  3. borissamardzija
    Member
    Posted 1 year ago #

    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.

  4. robbiegod
    Member
    Posted 1 year ago #

    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.

  5. gmichaelguy
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.