Multisite and language switcher

Posted in: Newspaper
Post count: 57

Dear support,

I would like to be able to add in the Theme the possibility depending on the language detection from the browser to add the redirection to the multi site installation that I have made.

For example:

<?php

$languages = array(‘da’, ‘de’, ‘el’, ‘en’, ‘es’, ‘fr’, ‘is’, ‘it’, ‘nl’, ‘no’, ‘pt’, ‘fi’, ‘sv’);

if (isset($_POST[‘language’])) {
$lang = $_POST[‘language’];
} else {
$lang = substr($_SERVER[‘HTTP_ACCEPT_LANGUAGE’], 0, 2);
}

if (in_array($lang, $languages)) {
header(‘Location: ‘ . $lang);
} else {
header(‘Location: en’);
}

This without compromising theme. Thx a lot in advanced for any tips you may suggest.

Post count: 57

Ping me for the testing site. I prefer not expose to public the url.

Post count: 22421

Hi,

Unfortunately we have not tested this so we have no tips to provide in this regard. Sorry. Time does not allow us to tackle customization requests. Thank you for you understanding.

Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.