Score:0

How to change the first day of week on Ubuntu 22.04?

in flag

I want to use the en_US locale but I want to change the first day of week from Sunday to Monday. I have found a way to do this for older versions of Ubuntu but it seems that the configuration has changed recently with Ubuntu 22.04.

When I open /usr/share/i18n/locales/en_US I see the following under LC_TIME:

LC_TIME
abday   "Sun";"Mon";"Tue";"Wed";"Thu";"Fri";"Sat"
day "Sunday";/
    "Monday";/
    "Tuesday";/
    "Wednesday";/
    "Thursday";/
    "Friday";/
    "Saturday"

week 7;19971130;1
abmon   "Jan";"Feb";/
    "Mar";"Apr";/
    "May";"Jun";/
    "Jul";"Aug";/
    "Sep";"Oct";/
    "Nov";"Dec"
mon "January";/
    "February";/
    "March";/
    "April";/
    "May";/
    "June";/
    "July";/
    "August";/
    "September";/
    "October";/
    "November";/
    "December"

Can I simply change the order of abday and day? What is week and do I need to change it also?

Is this even the correct way to do it?

Hannu avatar
ca flag
`$ less /usr/share/i18n/locales/sv_SE` -> `first_weekday 2` just before `END LC_TIME` - copy `en_US` to a new file, then look at https://superuser.com/a/1750342/346288 to see how to enable it.
in flag
@Hannu that didn't work for me. I added `first_weekday 2` just before `END LC_TIME` but the the calendar still shows Sunday as the first day. I logged out and back in after that.
Hannu avatar
ca flag
Wicked, I know I had that working - it isn't now, can't re-create what I wrote. :-(
Gunnar Hjalmarsson avatar
uz flag
@Hannu: That superuser answer does not work since the new locale name is neither in `/etc/locale.gen` nor `/usr/share/i18n/SUPPORTED`. But besides that, a locale name which doesn't follow the pattern `ll_CC.UTF-8@modifier` is deemed to be problematic.
Score:1
uz flag

I would edit the existing locale directly.

  1. Open /usr/share/i18n/locales/en_US for editing.

  2. Add the line

    first_weekday 2
    

    right before the line

    END LC_TIME
    
  3. Save.

  4. Generate the modified locale:

    sudo locale-gen en_US.UTF-8
    
alexsmail avatar
cz flag
You should also run ```sudo update-locale LC_TIME=en_US.UTF-8```
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.