I have done the following:
- Wrapped all my non content managed string translations in __() or _e() functions.
- Added the following to my function.php file:
//Add localisation
load_theme_textdomain('whitelabel', get_template_directory() . '/languages');
//Set locale
$locale = get_locale();
$locale_file = get_template_directory() ."/languages/$locale.php";
if ( is_readable( $locale_file ) )
require_once( $locale_file );
- Used POedit to create a translation file and have a test translation to see if it's works but nothing is displayed either.
Checked my PHP info for gettext to make sure it's enabled.
However all I see on page is blank spaces where the translations functions are. It should be defaulting to that text right? Which is English.
What am I doing wrong? I've spend a lot of time looking in to this. By the way I'm not totally sure what $locale.php is about but removing it makes no difference. To me it seems like a problem with the functions.
Thanks in advance.
$textdomain = load_theme_textdomain(...); var_dump($textdomain);
. If the function succeeded it should printtrue
. Is it so? – Ofir Baruch