[MAGNOLIA-6470] Offer possibility to override template translations Created: 23/Dec/15 Updated: 11/Mar/21 Resolved: 11/Mar/21 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | freemarker |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Roman Kovařík | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Epic Link: | Enhancement of i18n | ||||||||
| Description |
|
It's possible to override a messages in a FTL template by specifying a custom i18nbase. 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. |