[
https://issues.jboss.org/browse/SEAMINTL-15?page=com.atlassian.jira.plugi...
]
Nicklas Karlsson edited comment on SEAMINTL-15 at 8/3/11 3:51 AM:
------------------------------------------------------------------
It could be done quite cheap with a
{code}
public interface BundleLoader
{
public ResourceBundle loadBundle(Locale locale, String key);
}
{code}
And in ApplicationBundles
{code}
@Inject
BundleLoader loader;
{code}
{code}
public ResourceBundle get(final Locale locale, final Object key) {
containsLocaleMap(locale);
if (!bundles.get(locale).containsKey(key)) {
ResourceBundle bundle = loader.loadBundle(locale, key.toString());
put(locale, key.toString(), bundle);
}
return bundles.get(locale).get(key);
}
{code}
with the default implementation being the ResouceBundle.load(...) and people could then
@Specialize this and have DB-based bundles, lazy loading etc...
was (Author: nickarls):
It could be done quite cheap with a
public interface BundleLoader
{
public ResourceBundle loadBundle(Locale locale, String key);
}
And in ApplicationBundles
@Inject
BundleLoader loader;
public ResourceBundle get(final Locale locale, final Object key) {
containsLocaleMap(locale);
if (!bundles.get(locale).containsKey(key)) {
ResourceBundle bundle = loader.loadBundle(locale, key.toString());
put(locale, key.toString(), bundle);
}
return bundles.get(locale).get(key);
}
with the default implementation being the ResouceBundle.load(...) and people could then
@Specialize this and have DB-based bundles, lazy loading etc...
DB-based messages and other external sources
--------------------------------------------
Key: SEAMINTL-15
URL:
https://issues.jboss.org/browse/SEAMINTL-15
Project: Seam International
Issue Type: Feature Request
Components: Messages
Reporter: Nicklas Karlsson
(hope this is not an obsolute one)
Refactor the producing of the messages so that you could e.g. specialize a producer
method if you want to produce messages from a DB. Currently the only way(?) is to write an
extension that loads the stuff and explicitly places the messages in the appscoped
component.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira