mikaela.github.io/n/localectl.md

4.9 KiB
Raw Permalink Blame History

Quick notes on localectl settings

{page.excerpt}

Automaattinen sisällysluettelo / Automatically generated Table of Contents

Ready commands

TL;DR:

sudo localectl set-keymap fi
sudo localectl set-locale fi_FI.UTF-8
sudo localectl set-x11-locale fi

Finland compatible internationalish English

sudo localectl set-locale LANG=en_IE.UTF-8 LC_TIME=en_DK.UTF-8 LC_MONETARY=fi_FI.UTF-8 LC_NAME=fi_FI.UTF-8 LC_TELEPHONE=fi_FI.UTF-8
  • Everything will be in English, but time will be in ISO 8601, financial units use Finnish separators, names are sorted according to Finnish alphabet (a, …, x, y, z, å, ä, ö) and phone numbers begin with the Finnish +358 prefix.

Explanations

  • LANG is the language and defaults for other variables if they are unset. en_DK gives ISO 8601 date format for everything respecting LC_TIME.
    • LANG=en_IE date returns Sun 02 Jun 2024 11:05:04 EEST, while LANG=en_DK date returns 2024-06-02T11:05:04 EEST.
  • LC_MONETARY sets the currency and how sums of it are managed.
  • LC_NAME sets name format and I prefer Finnish (just the name) to Irish which probably has M{r,s,rs} and I hate them being gendered and I doubt it understands Mx.
  • LC_TELEPHONE sets telephone number format and I set it to fi_FI as it defaults international numbers to +358 and I am more likely to be typing Finnish numbers than Irish. I imagine it can affect office tools, and its here more of just in case.

And naturally to use these locales, they must be compiled.

So /etc/locale.gen must include the lines

en_DK.UTF-8 UTF-8
en_IE.UTF-8 UTF-8
fi_FI.UTF-8 UTF-8

and as always, after editing that file, you must run sudo locale-gen.

(Debian & deriative users, you have dpkg-reconfigure locales that merges the editing and locale-gen and that is probably what you are supposed to use.)

It seems like I didnt even say anything about that UTF-8 part, but its 2024 and everything is UTF-8 (or your things are horribly broken and the rest of the world hates you).

Sources/thanks:

  • Arch Wiki: Locale, LC_TIME
  • Locale Helper: en_IE
  • Locale Helper: fi_FI
  • Wikipedia: UTF-8
    • Random misplaced advice: disable charset fallback in your IRC client and be UTF-8 only! You will see when someone is not using UTF-8 and wont submit useless bug reports to bots/bridges/whatever that are UTF-8 only (as supporting every charset is impossible, since IRC has nothing to declare character set, and there is zero reason why you woulnt be using UTF-8! Well nowadays some have IRCv3 UTF8ONLY ISUPPORT token).
  • ISO 8601
    • You should read it or at least be aware of it especially if you are in contact with people from other countries and even more if you are in international communities trying to get anything done with anything that has to do with time or date!

2019-12-27: I dont see LANGUAGE mentioned here, but it was blocking me from changing language of GNOME and sudo dpkg-reconfigure locales in the end gave me *** update-locale: Warning: LANGUAGE (en_US:en) is not compatible with LANG (fi_FI.UTF-8). Disabling it..

Either I was wrong on it being list of fallback languages I wish to use, or GNOME has different view on it, but as I think I have seen errors related to it before, I will drop LANGUAGE from the variables I set.


2024-04-04: export LANGUAGE=eo:fi:en in a file read by my zshrc works fine as it gets read before my startsway anyway.


2024-06-02: fixed a lot of language, practically rewrote the page.