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

LanguageFilter does not replace values correctly on JavaScript files being js.fast.load is true or false

    Details

    • Fix Priority:
      4

      Description

      LanguageFilter does not replace values correctly on JavaScript files. Depending on whether js.fast.load is true or false, a different error occurs, but an error happens in both situations.

      Steps to reproduce

      1. Create a portlet with a JSP file (e.g. view.jsp), JavaScript static file (main.js) and a language resource bundle with some keys (Language.properties).
        • In the JSP file, display a message from the portlet resource bundle by using liferay-ui:message tag.
        • In the JavaScript file, retrieve the same message below and add it dynamically to the page.
        • In the JSP file, display a message from the portal resource bundle by using liferay-ui:message tag.
        • In the JavaScript file, retrieve the same message below and add it dynamically to the page.
        • The attached portlet (war, zip) already does this.
      2. Deploy the portlet. Add it to a page.
      3. Using a browser in incognito/private mode, access the page by passing the parameter js_fast_load=0 in the URL.
      4. Close the window.
      5. Using a browser in incognito/private mode, access the page by passing the parameter js_fast_load=1 in the URL.

      Expected results

      • In step 3, the message retrieved from the portal and inserted via JavaScript will be the same displayed by the tag.
      • In step 5, the message retrieved from the portlet and inserted via JavaScript will be the same displayed by the tag.

      Actual results

      • In step 3, the message retrieved from the portal and inserted via JavaScript will not be translated.
      • In step 5, the message retrieved from the portlet and inserted via JavaScript will not be translated.

      See also the attached GIF file.

        Attachments

        1. Language.properties
          0.2 kB
        2. language-util-smaller.gif
          1.19 MB
        3. language-util-test-portlet.zip
          92 kB
        4. language-util-test-portlet-7.0.0.1.war
          82 kB
        5. main.js
          0.2 kB
        6. view.jsp
          0.7 kB

          Issue Links

            Activity

              People

              • Assignee:
                sharon.choi Sharon Choi
                Reporter:
                adam.brandizzi Adam Brandizzi
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 27 weeks ago

                  Packages

                  Version Package
                  7.0.0 M1