-
Improvement
-
Resolution: Won't Do
-
Neutral
-
None
-
None
-
None
It's possible to override a messages in a FTL template by specifying a custom i18nbase.
We could provide a different solution since the base name is deprecated.
It could be a key generator in the MessageWrapper which would generated the keys:
FTL: i18n[my.key]
public String get(String key) { return translationService.translate(localeProvider, base name, Components.getComponent(TemplateKeyGenerator.class).generate(key)}); } class TemplateKeyGenerator { String[] generate(){ return new String{key, site name + key}; } }
It would be possible to define a custom TemplateKeyGenerator via module descriptor. E.g. Site module would bring a SiteAwareTemplateKeyGenerator.
Be aware that this is different than other info.magnolia.i18nsystem.I18nKeyGenerator s since those generates keys from nothing. Here we need to generated additional keys to the provided one.
- depends upon
-
MAGNOLIA-6472 Support injection into i18n key generators
- Closed
- mentioned in
-
Page Loading...