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

Default locale detection fails if locale categories have different locales

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.2.3
    • 2.2.2
    • Localization
    • None
    • Linux
      POSIX

      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'"

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

              Created:
              Updated:
              Resolved:

                Version Package
                2.2.3