views:

78

answers:

0

I have a website. I'm trying to get gettext to work so that my English, Sweden and Norway sites can come up. I can't get it to work. What have I done wrong?

This is my config code:

// define constants ( defualt - danish )
$lang = 'da_DA';
$lang_short = '';
$lang_prefix = 'da';

if ( isset( $_GET['lang'] ) )
{
    switch( $_GET['lang'] )
    {
        case 'en':
            $lang = 'en_EN';
            $lang_short = 'en/';
            $lang_prefix = 'en';
            break;
        case 'se':
            $lang = 'se_SE';
            $lang_short = 'se/';
            $lang_prefix = 'se';
            break;
        case 'no':
            $lang = 'no_NO';
            $lang_short = 'no/';
            $lang_prefix = 'no';
            break;
    }
}
define( 'LANG', $lang_short );
define( 'LANG_PREFIX', $lang_prefix );

putenv("LC_ALL=". $lang );
bindtextdomain('messages', ROOT .'lang/');

And my path is /var/www/rssbot.dk/lang/. Should I make chmod right, or...?