Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-1636

Default locale detection fails if locale categories have different locales

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.2.3
    • Component/s: Localization
    • Labels:
      None
    • Environment:
      Linux
      POSIX

      Description

      On a POSIX system if the environment is configured to have different locales (e.g. setting display language to German, but number formatting to English) Picard fails to detect the system configured language.

      The reason is that Picard assumes that locale.setlocale(locale.LC_ALL, '') always returns the default locale name, but this is only true if all locale categories have the same locale. If one or more locale categories define different locales the returned value is instead a string like:

      "'LC_CTYPE=de_DE.UTF-8;LC_NUMERIC=en_GB.UTF-8;LC_TIME=en_GB.UTF-8;LC_COLLATE=de_DE.UTF-8;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=de_DE.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=de_DE.UTF-8;LC_ADDRESS=de_DE.UTF-8;LC_TELEPHONE=de_DE.UTF-8;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=de_DE.UTF-8'"

        Attachments

          Activity

            People

            • Assignee:
              outsidecontext Philipp Wolfer
              Reporter:
              outsidecontext Philipp Wolfer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                2.2.3