Greetings all,
I seem to be running into an issue regarding the definition of the
DEFAULT_LANGUAGE constant in my application bootstrap.php.
I am simply pulling out out top level domain (us, uk, de, etc...) and
trying to set the application default language accordingly.
EX: 1.2beta, /app/config/bootstrap.php:
//Pull out the top level domain from the HTTP_HOST Constant
$TLD = substr( env("HTTP_HOST"), strrpos(env("HTTP_HOST"), ".")+1);
// define the default language for our available TLD's
if($TLD == 'com'){
$default_language = 'eng';
}elseif ($TLD == 'us'){
$default_language = 'eng';
}elseif ($TLD == 'de'){
$default_language = 'deu';
}elseif ($TLD == 'ch'){
$default_language = 'deu';
}
//Define the default language constant according to the results
define('DEFAULT_LANGUAGE', $default_language);
It seems that now DEFAULT_LANGUAGE must be the ISO 639-3 language
code(deu, eng, standing contrary to the p28n tutorial found in the
bakery), that's fine, but unfortunately it seems no matter what the
DEFAULT_LANGUAGE constant is set to, __autoLanguage() grabs the
HTTP_ACCEPT_LANGUAGE env variable, and writes it to Config.language
instead of DEFAULT_LANGUAGE.
Am I missing something here? Poking through l10n.php, it seems that
DEFAULT_LANGUAGE is actually a fallback in the event __autoLanguage()
cant find anything. Is that true? Can I not somehow bypass the user
having the default language based on their browser?
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---