i18n - get Texts from database instead of flat file

84 views
Skip to first unread message

cftagger

unread,
Oct 19, 2009, 3:34:21 PM10/19/09
to ColdBox Platform
I'm looking for a way to load i18n-Resource bundles out from a
database instead of a properties-file. Has anybody done this?

Luis Majano

unread,
Oct 19, 2009, 9:20:31 PM10/19/09
to col...@googlegroups.com
Yes I beleive several people have done this.

On Monday, October 19, 2009, cftagger <juerg.a...@gmail.com> wrote:
>
> I'm looking for a way to load i18n-Resource bundles out from a
> database instead of a properties-file. Has anybody done this?
>
> >
>

--
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Bill Tindal

unread,
Oct 22, 2009, 1:57:36 AM10/22/09
to col...@googlegroups.com
I would be very interested in this.

Luis, would we need to override the ResourceBundle plugin to
accomplish this? Would an extension do the job?
--
Bill Tindal

web :: http://www.fantasysportsstar.com
skype :: dbloh7
email :: mal...@gmail.com

Luis Majano

unread,
Oct 22, 2009, 11:28:58 AM10/22/09
to col...@googlegroups.com
Yes bill, it would be using the new 3.0.0 extensions.  Basically, just create your own ResourceBundle plugin and place it here:

/coldbox/system/extensions/plugins

That will make it override core plugins.  You can also choose the location of the coldbox extensions by setting a new setting called: "ColdBoxExtensionsLocation" which should be a dot notation base path: "coldbox.system.extensions"

This works much like eclipse dropins features.

Hope this helps.

cftagger

unread,
Oct 22, 2009, 6:02:25 PM10/22/09
to ColdBox Platform
Luis,
That means, copy the ResourceBundle.cfc from "coldbox\system\plugins"
to "coldbox\system\extensions\plugins"? And then modify the method
"getResourceBundle" so that keys and values will be filled up from the
database? How do I pass the database information? Can I set values
that can be accessed from these plugin methods? (sorry for this
beginner question)
The "ColdBoxExtensionsLocation" can also be different for each
application and be located in the webroot, not in the coldbox system-
tree? It could be dangerous to modify within the core coldbox-
directory tree, and not so update-friendly...

cftagger

unread,
Oct 23, 2009, 4:33:45 PM10/23/09
to ColdBox Platform
I've tried to set the "ColdBoxExtensionsLocation" within the config
file (I'm using 3.0 beta 2), but always get the error "The config.xml
file does not validate with the framework's schema". Do I have to
validate against another schema? (now, it's http://www.coldbox.org/schema/config_3.0.0.xsd).
Or how can I use this setting?

Luis Majano

unread,
Oct 23, 2009, 4:40:18 PM10/23/09
to col...@googlegroups.com
use nightly build, these changes where done in nightly build.

cftagger

unread,
Nov 13, 2009, 3:41:22 AM11/13/09
to ColdBox Platform
Now; in beta3, I've seen that ColdBoxExtensionsLocation is now
accepted. How can I define that this mapping is be relative to the
Application webroot, not to the coldbox root?
Reply all
Reply to author
Forward
0 new messages