@Pixelspin, I'm having the exact same issue and it seems there's something messed with the silverstripe's implementation of i18n.
Let me explain it one more time for the others:
In my /mysite/ directory I've made a new one called /lang/. Inside I've created 2 files:
es_ES.php, with the following contents:
<?php
global $lang;
$lang['es_ES']['Header']['HELLO_MSG'] = 'Hola';
?>
en_US.php, with the following contents:
<?php
global $lang;
$lang['en_US']['Header']['HELLO_MSG'] = 'Hello';
?>
Dynamic content on the website is already translated using the Translatable class, so now when I go to http://<domain>/hello it shows me dynamic content in English, and correspondingly the Spanish content at http://<domain>/hola
Here's the problem with i18n - it doesn't change the locale automatically, even though the site engine knows what language is being displayed. My _config.php file contains the line: i18n::set_locale('es_ES'); and it feels like i18n takes for granted that's the current language all the time.
When the Page.ss template contains this:
<% _t('Header.CHOOSE_COUNTRY') %> $ContentLocale
I always get the hello message in Spanish, no matter which language version of page I'm browsing (/hola or /hello), whilst the $ContentLocale changes depending on the current lang.
I know I could call the i18n::set_locale method in a controller and therefore force the website to show content in the right language but shouldn't this be an automatic behavior? After all if $ContentLocale is set properly upon every request, then why the locale isn't?
I'm using the latest stable SS version 2.4.5, and XAMPP 1.7.3.