8.1. Locale About

8.1.1. Rationale

  • i18n = internationalization

  • l10n = localization

8.1.2. Syntax

  • language

  • variant

  • encoding

en_US.UTF-8

8.1.3. Get Locale

$ locale
LANG=""
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
$ env |grep LC_
LC_ALL=en_US.UTF-8
LC_CTYPE=UTF-8

8.1.4. Set Locale

$ echo 'export LC_ALL=en_US.UTF-8' >> ~/.profile
ls -R /etc/locale*

8.1.5. Locale in Python

import locale