A locale is a set of environmental variables that defines the language, nation, and character encoding settings (or some other particular variant preferences) to your purposes and shell session on a Linux system. These environmental variables are utilized by system libraries and locale-aware purposes on the system.
Locale impacts issues such because the time/date format, the primary day of the week, numbers, foreign money and plenty of different values formatted in accordance with the language or area/nation you set on a Linux system.
On this article, we are going to present tips on how to view your presently put in system locale and tips on how to set system’s locale in Linux.
The right way to View System Locale in Linux
To view details about the present put in locale, use the locale or localectl utility.
$ localectl standing
System Locale: LANG=en_US.UTF-Eight
VC Keymap: n/a
X11 Format: us
X11 Mannequin: computer105
You possibly can view extra details about an environmental variable, for instance LC_TIME, which shops the time and date format.
$ locale -k LC_TIME
d_t_fmt=”%a %d %b %Y %r %Z”
date_fmt=”%a %b %e %H:%M:%S %Z %Y”
To show an inventory of all out there locales use the next command.
$ locale -a
The right way to Set System Locale in Linux
If you wish to change or set system native, use the update-locale program. The LANG variable lets you set the locale for your complete system.
The next command units LANG to en_IN.UTF-Eight and removes definitions for LANGUAGE.
$ sudo update-locale LANG=LANG=en_IN.UTF-Eight LANGUAGE
$ sudo localectl set-locale LANG=en_IN.UTF-Eight
To configure a particular locale parameter, edit the suitable variable. As an example.
$ sudo update-locale LC_TIME=en_IN.UTF-Eight
$ sudo localectl set-locale LC_TIME=en_IN.UTF-Eight
You could find world locale settings within the following information:
/and so forth/default/locale – on Ubuntu/Debian
/and so forth/locale.conf – on CentOS/RHEL
These information can be edited manually utilizing any of your favourite command line editors similar to Vim or Nano, to configure your system locale.
To set a worldwide locale for single person, you’ll be able to merely open ~/.bash_profile file and add the next traces.
For extra data, see the locale, update-locale and localectl man pages.
$ man locale
$ man update-locale
$ man localectl
That’s all! On this brief article, now we have defined tips on how to view and set system native in Linux. When you’ve got any questions, use the suggestions kind under to achieve us.