Plugin translation ready – mo file not loaded

The load_plugin_textdomain() function had not the same textdomain as given in the PHP file of the plugin. I had written dummy names for this thread, therefore it could not be seen. But I changed it. Also the .mo and .po files have to have the localization code as set in the WordPress database at WP_LANG. … Read more

User specified Timezone

This mission is almost impossible. Players do not stay at one timezone therefor associating a timezone with a player can result in misleading and confusing output. What you can do is move all time to be expressed at a specific time base, lets say UTC, and write some JS that will translate the UTC time … Read more

Theme doesn’t want to load localization files

One error: the function is load_theme_textdomain(), not load_textdomain(). The former is used for Themes to define/load a textdomain; the latter is for core, I believe. (Plugins have an analogous function, load_plugin_textdomain().) Try using: load_theme_textdomain( get_theme_text_domain(), get_template_directory() . ‘/languages’ );

Change WordPress language based on user setting

Your use of $current_user is a little wrong, you should include the global $current_user or assign it to a variable, or shorter and cleaner just get_current_user_id(): add_filter(‘locale’, ‘change_lang’); function change_lang( $locale ) { if( $lang = get_user_meta( get_current_user_id(), ‘user_lang’, true) ) { return $lang; } return $locale; }

Using esc_attr function

Remember to have the text domain along with the render functions (echo function). It means that, they should be: esc_attr_e(“Text needing to be translated”,”your_text_domain”);<br> esc_attr_x(“Text needing to be translated”,”your_text_domain”);<br> ___(“Text needing to be translated”,”your_text_domain”);