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

I18nContentSupport for dialogs

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Outdated
    • Icon: Major Major
    • None
    • 3.6
    • gui
    • Irrelevant
    • Yes

      In MAGNOLIA-1431 it is stated that we should make copies of dialog controls (or even locale tabs) with locale extensions if we want to have i18n aware dialog.
      This solution leads as to many copies (tabs) if we want to cover many languages.
      Therefore, we've modified the initialization of dialogs in order to have one dialog for all languages.
      The solution works like this:
      When a page is displayed i18nContentSupportFilter sets the current locale and when a dialog is opened all the control's names are suffixed with the locale (if the locale is different than the fallback locale)
      ex. a dialog with edit control named "text" will become "text_[locale]".
      The rest of the job remains to the Save handler which creates the localized content (nodeDatas).
      If you edit the dialog then the content of the current language is filled in the controls.
      This way we have only one dialog and unlimited number of languages, without the need of creating additional tabs (or controls).
      Note: This way there is no possibility to edit more than one language at once.

      For this functionality we modified the following:

      • DialogControlImpl.initializeConfig
      • I18nContentSupportFilter
      • DefaultI18nContentSupport
      • I18nContentSupport
        All of the classes have minor changes, that don't affect other functionalities.

      We attached the patch and hope that you'll like it.

      p.s. we also have created a language chooser (changer) tag that successfully implements the suggested solution

        Acceptance criteria

              pbaerfuss Philipp Bärfuss
              fleka Stojan Peshov
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD