Theme elements not translating

You shouldn’t be using a constant (in your case CORE_THEME_NAME) for the textdomain. This is because the call to __ is parsing your code, not running it. Simply said: it’s not looking up the value of the constant. So, it won’t translate. Quoting the famous Otto: Inside all translation functions, no PHP variables are allowed … Read more

translation does not work with text_domain

From the source code of load_plugin_textdomain it becomes appararent that the function will first look for $domain . ‘-‘ . $locale . ‘.mo’ (so, that’s myplugin-fr_FR.mo) in WP_LANG_DIR . ‘/plugins/’ . $mofile. Only when the file is not there, it will start looking at the specified path and if it is not there in the … Read more

load_plugin_textdomain in `plugins_loaded` or `init`?

Load translation files as late as possible for your plugin’s use-case. This allows other plugins as much time as possible to fully initialise. Why should you care about other plugins? Because they may be involved in the localisation process too. For example, changing the site language or filtering translation file paths. They can’t do those … Read more

Warning/Notice about functions.php

‘;)’ => ‘icon_wink.gif’, is in line 2477 in the current version, you should never just change or delete core files, unless you know how to run a private branch of WordPress. Line 2925 is the second trigger_error() in this function: function _deprecated_argument( $function, $version, $message = null ) { do_action( ‘deprecated_argument_run’, $function, $message, $version ); … Read more

How to debug failed load_theme_textdomain()?

load_theme_textdomain() returns TRUE on success and FALSE if no file was found. For debugging try the following change: function my_theme_setup(){ $path = get_template_directory() . ‘/languages’; $result = load_theme_textdomain(‘my_theme’, $path ); if ( $result ) return; $locale = apply_filters( ‘theme_locale’, get_locale(), ‘my_theme’ ); die( “Could not find $path/$locale.mo.” ); }