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:03:51 +0900
- From: Raymond Wan <rwan.kyoto@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>
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110818 Icedove/3.0.11
Hi Martin, On 28/09/11 16:40, Martin G wrote:var x=(language=="en"?english:japanese);However, I've never used this syntax before and I'm having a hard time extending it. I looked up Javascript and colons on Google, but all I saw was how it's used in JSON syntax, which doesn't seem to be how it's used here.If you're talking about the ? and : combination, it is a pair of operators that appears in several languages (not just JavaScript). I personally rarely use it since it is difficult to extend ... it can be difficult to find on search engines, of course.Here is the description in Wikipedia: http://en.wikipedia.org/wiki/%3F: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.I don't know JavaScript so I can't help you with the specific language, but in general, you would probably have to expand a ?: to a series of if...elseif...else statements. If the language supports it, then some kind of switch/case statements would be ideal.Hope this helps! Ray
- Follow-Ups:
- Re: [tlug] Language localization in Javacript
- From: Raymond Wan
- 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