[OPEN-ILS-DEV] staff client i18n: hard-coded strings in javascript for XHTML files

Dan Scott denials at gmail.com
Sun Jan 20 07:39:14 EST 2008


Hello:

In /xul/server/admin/non_cat_types.js, which is pulled into
/xul/server/admin/non_cat_types.xhtml, the _splitInterval function has
hard-coded time unit strings (minutes, hours, days weeks, etc) that
can't (I think) be localized through the normal methods of either
XMLENT (because this is a standalone javascript file) or
messagecatalog (because the parent is an XHTML file, not a XUL file).

I was thinking of creating a hidden <div> in non_cat_types.xhtml with
<span> tags holding the time unit strings as XML entities, then
calling document.getElementById() from non_cat_types.js to load a set
of time unit properties. It seems a bit hackish, but that's where I'm
at. I briefly considered Dojo i18n resource bundles, but that seems
like a heavy-weight solution for this particular problem. If we deploy
Dojo for other reasons, like replacement calendar widgets, then we
could revisit this option.

Knowing that there might be other JS/XHTML demons lurking down the
road, are there any concerns about the hidden <div> /
document.getElementById() path that I plan to take, or better
suggestions?

-- 
Dan Scott
Laurentian University


More information about the Open-ils-dev mailing list