Open Bug 1884228 Opened 1 year ago Updated 2 months ago

Time format switched from 24h to 12h AM/PM, ignoring LC_TIME and TB locale settings (when LANGUAGE=en_US is set, Thunderbird ignores LC_TIME, whenever you change language setting in Gnome/KDE's etc. system settings, it saves and sets LANGUAGE)

Categories

(Thunderbird :: General, defect)

Thunderbird 118
x86_64
Linux
defect

Tracking

(thunderbird_esr115 affected)

REOPENED
Tracking Status
thunderbird_esr115 --- affected

People

(Reporter: lancelot, Unassigned)

Details

Attachments

(8 files)

Steps to reproduce:

Start Thunderbird with (Linux) LC_TIME environment variable set to fr_FR.utf-8 and "Date and Time" formatting set to "Regional settings locale: French (France)" and observe date/time column in Thunderbird messages, or time displayed in Calendar events.

Actual results:

Time format is 12h AM/PM

Expected results:

Time format should be 24h

Attached image LC_TIME.jpg

LC_TIME is fr_FR.utf-8

Attached image date-time-setting.jpg

Thunderbird Date and Time settings are set to Regional settings locale: French (France)

Attached image email.jpg

Email time column is in 12h AM/PM format whereas it should be 24h.

Attached image calendar.jpg

Same problem with calendar time scale.

Attached image calendar-event.jpg

Same problem with calendar events.

This problem occured a few weeks ago.
Current configuration is Thunderbird 115.8.0 on Debian GNU/Linux trixie/sid + XFCE.

Is fr_FR.utf-8 actually available for on your system? The list of available locales is locale -a

Yes it is:

$ locale -a
C
C.utf8
fr_FR.utf8
POSIX

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

Is fr_FR.utf-8 actually available for on your system? The list of available locales is locale -a

Hi Magnus, Yes it is:

$ locale -a
C
C.utf8
fr_FR.utf8
POSIX

Look closely, it's not. (You have a typo/difference for wrt the dash.)

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID

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

Look closely, it's not. (You have a typo/difference for wrt the dash.)

Well, it is true that locale -a displays "fr_FR.utf8" but, afaik (I am not an expert in internationalization though), Linux glibc internally normalizes the encoding name, by converting it to lowercase & removing most special characters, so both variants should work at that stage.

As a matter of fact, I am not mistaken, from "utf8", locale-gen has generated the proper "UTF-8" localization variables:

$localedef --list-archive
fr_FR.utf8
$ locale
LANG=fr_FR.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME=fr_FR.utf-8
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=

So I would say that fr_FR.utf-8 (and uppercase variant) is actually available for the system (other applications see it and Thunderbird used to see it before).

What do you think?

Status: RESOLVED → VERIFIED
OS: Unspecified → Linux
Hardware: Unspecified → x86_64

Did you try setting the "right" one on the console?

Status: VERIFIED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---

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

Did you try setting the "right" one on the console?

Sorry, I don't understand.

(Thanks for reopening the bug btw)

Try export LC_TIME=fr_FR.utf8 and see if it works/makes a difference

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

Try export LC_TIME=fr_FR.utf8 and see if it works/makes a difference

It doesn't make any difference :(

Status: REOPENED → UNCONFIRMED
Ever confirmed: false

Confirmed for TB 115.8.1 on openSUSE tumbleweed with german locale de_DE.UTF-8

On a machine with german locale, all dates/times are still formatted for US locale (e.g. AM/PM instead of 24h). The locale settings on the system are unchanged compared to earlier TB releases (de_DE.UTF-8). This happens when the locale settings are inherited from the OS and also with customized settings in the TB config, as described in https://support.mozilla.org/en-US/kb/customize-date-time-formats-thunderbird.

I would put the severity to "major"

The broken calendar display (AM/PM times instead of 24h times for the german locale) is still present on TB 115.9.0 (64-Bit).

OS environment:
Distributor ID: openSUSE
Description: openSUSE Tumbleweed
Release: 20240403

locale of the user environment:
thommie@localhost:~> locale
LANG=de_DE.UTF-8
LC_CTYPE=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES=de_DE.UTF-8
LC_PAPER=de_DE.UTF-8
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

seems improbable that we would have broken this on stable esr.

Flags: needinfo?(vlucaci)

Hello,

I have managed to reproduce this issue using the affected build from 2023-03-07(20240306105810) with Ubuntu 22.

Confirming that this issue also occurs with 125.0b5 (20240408161305), 115.9.0 (20240314154241) and 124.0 (20240312201328) with Ubuntu 22, using the steps provided in Description.

Flags: needinfo?(vlucaci)

Is this a regression?
Can someone find the regression range? https://mozilla.github.io/mozregression/

Other bug reports https://mzl.la/3xuypR4

Status: UNCONFIRMED → NEW
Component: Untriaged → General
Ever confirmed: true

I tried searching for a regression but I went as far back as 2017-04-7(20170407075354) and I can reproduce it with the same repro steps. I suspect that this may not be a regression

Could there be something wrong on the system for the affected locales.
I can't reproduce. It works for my normal LC_TIME, and I also tried with the ones above

sudo locale-gen de_DE.utf8
sudo locale-gen fr_FR.utf8
sudo update-locale

export LC_TIME=fr_FR.utf8

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

Could there be something wrong on the system for the affected locales.
I can't reproduce. It works for my normal LC_TIME, and I also tried with the ones above

sudo locale-gen de_DE.utf8
sudo locale-gen fr_FR.utf8
sudo update-locale

export LC_TIME=fr_FR.utf8

I dont't think so. The locale management on openSUSE and other distros is just different from Ubuntu (https://doc.opensuse.org/documentation/leap/archive/42.2/startup/html/book.opensuse.startup/cha.y2.lang.html). E.g. there is no locale-gen and no update-locale. @lancelot and I have no general problem with the locales on our distros. I believe we have a TB locale problem on SOME distros, but not all.

I was unable to reproduce this on either Debian/KDE or Ubuntu/GNOME. In both cases, I used the downloaded 115.10.1 tarball from thunderbird.net and LANG=fr_FR.UTF-8.

@lancelot, can you tell me which OS and desktop environment you're running? Also I assume you've set your system wide settings to show a 24h time format. And how is thunderbird installed? Can you try running the latest ESR from an unpacked tarball from thunderbird.net? After switching your locale, did you log out and back in (or a reboot)?

Flags: needinfo?(lancelot)

(In reply to Heather Ellsworth from comment #24)

@lancelot, can you tell me which OS and desktop environment you're running? Also I assume you've set your system wide settings to show a 24h time format. And how is thunderbird installed? Can you try running the latest ESR from an unpacked tarball from thunderbird.net? After switching your locale, did you log out and back in (or a reboot)?

I will try to do the same for my distro (openSUSE Tumbleweed) on a separate virtual machine. Will also contact the maintainers of the Mozilla packages at SUSE (mozilla-bugs@suse.de).

(In reply to Heather Ellsworth from comment #24)

I was unable to reproduce this on either Debian/KDE or Ubuntu/GNOME. In both cases, I used the downloaded 115.10.1 tarball from thunderbird.net and LANG=fr_FR.UTF-8.

@lancelot, can you tell me which OS and desktop environment you're running?

Hi Heather, as mentioned earlier, I currently use Debian GNU/Linux trixie/sid + XFCE.

Also I assume you've set your system wide settings to show a 24h time format.

Yes; and all other programs work fine.

And how is thunderbird installed? Can you try running the latest ESR from an unpacked tarball from thunderbird.net?

I currently use Thunderbird 115.10.1, which was installed by apt.
Same issue when I create a new user and I install the latest tarball locally.

(Also, I tested a VM with a Ubuntu guest where LC_TIME=fr_FR.UTF-8 and there was no issue there, as suggested by Thommie, the
problem may only occur with some distributions).

After switching your locale, did you log out and back in (or a reboot)?

Since this locale issue appeared on Thunderbird, I logged out then in and rebooted several times yes. It doesn't change anything.

Flags: needinfo?(lancelot)

I have two computers (both running Manjaro with KDE Plasma 6), which I have configured practically identical aside from one running X11 and one running wayland. Since updating both two days ago, the X11 machine has this issue. I am using German so it is not isolated to French. No other software has this issue.

If there is any command, I could run on both machines to try to find a difference that could help you fix this, please let me know.

I still cannot reproduce this. I've tried:

  • Manjaro with KDE6 - both X11 and Wayland
  • Opensuse tumbleweed with XFCE and X11
  • Debian trixie with XFCE - both X11 and Wayland

Each of the VMs have the environment:

  • Downloaded the latest 115 tarball from thunderbird.net, unpacked it, and running the binary from here
  • Installed a non-english langpack. In this case de_DE.UTF-8 so that it shows up in locale -a
  • Run Thunderbird and add the German langpack in the Settings -> General tab (need to reboot Thunderbird). The regional setting will say in parentheses what region matches the LANG environment variable on the host, and it can be different from the language Thunderbird is currently running in (as is the case with lancelot's date-time-setting.jpg screencap).

Test cases where I expected a reproducer:

  • If the system has LANG set to English (echo $LANG gives en_US.UTF-8) and then I launch Thunderbird with German (LANG=de_DE.UTF-8 ./thunderbird), the Application locale is set to English (United States), my time is in 24h format. If I set the Regional setting to Germany (Germany), close and restart Thunderbird with the same LANG=de_DE.UTF-8 ./thunderbird, my time is still in 24h format. If I set the Application locale back to English and restart Thunderbird with the same LANG=de_DE.UTF-8 ./thunderbird, my time is still in 24h format.
  • If the system has LANG set to English and then I launch thunderbird with just ./thunderbird so that I'm not setting the LANG to German at Thunderbird runtime, then my time is in 12h format. Both the Application locale and Regional settings locale are English (United States). With either the Application or Regional settings checked, I close Thunderbird and launch it with LANG=de_DE.UTF-8 ./thunderbird (the system LANG is still en_US.UTF-8) and my time is back in 24h format.

So what I see is that any time Thunderbird is launched with German LANG being set at Thunderbird runtime, the time is in the 24h format.

Since I cannot reproduce this (and have sunk quite a bit of time into trying), I suggest you try to get any scenario to show you 24h time in Thunderbird.

  • Try with the latest 115 Thunderbird tarball downloaded from thunderbird.net
  • Try with the Thunderbird language set in the non-english variety (which I also tested).
  • Try with the system LANG set to non-english (which I also tested). Note that to change the default language of a Manjaro system with KDE, you may need to also change ~/.config/plasma-localerc.
  • Make sure your system timezone is set to CET (or whichever timezone matches the locale you're testing).

If you can get a 24h time display in Thunderbird with any setup, then work backwards to see where it breaks for you and provide me with some reproducer steps.

Lancelot, would you be able to try my test cases and above suggestions in my previous comment and let me know what you find?

Flags: needinfo?(lancelot)

(In reply to Heather Ellsworth from comment #31)

Lancelot, would you be able to try my test cases and above suggestions in my previous comment and let me know what you find?

Heather, thanks for running all these tests. This is indeed puzzling. I will try your test cases asap and keep you posted.

Flags: needinfo?(lancelot)

I have managed to reproduce this bug reliably on Manjaro (KDE, X11).

There are 3 parts to this puzzle:

  1. When LANGUAGE=en_US is set, Thunderbird ignores LC_TIME.
  2. KDE does not set env LANGUAGE variable by default.
  3. Whenever you change language setting in KDE's system settings, it saves and sets LANGUAGE.

Thank you for finding this.
My LANGUAGE is set to de:en_US, so it containing en_US is apparently enough to trigger this, even if it is not the first one listed.
Overriding LANGUAGE to just de works.

Thanks to Dmitry for the deep dive. I checked my lang setting on the current openSUSE Tumbleweed Release 20240629. While the global system language during installation was DE, I have a mixed environment setting in the user environment, similar to Richard on Manjaro:

LANGUAGE=de:en_US
LC_TIME=de_DE.UTF-8

I dont know why and the mix "de:en_US" makes no sense at first glance, it should be de:de_DE. But, on the other hand, the question is why Thunderbird does ignore the LC_TIME setting which has the correct language. Therefore I would still describe this as a Thunderbird bug.

This issue seems to be fixed now, at least on openSUSE Tumbleweed

Distributor ID: openSUSE
Description: openSUSE Tumbleweed
Release: 20240724

and with Thunderbird 115.13.0. Can any of the reporters confirm this?
@lancelot @Dmirty Valter @Richard Kellnberger

Status: NEW → RESOLVED
Closed: 1 year ago11 months ago
Flags: needinfo?(lancelot)
Resolution: --- → FIXED

(In reply to Thommie Rother from comment #37)

This issue seems to be fixed now, at least on openSUSE Tumbleweed

Distributor ID: openSUSE
Description: openSUSE Tumbleweed
Release: 20240724

and with Thunderbird 115.13.0. Can any of the reporters confirm this?
@lancelot @Dmirty Valter @Richard Kellnberger

AFAIC, the issue is still there with TB 115.13.0 on Debian trixie/sid :(

Status: RESOLVED → REOPENED
Flags: needinfo?(lancelot)
Resolution: FIXED → ---

(In reply to Thommie Rother from comment #37)

This issue seems to be fixed now, at least on openSUSE Tumbleweed

Distributor ID: openSUSE
Description: openSUSE Tumbleweed
Release: 20240724

and with Thunderbird 115.13.0. Can any of the reporters confirm this?
@lancelot @Dmirty Valter @Richard Kellnberger

The bug is still present 115.13.0 in Arch Linux.

Maybe some other change in Tumbleweed has affected the LANGUAGE variable for you?

(In reply to Dmitry Valter from comment #39)

The bug is still present 115.13.0 in Arch Linux.
Maybe some other change in Tumbleweed has affected the LANGUAGE variable for you?

Yes. Seems I am only a lucky guy with my distro, while the original bug or "misinterpretation" from TB-side is still present. My current locale is:

thommie@locutus:~> printenv | grep LANG
LANGUAGE=de:en_US
LANG=de_DE.UTF-8

thommie@locutus:~> locale
LANG=de_DE.UTF-8
LC_CTYPE=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES=de_DE.UTF-8
LC_PAPER=de_DE.UTF-8
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

and system-wide

thommie@locutus:~> less /etc/sysconfig/language | grep LANG
# Local users will get RC_LANG as their default language, i.e. the
# environment variable $LANG . $LANG is the default of all $LC_*-variables,
# Root uses this variable only if ROOT_USES_LANG is set to "yes".
RC_LANG="de_DE.UTF-8"
# Again, ROOT_USES_LANG must be set to "yes", if an effect on the superuser
ROOT_USES_LANG="ctype"
# Workaround for missing forward of LANG and LC variables
INSTALLED_LANGUAGES="en_GB,de_DE"

Summary: Time format switched from 24h to 12h AM/PM, ignoring LC_TIME and TB locale settings → Time format switched from 24h to 12h AM/PM, ignoring LC_TIME and TB locale settings (when LANGUAGE=en_US is set, Thunderbird ignores LC_TIME, whenever you change language setting in KDE's system settings, it saves and sets LANGUAGE)

Hi Magnus, the issue may happen even without KDE, as reported initially.

(In reply to lancelot from comment #41)

Hi Magnus, the issue may happen even without KDE, as reported initially.

Yes, the issue has to do with the way how locales are defined in different distros, it has no dependency with the used GUI environment (KDE or Gnome etc). In my case (openSUSE) the issue appears to be fixed now while Lancelot still has this problem.

Summary: Time format switched from 24h to 12h AM/PM, ignoring LC_TIME and TB locale settings (when LANGUAGE=en_US is set, Thunderbird ignores LC_TIME, whenever you change language setting in KDE's system settings, it saves and sets LANGUAGE) → Time format switched from 24h to 12h AM/PM, ignoring LC_TIME and TB locale settings (when LANGUAGE=en_US is set, Thunderbird ignores LC_TIME, whenever you change language setting in Gnome/KDE's etc. system settings, it saves and sets LANGUAGE)

Same problem in TB 128.8.0.

env:
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_MESSAGES=en_US.UTF-8
LC_COLLATE=de_DE.UTF-8
LC_CTYPE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8

TB conf:
intl.regional_prefs.use_os_locales = true

Result:
Times are shown in AM/PM instead if 24h format.

Also setting german date/time format in config surface no change occurs.
This means at the moment the handling of locales is massive defect in TB.

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

Attachment

General

Creator:
Created:
Updated:
Size: