Uploaded image for project: 'Magnolia pages module'
  1. Magnolia pages module
  2. PAGES-895

Languages with country codes are not rendering in edit mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 6.2.27
    • 6.2.23
    • SPA Renderer
    • None
    • DevX 34
    • 1
    • Yes

      Reproduce

      1. Setup SPA Demo locally
      2. In the site configuration have two variations of english: en, en_GB
        'travel':
          'i18n':
            'class': 'info.magnolia.cms.i18n.DefaultI18nContentSupport'
            'enabled': true
            'fallbackLocale': 'en'
            'locales':
              'en':
                'country': ''
                'enabled': true
                'language': 'en'
              'de':
                'country': ''
                'enabled': true
                'language': 'de'
              'en_GB':
                'country': 'GB'
                'enabled': true
                'language': 'en'
        
      3. In the pages detail subapp try and switch between the two english options.

      Expected
      When selecting en_GB the values for that language should be displayed in the editor.

      Actual
      Selecting en_GB displays en. The pages app is not able to correctly display languages which also contain a country code.

      Notes
      The check for the default locale here in this class info.magnolia.pages.spa.routing.DefaultSpaRouter#getLanguage() only checks if the language is the same between the provided one and the site default, and ignores all other parts of the locale.
      We have some code in the class AbstractI18nContentSupport which should help. In this class there is a method which is able to sort out "next best" but it this case it's a bit different because we want to find the most specific match.

        Acceptance criteria

          There are no Sub-Tasks for this issue.

              chuong.doan Chuong Doan Huy
              rgange Richard Gange
              DeveloperX
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved:
                Work Started:

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 0.5d
                  0.5d