Open Bug 1795842 Opened 3 years ago Updated 2 years ago

Snap: Regional settings not listed/respected in Ubuntu 22

Categories

(Thunderbird :: OS Integration, defect)

Thunderbird 102
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: rb, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0

Steps to reproduce:

  1. Install Ubuntu 22.04.1 desktop.
  2. Install Thunderbird snap (gives version 102.3.3-1)
  3. In system settings -> Region & Language, set Language to English (United States) AND set Formats (used for dates, times, numbers) to English (United Kingdom)

Actual results:

Two related problems:

  1. Thunderbird dates displayed in US format (MM/DD/YYYY), ignoring the system setting for date format.
  2. Thunderbird settings, under Date and Time Formatting, do not offer English (United Kingdom), contradicting documentation at https://support.mozilla.org/en-US/kb/customize-date-time-formats-thunderbird which says that whatever is in the system settings should be offered.

Expected results:

  1. Thunderbird respects the system setting for regional date format.
  2. Thunderbird offers installed regional formats in its own settings.

To clarify, the setup described above produces the following in the Thunderbird General settings:

Date and Time Formatting
(x) Application locale: English (United Kingdom)
( ) Regional settings locale: English (United States, posix)

You can select English (United Kingdom) and restart Thunderbird, but dates are still displayed in US format (MM/DD/YYYY), so this has no effect.

Experimentally, I installed the Japanese language using the system settings, and set my formats to Japanese there. Restarting Thunderbird, it did not offer Japanese in its settings (which is also a subject of this report) so I was not able to test whether selecting it has an effect.

This should work just fine with a build from thunderbird.net. Likely an issue with the snap, but that is not maintained by the Thunderbird team.

Summary: Regional settings not listed/respected in Ubuntu 22 → Snap: Regional settings not listed/respected in Ubuntu 22

(In reply to Magnus Melin [:mkmelin] from comment #2)

This should work just fine with a build from thunderbird.net. Likely an issue with the snap, but that is not maintained by the Thunderbird team.

OK, to check this I downloaded Thunderbird fresh from thunderbird.net https://download.mozilla.org/?product=thunderbird-102.4.0-SSL&os=linux64&lang=en-US and ran it on a completely fresh profile.

Thunderbird still ignored the regional settings for date and time.

In this case I had the system language set to en_GB.UTF-8 but LC_DATE set to en_DK.UTF-8. I should be seeing ISO dates in the format YYYY-MM-DD, but Thunderbird is showing them in DD/MM/YYYY format, even though my settings say

Date and Time Formatting
( ) Application locale: English (United Kingdom)
(x) Regional settings locale: English (Denmark)

So I do not believe this is an issue with the snap packaging.

(In reply to Richard Brooksby from comment #3)

In this case I had the system language set to en_GB.UTF-8 but LC_DATE set to en_DK.UTF-8.

Sorry that should say LC_TIME. It was set by the System Settings -> Language and Region, which in this case show:

Language: English (United Kingdom)
Formats: Denmark (English)

which produces an environment like this

$ locale
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=en_DK.UTF-8
LC_TIME=en_DK.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=en_DK.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=en_DK.UTF-8
LC_NAME=en_DK.UTF-8
LC_ADDRESS=en_DK.UTF-8
LC_TELEPHONE=en_DK.UTF-8
LC_MEASUREMENT=en_DK.UTF-8
LC_IDENTIFICATION=en_DK.UTF-8
LC_ALL=

In the Error Console, type in Services.locale.regionalPrefsLocales; and see what that is.

Is the danish locale actually set up on the system? (Not just the variable.)

(In reply to Magnus Melin [:mkmelin] from comment #5)

In the Error Console, type in Services.locale.regionalPrefsLocales; and see what that is.
Array [ "en-DK" ]

Is the danish locale actually set up on the system? (Not just the variable.)
It was installed by the System Settings. But just to make sure, I ran locale-gen and both en_GB.UTF-8 and en_DK.UTF-8 were re-generated. But this didn't affect the behaviour.

To contrast, running LC_TIME=en_GB.UTF-8 shotwell causes Shotwell to show import folders with British times and dates. But LC_TIME=en_DK.UTF-8 shotwell causes them to show up with ISO times and dates. But the same things with Thunderbird (Snap or downloaded) do not. Just to make things complicated, LC_TIME=ja_JP.UTF-8 thunderbird does cause Thunderbird to change the date format.

It seems that some combinations don't work as they should, but it's not consistent.

Please let me know if there's anything I can do to investigate further.

Hmm, are you sure it's MM/DD/YYYY? en_DK is specified in CLDR as dd/MM/y.
See bug 1426907

I will read the thread in detail, but what I'm guessing now is that Thunderbird does not use the system generated locales, but has its own definitions. That's why it is inconsistent with e.g. Shotwell.

On Ubuntu 22, /usr/share/i18n/locales/en_DK says:

title      "English locale for Denmark"
source     "Danish Standards Association"
...
revision   "1.0"
date       "2000-06-29"
...
% date formats following ISO 8601-1988
d_t_fmt  "%Y-%m-%dT%T %Z"
date_fmt "%Y-%m-%dT%T %Z"
d_fmt    "%Y-%m-%d"
t_fmt    "%T"
am_pm    "";""
t_fmt_ampm  ""
week    7;19971130;4
first_weekday 2
...
% en_DK is used outside Denmark, as some sort of generic continental
% European English locale.
...

Also:

$ python3 -c "import datetime; import locale; locale.setlocale(locale.LC_TIME, 'en_DK.utf8'); print(datetime.datetime(2022, 10, 25, 6, 12, 56, 866955).strftime('%x'))"
2022-10-25

I will investigate further in the next few days. Thank you for the pointers.

Ubuntu doesn't use CLDR for that.

You need to log in before you can comment on or make changes to this bug.