Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Language localization in Javacript
- Date: Wed, 28 Sep 2011 17:19:02 +0900
- From: Lewske Wada <ryu@example.com>
- Subject: Re: [tlug] Language localization in Javacript
- References: <CA+kCxRb8df237PV1ZdvOp5Emuqgz_=RdVzpa_fPMJEbQZRX3sA@example.com> <4E81AF97.2060001@example.com> <CA+kCxRaM==wbOGH4Qcs__qsPY9SEyQNH9OBefxDbHv0Y2MQ6YQ@example.com>
On Sep 28, 2011, at 4:40 PM, Martin G wrote: > How would I set up a conditional for three or more possible languages? > I'm likely to have a dozen or more languages available for this > application. Why don't you add more branches in the switch-case statement? switch (navigator.language.substr(0, 2)) { case "en" : document.writeln("Hello."); break; case "de" : document.writeln("Guten Tag."); break; case "fr" : document.writeln("Bonjour."); break; case "es" : document.writeln("Hola!"); break; case "pt" : document.writeln("Boa tarde."); break; case "ru" : document.writeln("Здравствуйте!"); break; case "ja" : document.writeln("こんにちは."); break; } Cheers, Lewske Wada Web: http://run.sh/ Email: ryu@example.com Facebook: Lewske Wada Skype: lewske
- Follow-Ups:
- Re: [tlug] Language localization in Javacript
- From: Lewske Wada
- Re: [tlug] Language localization in Javacript
- From: Nikolay Elenkov
- References:
- [tlug] Language localization in Javacript
- From: Martin G
- Re: [tlug] Language localization in Javacript
- From: Darren Cook
- Re: [tlug] Language localization in Javacript
- From: Martin G
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Language localization in Javacript
- Next by Date: Re: [tlug] Language localization in Javacript
- Previous by thread: Re: [tlug] Language localization in Javacript
- Next by thread: Re: [tlug] Language localization in Javacript
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links