• Icon: Story Story
    • Resolution: Won't Do
    • Icon: Major Major
    • 2.8.x, 2.9.x
    • None
    • None
    • None

      Templating is not currently well suited for using the info.magnolia.i18nsystem features. We would need to either
      use SimpleTranslator, which is really just a crutch for cases where we can't generate a key, OR
      write I18nKeyGenerator implementations for RenderableDefinition ... which ideally should take current site into consideration, etc etc.
      These are labels that are in essence very different from those handled by info.magnolia.i18nsystem: they are meant to be read in website pages by visitors in their "navigation language", as opposed to those read in AdminInterface by authors (in their profile languages, which isn't necessarily the language of the site they're authoring)
      Whether we use the old or new system, the problem with template translations, which was very apparent with STK, is that if one wants to customize the former kind of label (e.g "Read on...", "type search item here" etc - let's call them "templating labels"), they were relying on the i18nBasename of the currently rendered template definition. Which in turn was also used to describe labels of the edit/new/etc buttons for the corresponding template. As a result, we ended up putting all dialog, template-button and templating labels in the same file, which made difficult to customize just the templating labels, since you had to change the basename of the definition, and thus bring along all other dialog/template-button translations.
      In short, I'd suggest the following:
      Keep the current situation for templating
      Prioritize the "migration" the STK dialog definitions / translations to the new system. This is still outstanding (see [ ... currently searching ticket, will update when found ... ]). This will
      Split the translation files - all dialog labels in one under /mgnl-i18n/ and the few remaining templating labels can stay under info/magnolia/templatingkit/... aka their basename.
      Allow people like the fellow commenting on documentation to translate/customize their templating labels.
      Update documentation to better reflect this differentiation (my gut feeling tells me it's not clear) https://documentation.magnolia-cms.com/display/DOCS/Making+a+module+translatable / https://documentation.magnolia-cms.com/display/DOCS/Language
      There are also other issues to take care of in this respect:
      The page editor buttons (add component, edit, trash, ...) are currently not translated. This is currently fine, but we ultimately do want hover/tooltips for those, and typically we'll then want them to say "edit this teaser" rather than a generic "edit this component".
      When this happens, we'll need to think twice - if the component has an i18nBasename, things might go awry (or just confusing) with regards to generated keys vs templating label keys. (either we need to verify that the presence i18nBasename does not prevent from falling back through generated keys (if generated key is "X" and i18nBasename is "B", then look for translations in B:X then fallback to <global>:X
      In short^2, this will mean we might need to revisit and implement some of the missing pieces of info.magnolia.i18nsystem (i.e. the tooling that helps "migrating", review the translation loader which was originally designed to keep track of where a translation came from, etc)
      Also see https://wiki.magnolia-cms.com/display/DEV/i18n+in+Magnolia+5

        Acceptance criteria

              Unassigned Unassigned
              fgrilli Federico Grilli
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: