Hi Jordi,
may-be deep in our wish list this request is still recorded? Many German user write to me contact mails in English. This is showing me that they were not aware that our homepage can be switched to German.
Is it much work to recognize the country, where a user is located? And switch the language of our homepage accordingly to his (country) language?
There are countries like Switzerland, having several languages. So may-be instead of country code the language of the browser or OS would work better?
It would be important for DACH area, I am sure. Thank you.
Ralf
Hi all,
you can detect the language of the browse in many ways.
If your provider allow, use this script and find the language of the user, you can add this to https://www.labdoo.org/de
-->
A second script I used to find out more from the incomming website I have attached it for you.
If you use PHP use this script:
/**
* Detect Browser Language
*/
function getPreferredLanguage(){
$acceptedLanguages = @explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$preferredLanguage = null;
$maxWeight = 0.0;
foreach((array)$acceptedLanguages as $acceptedLanguage){
$weight = (float)@substr(explode(';', $acceptedLanguage)[1], 2);
if(!$weight){$weight = 1.0;}
if($weight > $maxWeight){
$preferredLanguage = substr($acceptedLanguage, 0, 2);
$maxWeight = $weight;
}
}
return $preferredLanguage;
}
Comentarios
Thank you Ralf and Gert. Yes
Thank you Ralf and Gert. Yes i can implement code into Labdoo's platform to automatically switch language based on user preferences. I will let you know once it's ready, thank you.
This ticket is now resolved.
This ticket is now resolved. Could you please verify that the automatic language detection based on the user Browser settings works correctly? e.g., if your browser settings are in German, it should automatically switch to the German translation, the same for any other supported languages.
Confirm solved, language selection switch also able to set?
Working well :) Thanks. Would it also be possible to set the manual language switch to German, so e.g. the DACH menu becomes visible as well?
Ralf
Hi, I had to temporarily
Hi, I had to temporarily disabled this feature because a latent bug on forwarding edoovillage's scrapbooks URL based on language popped up when the automatic switch language is enabled. I will need to fix that bug before i can enable back this feature, i will do so soon and communicate through this ticket once it's resolved, thanks.