[MAGNOLIA-5201] Expose context's locale object to freemarker Created: 25/Jul/13 Updated: 09/Dec/14 Resolved: 21/Nov/14 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | freemarker, i18n, templating |
| Affects Version/s: | 4.5.8 |
| Fix Version/s: | 5.3.6 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Zdenek Skodik | Assignee: | Aleksandr Pchelintcev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | support | ||
| 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)
|
||||||||||||
| Release notes required: |
Yes
|
||||||||||||
| Date of First Response: | |||||||||||||
| Description |
|
At the moment we provide the current page/site locale via the i18n object. Sometimes one'd prefer to print out messages to editors in their chosen language, while there doesn't seem to be a handy way on how to fetch the system language at the moment and printout informations in that language only if you need to support 10 languages in large-scale international companies where 7 teams from all around the world participating to content editing of 15 localized versions of the site. The change is straightforward: info.magnolia.freemarker.FreemarkerHelper NEW if (i18nBasename != null) { data.put("i18n", new MessagesWrapper(i18nBasename, locale)); data.put("i18nAuthor", new MessagesWrapper(i18nBasename, MgnlContext.getLocale())); } Use cases:
|
| Comments |
| Comment by Jan Haderka [ 16/Aug/13 ] |
|
This is not a bug fix, but a new feature and as such doesn't belong to the more then year old maintenance branch. Please remove it from 4.5.x and 5.0.x. And for the time being also from master since there are other things that need to be considered, such as complete overhaul of i18n described in http://wiki.magnolia-cms.com/display/DEV/i18n+in+Magnolia+5 When returning to this issue, if nothing else at least naming needs to be consistent with other setup (feature is called "authoring" under config:/server/i18n ). For those in need of such property before 5.1, add it as custom property to your global freemarker properties. |
| Comment by Jan Haderka [ 18/Apr/14 ] |
|
can anyone comment on why it was in the end rolled back from all branches? Was it not working on M5 or was there other reason? |
| Comment by Jan Haderka [ 22/Apr/14 ] |
|
Before reimplementing this issue, pls try to think of better name for the property and run it by Greg or architecture group to prevent need for renaming later. Thx. |
| Comment by Roman Kovařík [ 25/Apr/14 ] |
|
The suggested names for this property:
|
| Comment by Federico Grilli [ 08/Dec/14 ] |
|
For the release notes/docu: new i18nAuthoring exposing to ftl templates messages from the current message bundle in the user's locale. |