Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-5201

Expose context's locale object to freemarker

XMLWordPrintable

    • Yes

      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:

      • info boxes and other helpers supposed to be printed out only while editing
      • labels of custom buttons, not being stuck to PageEditor bars

        Acceptance criteria

              apchelintcev Aleksandr Pchelintcev
              zdenekskodik Zdenek Skodik
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD