Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.19k stars 685 forks source link

Clock widget, mismatched locale #2982

Open alttabber opened 6 months ago

alttabber commented 6 months ago

The clock widget and the calendar have mismatched locales: the calendar shows up with the correct locale, meanwhile, the clock itself is stuck in english. Forcing a locale in the config does nothing.

OS: Arch Wybar version: Git Output of locale:

LC_CTYPE="it_IT.utf8"
LC_NUMERIC="it_IT.utf8"
LC_TIME="it_IT.utf8"
LC_COLLATE="it_IT.utf8"
LC_MONETARY="it_IT.utf8"
LC_MESSAGES="it_IT.utf8"
LC_PAPER="it_IT.utf8"
LC_NAME="it_IT.utf8"
LC_ADDRESS="it_IT.utf8"
LC_TELEPHONE="it_IT.utf8"
LC_MEASUREMENT="it_IT.utf8"
LC_IDENTIFICATION="it_IT.utf8"
LC_ALL=
aimixsaka commented 6 months ago

Where's the log output of running waybar directly from terminal? May forget to run locale-gen?

alttabber commented 6 months ago

Where's the log output of running waybar directly from terminal? May forget to run locale-gen? May forget to run locale-gen?

Re-running locale-gen and restarting was the first thing I tried, and didn't help, and if that was the issue, I guess manually overriding it in the config.json would have fixed it, which it didn't, and I would expect both the clock its calendar tooltip to default to C, not one to use the correct locale and the other C.

Here's a sample output:

[2024-03-04 17:36:48.954] [info] Using configuration file /home/artix/.config/waybar/config
[2024-03-04 17:36:48.955] [info] Unable to receive desktop appearance: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Interfaccia «org.freedesktop.portal.Settings» inesistente sull'oggetto nel percorso /org/freedesktop/portal/desktop
[2024-03-04 17:36:48.955] [info] Using CSS file /home/artix/.config/waybar/style.css
[2024-03-04 17:36:48.966] [info] Hyprland IPC starting
[2024-03-04 17:36:48.966] [warning] Mapping is not an object
[2024-03-04 17:36:48.979] [warning] Waybar has been built without rfkill support.
[2024-03-04 17:36:49.140] [info] Bar configured (width: 2520, height: 41) for output: HDMI-A-2
[2024-03-04 17:37:31.064] [info] Quitting.

Nothing that even remotely mentions the clock or any locale errors. Debug and trace outputs aren't any more helpful: just all the attempts to find a config file and display stuff.

alttabber commented 6 months ago

Also, I can confirm that the problem goes away if I use the stable version instead of the git version.

alttabber commented 6 months ago

I've just finished a git bisect.

This commit introduced the bug: https://github.com/Alexays/Waybar/commit/86a38980e4a2eb242379b9221b06784d3e0d3eef (and of course it's a commit with 700 changes, I'm not gonna investigate exactly what happened there.) @Alexays

LukashonakV commented 5 months ago

Let me check

FakeMichau commented 5 months ago

Having the same issue myself. LC_TIME is just being ignored. Setting have_chrono_timezones = false forces it to work as intended.

bcyran commented 5 months ago

I experience the same problem on v0.10.0. Calendar is displayed with the correct locale but clock (%a and %B specifically) is stuck in English even when locale is explicitly set in the config. Nothing related in logs.

K14D commented 5 months ago

Can confirm problems with locale (fallback to English) after update to v.0.10.0.

violent1401 commented 5 months ago

Also has problems with locale after update to v0.10.0. (English by default instead of russian)

lilydjwg commented 5 months ago

It seems that locale-awareness for the C++20 chrono module isn't implemented. I still get the English version even I add the L letter according to the format doc.

I edited the wrong widget (I have one clock per output but edited for a disconnected one). With an L it works for me: {:L%Y-%m-%d %H:%M:%S %A}.

alttabber commented 5 months ago

~It seems that locale-awareness for the C++20 chrono module isn't implemented. I still get the English version even I add the L letter according to the format doc.~

I edited the wrong widget (I have one clock per output but edited for a disconnected one). With an L it works for me: {:L%Y-%m-%d %H:%M:%S %A}.

Same here. Guess this one just requires an update on the documentation, in the meantime I've hot fixed the wiki page.

Not closing since someone has to come up with the final text and update the man pages, and I'm not that someone. Or maybe Alexays can decide to add that L to every string in it isn't there.