Brian H. said the following on 11/10/2010 03:36 PM:
The only other alternative I can think of is to use some built tool
(or do it at each application load) to "build" each language
javascript file automatically and save to disk (lang.en.js). I'd
rather avoid this.
Warning! We're rather into build processes here at work...
Anyways, what I've seen done in the past is have a master JS file with
placeholders for messages and during the build process "compile" those
JS files into the internationalized version by replacing the placeholders.
JS (the placeholder characters could be anything you liked):
var message = '${user.notExists}';
Compiles into this:
var messages = 'The user "{0}" does not exist.';
Our JS actually does replacements of the {0} in the client with the
"data" it already knows. This type of {0} replacement is not uncommon
in i18n practices. This is how Java i18n is done on the server side.
No reason why it wouldn't work for JS. See here:
http://trac.mach-ii.com/machii/wiki/Internationalization
HTH,
.Peter
--
You received this message because you are subscribed to Mach-II for CFML list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/