Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6862

DefaultMessagesImpl's fallback uses system locale to locate message properties file and reads them using ISO-8859-1 resulting in translation issues

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 5.5.1
    • None
    • None
    • None
    • Basel 75
    • 5

    Description

      When running Magnolia on a system with system locales differing from Locale.ENGLISH one might end up with scenarios where translations provided by new and old translation system come from different languages. See

      So even though current use (here superuser) has the locale set to English in his settings, one of the legacy translations shows up in the system locale (which was de_CH.UTF-8, or simply de). Additionally those translation might show up with encoding errors due to being read without UTF-8 but rather ISO-8859-1.

      Source of the problem

      So when no bundle matching Magnolia file naming convention is found, the following line info/magnolia/cms/i18n/DefaultMessagesImpl.java:106 will fallback to Java's bundle loading:

      bundle = ResourceBundle.getBundle(getBasename(), locale);
      

      Java's messages properties file a read with ISO-8859-1 character encoding by default, see link below. Additonally the Locale is detected from the system, resulting in more issues.

      (..) The input stream is in a simple line-oriented format as specified in load(Reader) and is assumed to use the ISO 8859-1 character encoding; (..)

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                pmundt Philip Mundt
                pmundt Philip Mundt
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD