[ previous ] [ next ] [ threads ]
 
 From:  Carsten Holbach <Carsten dot Holbach at gmx dot de>
 To:  Monowall Support List <m0n0wall at lists dot m0n0 dot ch>
 Subject:  Re: [m0n0wall] Captive portal, multilingual login page
 Date:  Wed, 23 Apr 2008 19:11:41 +0200
Detect browser language (you might change that for IE):
|
http://www.devmag.net/tricks/js/javascript_8.htm

<script type=text/javascript>
<!--
// Das Script stammt von Werner Zenk

if (navigator.appName == 'Netscape')
var language = navigator.language
else
var language = navigator.browserLanguage
var lang = ""

else if (language.indexOf('pl') > -1) lang="Dzien' dobry";
else if (language.indexOf('ro') > -1) lang="Binevenit";
else if (language.indexOf('kl') > -1) lang="Ilaali";
else if (language.indexOf('bg') > -1) lang="Dobro utro";
else if (language.indexOf('af') > -1) lang="Welkom";
else if (language.indexOf('ar') > -1) lang="Sabah al khair";
else if (language.indexOf('zh') > -1) lang="Ni hao";

else if (language.indexOf('da') > -1) lang="Hallo";
else if (language.indexOf('nl') > -1) lang="Welkom";
else if (language.indexOf('eo') > -1) lang="Bonvenigi";
else if (language.indexOf('fi') > -1) lang="Hei";
else if (language.indexOf('fr') > -1) lang="Bienvenue";
else if (language.indexOf('de') > -1) lang="Willkommen";
else if (language.indexOf('hu') > -1) lang="Isten hozta!";
else if (language.indexOf('it') > -1) lang="Benvenuto";
else if (language.indexOf('ja') > -1) lang="Kouguu";

else if (language.indexOf('la') > -1) lang="Ave";
else if (language.indexOf('no') > -1) lang="Hei";

else if (language.indexOf('en') > -1) lang="Welcome";
else if (language.indexOf('tr') > -1) lang="Merhaba";
else if (language.indexOf('es') > -1) lang="Bienvenida";
else if (language.indexOf('sv') > -1) lang="Hej";
else if (language.indexOf('cy') > -1) lang="Croeso";
else if (language.indexOf('zu') > -1) lang="Sawubona";
else if (language.indexOf('pt') > -1) lang="Bem-vindo";
document.write(lang);
// -->
</SCRIPT>


|
YvesDM schrieb:
> That indeed is a solution.
> Pity my javascript-fu sucks :-)
> If someone has some basic example, it would be a good point to start.
>
> Many tnx
> Y
>
>
> On Wed, Apr 23, 2008 at 4:59 PM, Carsten Holbach <Carsten dot Holbach at gmx dot de>
> wrote:
>
>   
>> You could do this with JavaScript.
>> Not the best solution, but that would work.
>>
>>
>> YvesDM schrieb:
>>
>>  That would be lovely !
>>     
>>> But, the login page of the captive portal doesn't parse php and can only
>>> be
>>> plain html, so it will never work ;-)
>>>
>>> Kind regards,
>>> Y
>>>
>>>
>>> On Wed, Apr 23, 2008 at 4:00 PM, Dennis Karlsson <
>>> dennis at denniskarlsson dot com>
>>> wrote:
>>>
>>>
>>>
>>>       
>>>> Hi
>>>>
>>>> Why not use HTTP_ACCEPT_LANGUAGE in conjunction with cookie based
>>>> settings?
>>>>
>>>> If the use never been to the page, the language is based on
>>>> HTTP_ACCEPT_LANGUAGE. If the user prefer some other language they may
>>>> choose
>>>> in some drop down menu.
>>>>
>>>> Just an idea.
>>>>
>>>> / Dennis
>>>>
>>>>
>>>>
>>>> YvesDM wrote:
>>>>
>>>>
>>>>
>>>>         
>>>>> Hi,
>>>>>
>>>>> I use captive portal with radius and need multilingual login pages
>>>>> on
>>>>> some
>>>>> locations.
>>>>> Anyone who has an idea on how to get to this with m0n0wall?
>>>>> Ideally, users choose there language once, receive a cookie and
>>>>> there
>>>>> loginpage language is remembered the next time they arrive on the
>>>>> loginpage.
>>>>> But, the CP login/error pages can only be plain html as far as I
>>>>> know
>>>>> :-(
>>>>>
>>>>> Any ideas to work around this?
>>>>> Kind regards
>>>>> Y.
>>>>>
>>>>>
>>>>>
>>>>>           
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: m0n0wall dash unsubscribe at lists dot m0n0 dot ch
>>>> For additional commands, e-mail: m0n0wall dash help at lists dot m0n0 dot ch
>>>>
>>>>
>>>>
>>>>
>>>>         
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: m0n0wall dash unsubscribe at lists dot m0n0 dot ch
>> For additional commands, e-mail: m0n0wall dash help at lists dot m0n0 dot ch
>>
>>
>>     
>
>