[MAGNOLIA-6316] Provide templating functions to i18nize links Created: 13/Jul/15 Updated: 15/Apr/16 Resolved: 22/Jul/15 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | templating |
| Affects Version/s: | None |
| Fix Version/s: | 5.4.1 |
| Type: | New Feature | Priority: | Neutral |
| Reporter: | Philip Mundt | Assignee: | Philip Mundt |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 1h | ||
| Time Spent: | 1.25d | ||
| Original Estimate: | 3h | ||
| Issue Links: |
|
||||||||||||||||||||
| Template: |
|
||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||
| Release notes required: |
Yes
|
||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||
| Sprint: | Sprint 2 (Basel) | ||||||||||||||||||||
| Story Points: | 1 | ||||||||||||||||||||
| Description |
|
Pre 5.4 work was done on i18n templating functions. These would be a good addition to MTE and would actually provide the solution for Instead of exposing the info.magnolia.cms.i18n.I18nContentSupport in the info.magnolia.templating.functions.TemplatingFunctions we're only going to provide a method to return a list of localized links, e.g. /travel.html: "en": "/travel.html" "de_CH": "/de_CH/travel.html" Known limitationsTravel demo makes heavy use of URI2RepositoryMapping in combination with VirtualURIMapping for tour links. These use forwards and currently cannot be i18nized. |
| Comments |
| Comment by Federico Grilli [ 22/Jul/15 ] |
|
Looks good, the only thing I would change is the label to be displayed to the user. Currently it is Locale locale = Locale.CANADA_FRENCH; System.out.println(locale.toString()); // fr_CA System.out.println(locale.getDisplayName()); // French (Canada) System.out.println(locale.getDisplayName(Locale.GERMAN)); //(simulating a different system language settings) Französisch (Kanada) I guess this change would likely entail an adjustment in the navigation.ftl template but I'm not completely sure about it |
| Comment by Federico Grilli [ 22/Jul/15 ] |
|
For the release notes/documentation: please add the new functions to https://documentation.magnolia-cms.com/display/DOCS/cmsfn |
| Comment by Philip Mundt [ 22/Jul/15 ] |
|
Decided to stay with this approach and rather provide beautifications in the actual travel-demo (see |