How to set LC_TIME variable to en_DK while keeping en_US the system default for other variables?

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.


Solution 1:

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.

Solution 2:

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