J
jason.stiles
First off let me just say that while I know "java" pretty well from
about 3-4 years ago, but I am not really up to speed on all the JSP and
Struts things going on but I'm learning as fast as possible
That being said, I have been thrown feet first into a new project and
have been asked to do this.
So anyway I am using resource.properties files to store all of our
strings and I have been adding them to our JSP's using the bean:message
taglib.
This works great and I have no problem creating different property
files for multiple languages using localization.
My problem is that the app we are writing is for one company that
operates in different states (OH, IN, etc...) The business logic for
each company is very similar but sometimes the language needs to change
between states. Further confusing the issue is that this one company
has sub companies which operate in multiple states and each company is
very similar. So I have come up with the idea that I would like to use
the "key" element of bean:message to try to create a sort of
localization scheme for the companies and states.
Here is is my idea. I would like to create a taglib that works exactly
like the bean:message taglib except that you pass in key names that are
like "promptname.company.state". The taglib will look for a key named
"promptname.company.state" and if it exists it will return it, if not
it looks for generic key for that company "promptname.company" if that
does not exist it looks for "promptname". If that key does not exist
it returns error or ???key?? as normal.
The idea is that we create a generic base for the application and
customize the prompts from the differences. Seems like a good idea to
me, heck, there may even already be a taglib out there that does this?
My problem is that I don't know where to start with extending the
bean:message tag. Theoretically it wouldn't be a problem to just keep
sending requests and stripping off .company and .state until you found
one.
Can someone point me in the right direction for doing this? This would
really save me some time.
Jason Stiles
(e-mail address removed)
about 3-4 years ago, but I am not really up to speed on all the JSP and
Struts things going on but I'm learning as fast as possible
That being said, I have been thrown feet first into a new project and
have been asked to do this.
So anyway I am using resource.properties files to store all of our
strings and I have been adding them to our JSP's using the bean:message
taglib.
This works great and I have no problem creating different property
files for multiple languages using localization.
My problem is that the app we are writing is for one company that
operates in different states (OH, IN, etc...) The business logic for
each company is very similar but sometimes the language needs to change
between states. Further confusing the issue is that this one company
has sub companies which operate in multiple states and each company is
very similar. So I have come up with the idea that I would like to use
the "key" element of bean:message to try to create a sort of
localization scheme for the companies and states.
Here is is my idea. I would like to create a taglib that works exactly
like the bean:message taglib except that you pass in key names that are
like "promptname.company.state". The taglib will look for a key named
"promptname.company.state" and if it exists it will return it, if not
it looks for generic key for that company "promptname.company" if that
does not exist it looks for "promptname". If that key does not exist
it returns error or ???key?? as normal.
The idea is that we create a generic base for the application and
customize the prompts from the differences. Seems like a good idea to
me, heck, there may even already be a taglib out there that does this?
My problem is that I don't know where to start with extending the
bean:message tag. Theoretically it wouldn't be a problem to just keep
sending requests and stripping off .company and .state until you found
one.
Can someone point me in the right direction for doing this? This would
really save me some time.
Jason Stiles
(e-mail address removed)