Why resource bundles

E

enrique

Are there compelling reasons to use resource bundles to store end user-
displayed messages, instead of storing them in Javascript source
files? If I store the messages in resource bundles, do they undergo
any transformations when retrieved?

Thank you.

epp
 
W

Wojtek

enrique wrote :
Are there compelling reasons to use resource bundles to store end user-
displayed messages, instead of storing them in Javascript source
files? If I store the messages in resource bundles, do they undergo
any transformations when retrieved?

This is a question of where the work is done.

With resource bundles the server does the work and the browser displays
the text.

With JavScript, the browser must do the work. I do not believe that
JavaScipt has the equivalent of a HashMap, so the look-up might be
slow.

And the entire JavaScript file will be read, not just the portion for
that page (unless you have many JavaScript files, each for its own
page).

Be aware that most browsers cache JavaScript, and will NOT refresh it
even if the file date/time has changed. You would need to have the user
empty their local cache if the JavaScipt changes, or SHIFT-CLICK on the
refresh page button. IE is especially bad for this, and does not seem
to ever get a newer JavaScript file, at least not during a current
session.

I prefer to have the language files on the server. Once they are loaded
into the application memory, the HashMap look-up is really quite fast.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top