Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-100358

ResourceBundleUtil.getBundle returns the wrong ResourceBundle for the portal classloader

    Details

      Description

      When overriding global language keys, the ResourceBundle for the portal classloader is the ResourceBundle provided by the new OSGi component.

      https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/overriding-global-language-keys

      However, inside of ResourceBundleUtil, whenever retrieving the ResourceBundle for the portal classloader, it always return the original ResourceBundle rather than the override. This results in global language overrides not taking effect on some pages in Liferay.

      Steps to Reproduce

      1. Follow the tutorial to prepare a new ResourceBundle component, and change the language key: layout.types.portlet=Widget Page to
        layout.types.portlet=Portlet Page (see attached example.global.language.override-1.0.0.jar)
      2. Deploy the module
      3. Navigate to Liferay > Site Builder > Pages in the left-hand control menu

      Expected behavior is that you see "Portlet Page" below each page name.
      Actual behavior is that you continue to see "Widget Page" below each page name.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              summer.zhang Summer Zhang
              Reporter:
              minhchau.dang Minhchau Dang
              Participants of an Issue:
              Recent user:
              Jason Pince
              Engineering Assignee:
              Minhchau Dang
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 47 weeks, 2 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP90
                  7.0.10.13 DXP SP13
                  7.0.X
                  7.1.10 DXP FP14
                  7.1.X
                  7.2.10 DXP FP2
                  7.2.10.1 DXP SP1
                  7.2.1 CE GA2
                  7.2.X
                  7.3.0 CE GA1
                  7.3.10 DXP GA1
                  Master