Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LC_CTYPE replaced with LC_ALL #3492

Merged
merged 1 commit into from
Nov 9, 2021
Merged

LC_CTYPE replaced with LC_ALL #3492

merged 1 commit into from
Nov 9, 2021

Conversation

JezerM
Copy link
Contributor

@JezerM JezerM commented Nov 1, 2021

Changes

  • LC_CTYPE replaced with LC_ALL, in setlocale

Explanation

As the docs explain in textclock widget, GLIB should format the date according to the locale.

In my case, the locale is LANG = es_NI.UTF-8 and LANGUAGE = es_ES. And therefore, date format should be in spanish, but AwesomeWM does not format in that way, it's just english.

In the image below, you can see the actual behavior (wibar above), which uses setlocale(LC_CTYPE, ""), and the expected behavior (wibar below), that uses setlocale(LC_ALL, ""), with wibox.widget.textclock("%a %B %Y - %H:%M")

Screenshot_2021-11-01-55_675x568

@actionless
Copy link
Member

why?

@sclu1034
Copy link
Contributor

sclu1034 commented Nov 3, 2021

why?

They want date and time to be shown using a Spanish locale and set the appropriate settings/environment variables.
But Awesome (actually, GLib's DateTime) ignores those and displays English text.

Side note: The proposed patch is actually something that GLib recommends doing to be user-locale aware.

@actionless
Copy link
Member

The proposed patch is actually something that GLib recommends doing to be user-locale aware.

that kind of link was smth i was expecting to be present as PR reasoning :)
thanks for looking it up!

@codecov
Copy link

codecov bot commented Nov 3, 2021

Codecov Report

Merging #3492 (70c3576) into master (50b9b10) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3492      +/-   ##
==========================================
- Coverage   90.25%   90.25%   -0.01%     
==========================================
  Files         822      822              
  Lines       53558    53561       +3     
==========================================
  Hits        48339    48339              
- Misses       5219     5222       +3     
Flag Coverage Δ
gcov 90.25% <100.00%> (-0.01%) ⬇️
luacov 93.31% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
awesome.c 81.57% <100.00%> (ø)
event.c 71.94% <0.00%> (-1.10%) ⬇️
spawn.c 86.16% <0.00%> (+0.06%) ⬆️
tests/examples/screen/template.lua 96.73% <0.00%> (+0.21%) ⬆️
lib/wibox/widget/imagebox.lua 96.42% <0.00%> (+0.89%) ⬆️

@actionless actionless merged commit bf74f24 into awesomeWM:master Nov 9, 2021
actionless pushed a commit to actionless/awesome that referenced this pull request Jun 29, 2022
actionless pushed a commit to actionless/awesome that referenced this pull request May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants