Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Language localization in Javacript



Darren, (and Lewske),

Thank you for responding.

> var x=(language=="en"?english:japanese);
> ...
> alert(x.l00001);

This works perfectly. If I understand it, it's essentially an if/else
condition, so if language equals "en", then we use the English set,
and if not, then we get 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.

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.

Any advice is much appreciated.

-- 
Dave M G


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links