#The 'Accept-Language' header starts with 'se'
#and the test is case-insensitive ([NC])
RewriteCond %{HTTP:Accept-Language} ^se [NC]
#Redirect ui language to Swedish (language id is '4')
#sending 301 (Moved Permanently) HTTP status code
RewriteRule ^$ /?language=4 [L,R=301]
#For every other language (including English :)) use English (language id is '1')
RewriteRule ^$ /?language=4 [L,R=301]
But I have this translation problem.... :-(
Please, try this solution:
Use Javascript code to show a certain block of the custom HTML widget where text translations in different languages are, when a user select a certain language with the assistance of the GET parameter or block ID
var lang = document.getElementsByTagName("html")[0].getAttribute("lang");
when a user changes the language, the system automatically changes the html tag and lang variable to the current language. In my case to "se-SV"
<script>
if (lang == "sv-SE")
{
/* do the right thing in Swedish*/
}
else
{
/* do the right thing in English */
}
</script>
It works for me. ;-)