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

AUI module loader does not append languageId into url-s in developer mode

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Duplicate
    • Affects Version/s: Master
    • Fix Version/s: None
    • Component/s: AMD Module Loader
    • Labels:
      None
    • Fix Priority:
      3

      Description

      LanguageFilter.java should translates js files on the fly. It changes the Liferay.Language.get('...') strings with their translated values. It also should take into account bundles.

      When we use aui:script tag with use, for example
      <aui:script use="liferay-export-import-export-import">

      The AUI/YUI loader should add the languageId parameter for the query string to let internal/LanguageFilter.java processes the file.

      Now the loader loads js files without the languageId parameter which prevents internal\LanguageFilter.java catch the file, only the old (deprecated) language\LanguageFilter.java got the file.

      How to check it easily:

      1. run master
      2. type into the browser's bar: http://localhost:8080/o/exportimport-web/js/main.js
      3. find process-details in the document
      4. You should find it:
        <code>
        if (!title) { title = 'process-details'; }

        <code>
        Originally this was
        <code>
        title = Liferay.Language.get('process-details');
        <code>
        Which means, language\LanguageFilter.java ran, processed the file, but did not find the translation (because this is in an OSGi bundle)

      5. Now type http://localhost:8080/o/exportimport-web/js/main.js?languageId=en_US
      6. You should find
        <code>
        title = 'Process\x20Details';
        <code>
        Which means, that internal\LanguageFilter.java processed the file and found the translation in it's bundle.

      testing with portal

      see LPS-76614

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 29 weeks, 5 days ago

                  Packages

                  Version Package