You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shale.apache.org by "Ian.Priest" <Ia...@opsera.com> on 2007/07/13 17:11:06 UTC

Possible Contribs

Hi,

 

I have a couple of possible contributions...

 

1.       Clay locale-aware import: When using clay to import an html
file, will attempt to load locale specific files in the style of a
message bundle. So if the file name is basename.html will attempt to
load (in order):

 

           baseName + "_" + language + "_" + country + "_" + variant +
".html"

          baseName + "_" + language + "_" + country + ".html"

          baseName + "_" + language + ".html"

          baseName.html

 

                Done by over-riding  protected ComponentBean
getRootElement() in Clay.java. Very handy for internationalisation!

 

2.       Property expansion just like in ant property files, but in
LoadBundle. Use LoadBundle to load a property file and use properties
internally in the file like this...

 

property.world=World

property.helloworld=Hello ${property.world}

 

                Done by some extra processing in the get() method of the
map. (If in the example above ${property.world} can't be found it'll
return "Hello ??property.world??")

 

Both changes are in project-specific extended classes, so not quite
"contrib-ready", but if there's enough interest in these new features
then I'll spend a couple of hours updating base classes and uploading.

 

It'd also be useful to know the proceedure for a contrib: raise a jira
and attach a patch file?

 

Cheers,

Ian.