Possible Contribs

View: New views
3 Messages — Rating Filter:   Alert me  

Possible Contribs

by Ian.Priest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

 


Parent Message unknown Re: Possible Contribs

by Gary%20VanMatre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>From: "Ian.Priest" <Ian.Priest@...>
>
> 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?
>


Those ideas are very interesting.  I worked on a web application that was a front-end for retirement services that we miss-used the "variant" of the locale to represent various customers.  This allowed us to easily skin the site and since is was based in the US, we didn't have a use for the language aspect :--).

JIRA is the best way to share source.   This sounds like a useful feature.


>
>
> Cheers,
>
> Ian.
>
>

Gary


>
>

RE: Possible Contribs

by Ian.Priest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SHALE-457 and SHALE-458 created.

Note that code to create the patches was copied from project-specific
external classes. I've "retro-fitted" the code to the classes in SVN so
it's untested and not "release ready" in this context!

Cheers,
Ian.



> -----Original Message-----
> From: gvanmatre@... [mailto:gvanmatre@...]
> Sent: 13 July 2007 20:16
> To: dev@...
> Subject: Re: Possible Contribs
>
> >From: "Ian.Priest" <Ian.Priest@...>
> >
> > 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?
> >
>
>
> Those ideas are very interesting.  I worked on a web application that
> was a front-end for retirement services that we miss-used the
"variant"
> of the locale to represent various customers.  This allowed us to
> easily skin the site and since is was based in the US, we didn't have
a

> use for the language aspect :--).
>
> JIRA is the best way to share source.   This sounds like a useful
> feature.
>
>
> >
> >
> > Cheers,
> >
> > Ian.
> >
> >
>
> Gary
>
>
> >
> >