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: Tue, 27 Sep 2011 20:58:03 +0900
- From: Lewske Wada <ryu@example.com>
- Subject: Re: [tlug] Language localization in Javacript
- References: <CA+kCxRb8df237PV1ZdvOp5Emuqgz_=RdVzpa_fPMJEbQZRX3sA@example.com>
On Sep 27, 2011, at 7:31 PM, Martin G wrote: > ... but I just can't think of how I switch them up at the point when I > want to display one or the other, because the switch involves changing > the name of the variable being called. > There must be a simple way to do this...? I think you may want to do this with something server-side in addition to javascript, but if it's the only way you can do like this : switch (navigator.language.substr(0, 2)) { case "en" : document.writeln("Hello."); break; case "ja" : document.writeln("こんにちは."); break; } Cheers, Lewske Wada Web: http://run.sh/ Email: ryu@example.com Facebook: Lewske Wada Skype: lewske
- References:
- [tlug] Language localization in Javacript
- From: Martin G
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Bitsa Woes: Reply and SOLUTION
- Next by Date: Re: [tlug] Bitsa Woes: Quieter Cooling Alternatives: Dental Floss
- 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