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:12:23 +0900
- From: Darren Cook <darren@example.com>
- Subject: Re: [tlug] Language localization in Javacript
- References: <CA+kCxRb8df237PV1ZdvOp5Emuqgz_=RdVzpa_fPMJEbQZRX3sA@example.com>
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13
> var english = new Object (); > english.l00001 = "hello"; > english.l00002 = "goodbye"; > var japanese = new Object () > japanese.l00001 = "今日は"; > japanese.l00002 = "サヨナラ"; > > ... 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. var x=(language=="en"?english:japanese); ... alert(x.l00001); I.e. you set a reference variable to point to one language or the other. Then you use that reference variable to get at your strings. Darren -- Darren Cook, Software Researcher/Developer http://dcook.org/work/ (About me and my work) http://dcook.org/blogs.html (My blogs and articles)
- Follow-Ups:
- Re: [tlug] Language localization in Javacript
- From: Martin G
- Re: [tlug] Language localization in Javacript
- From: Simon Cozens
- References:
- [tlug] Language localization in Javacript
- From: Martin G
Home | Main Index | Thread Index
- Prev by Date: [tlug] Language localization in Javacript
- Next by Date: Re: [tlug] Bitsa Woes: Reply and SOLUTION
- Previous by thread: [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