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

Custom language property file overwrites default language when language is unsupported

    Details

    • Story Points:
      6

      Description

      We are using a hook which overwrites some language files. The language files are provided in different languages.

      A problem occurs when a customer configured the liferay portal to not support a specific language (e.g. by setting "locales" in the portal-ext.properties). In that case a language file for an unsupported language overwrites the default language of the portal.

      Here are the steps how to reproduce the problem:

      1. Install a clean Liferay bundle (e.g. Tomcat bundle)

      2. Create a portal-ext.properties in webapps/ROOT/WEB-INF/classes. Insert the following line:

      locales=en_US,de_DE
      

      3. Create a system-ext.properties in webapps/ROOT/WEB-INF/classes. Insert the following lines:

      user.country=DE
      user.language=de
      

      4. Create a custom hook. Use the following liferay-hook.xml:

      <?xml version="1.0"?>
      <!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.1.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_1_0.dtd">
      
      <hook>
          <language-properties>content/Language_en.properties</language-properties>
          <language-properties>content/Language_de.properties</language-properties>
          <language-properties>content/Language_es.properties</language-properties>
      </hook>
      {code:xml}
      
      5. Create the language files mentioned above. The *Language_es.properties* could look like this:
      

      sign-in=Iniciar sesión

      
      

      6. Startup Tomcat. Finish up the Setup Wizard (if needed).

      7. Deploy the hook mentioned above

      8. Restart Tomcat

      9. Go to *http://localhost:8080/de*

      10. The Sign-In button shows "Iniciar sesión". This is spanish. But it should show the button in german, e.g. "Anmelden".

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 49 weeks ago

                Packages

                Version Package
                6.1.30 EE GA3
                6.1.X EE