multilanguage application

G

giangiammy

Hi all,

I need to develope a multilanguage application in Javascript:
is there some particular library, or do you have some
pointer to guidelines to follows: the messages should
if possible be keeped in a separate file, one for language.
Is there some standard format?

thanks
giammy
 
T

Thomas 'PointedEars' Lahn

giangiammy said:
I need to develope a multilanguage application in Javascript:
is there some particular library,

I don't know any.
or do you have some pointer to guidelines to follows: the messages
should if possible be keeped in a separate file, one for language.

Using one file per language compared to one file for all messages has
the advantage of quick loading of the application; it has the drawback
of requiring the application to reload (thereby losing all client-side
states unless backed up otherwise before, such as in a cookie or in a
server-side session variable) in order to change the user interface
language.
Is there some standard format?

No. But Object objects are your best bet, for example for a one-language
messages file:

var messages = {
msg_foobar: "This great Foo application frobnicates bar.",
...
}

You can then access the message with

messages.msg_foobar

or

messages["msg_foobar"]

where the latter is required if the property name is not an identifier.


HTH

PointedEars
 
P

petermichaux

giangiammy said:
Hi all,

I need to develope a multilanguage application in Javascript:

What is the application? How is it supposed to work? I assume you mean
client-side JavaScript. What are you using on the server side? Can the
server side help implement the many languages? All of these answers
probably will affect your choices.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,294
Latest member
LandonPigo

Latest Threads

Top