10

I have the system default set to en_US.UTF-8. But (among other nonsensical things) this makes Sunday (a weekend day) the first day of the week in calendars.

I want to use the LC_TIME variable from en_DK.UTF-8 while keeping the en_US.UTF-8 variables for everything else.

I have generated both en_US.UTF-8 and en_DK.UTF-8 and I used to be able to simply edit /etc/default/locale by adding the line LC_TIME="en_DK.UTF-8".

But this is no longer working and I have no idea why. So how can I get this working again?

Before people start telling me to hack on the en_US.UTF-8 text file (at /usr/share/i18n/locales), this doesn't work either because updates periodically reset this. I want to know what the "proper" way of configuring for this is.

Ravexina
  • 55,668
  • 25
  • 164
  • 183
user308393
  • 1,297

2 Answers2

6

Here is what I would do:

  1. check which locales are enabled:

    grep -v '^#' /etc/locale.gen
    

    You should at least get (Or something similar):

    en_US.UTF-8 UTF-8
    
  2. Enable it if it's not and disable unnecessary locales by commenting those lines.

  3. generate locales:

    sudo locale-gen
    
  4. set default locales:

    sudo localectl set-locale LANG=en_US.utf8 LC_TIME=en_DK.UTF-8
    
  5. check All important files like: .profile, .bashrc and other startup files to make sure nothing is overwriting our configurations.

it should work.

Ravexina
  • 55,668
  • 25
  • 164
  • 183
1

Open ~/.profile for editing and add this line:

export LC_TIME=en_DK.UTF-8

On Ubuntu GNOME you may also need to run this command:

gsettings reset org.gnome.system.locale region
Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94
  • I tried this before posting here. Unfortunately it didn't work. The problem appears to be GNOME DE overriding everything. GNOME is doing everything it can to prevent me from changing date format. – user308393 May 26 '17 at 21:32
  • 1
    @user308393: Please see the edited answer. I came to think of bug #1662031, but editing ~/.profile proved to be a workaround of that bug too. – Gunnar Hjalmarsson May 26 '17 at 23:13