[Helma-dev] internationalization
Stefan Rinner
rist at mac.com
Fri Feb 11 12:45:53 CET 2005
hi
probably everybody who needed internationalization in his apps wrote
his own library handling messages. writing a library which is able to
return appropriate translations for a key and probably doing some
addtional message formating isn't rocket science at all, but there's
one thing which makes it hard to use translations everywhere. It's not
possible to access the prefix/suffix/default parameters of macros
which often contain some language specific content.
just a small example to illustrate it a little bit:
HopObject/macros.js
function listChildren_macro(param){
//returns all elements of the children-collection
.....
}
and then in /Users/main.skin
<% this.listChildren prefix="<h4>Registrierte Mitglieder</h4><ul><li>"
suffix="</ul>" default="Keine registrierten Mitglieder" %>
i can't pass language specific parameters to the macro so I either have
to use language specific skins or add some logic within the macro.
So what I'd like to have is some app.property where I can store a
reference to one of my translations functions which returns the
translations when called with a key.
Hop should call this function whenever he finds a string which should
get translated (we probably have to mark these strings somehow to
avoid calling this funtion too often unnecessarily).
Another helpful option would be to be able to get/set the prefix/...
parameters from within the macro - but to make all my macros
translatable then I'd have to add some translation-management functions
to each macro
- stefan
-----------------------
Stefan Rinner Mag. (FH)
Kröllgasse 32/18
1150 Wien
++43-(0)699-10909765
More information about the Helma-dev
mailing list