Skip to content

Instantly share code, notes, and snippets.

@turboBasic
Last active December 14, 2020 04:02
Show Gist options
  • Save turboBasic/2cabc658ba67a16622a1c18d382e3d20 to your computer and use it in GitHub Desktop.
Save turboBasic/2cabc658ba67a16622a1c18d382e3d20 to your computer and use it in GitHub Desktop.
Locale Settings For Ubuntu #locale #linux

Set locale in Ubuntu

Locale settings

cat <<-EOF  >/etc/default/locale
    LANGUAGE          = en
    LANG              = en_US.UTF-8
    LC_ADDRESS        = uk_UA.UTF-8
    LC_IDENTIFICATION = uk_UA.UTF-8
    LC_MEASUREMENT    = uk_UA.UTF-8
    LC_MESSAGES       = en_US.UTF-8
    LC_MONETARY       = uk_UA.UTF-8
    LC_NAME           = uk_UA.UTF-8
    LC_NUMERIC        = en_US.UTF-8
    LC_TIME           = en_DK.UTF-8
EOF

# 2. Remove comments from appropriate records in /etc/locale.gen
# 3. locale-gen

sudo locale-gen

Check locale settings

❯ localectl status
   System Locale: LANG=en_US.UTF-8
                  LANGUAGE=en_US
                  LC_CTYPE=uk_UA.UTF-8
                  LC_NUMERIC=C.UTF-8
                  LC_TIME=en_DK.UTF-8
                  LC_COLLATE=C.UTF-8
                  LC_MONETARY=uk_UA.UTF-8
                  LC_PAPER=uk_UA.UTF-8
                  LC_NAME=uk_UA.UTF-8
                  LC_ADDRESS=uk_UA.UTF-8
                  LC_TELEPHONE=uk_UA.UTF-8
                  LC_MEASUREMENT=uk_UA.UTF-8
                  LC_IDENTIFICATION=uk_UA.UTF-8
       VC Keymap: us
      X11 Layout: us,ua
       X11 Model: pc105
     X11 Variant: altgr-intl,
     X11 Options: grp:alt_shift_toggle,grp_led:scroll


comma instead of dot
custom date and time formats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment