Configuring constant LANG variable

Published 2014-02-21, last edit 2019-02-24

After setting your correct locale in the etc/locale.gen file and running locale-gen, your system wide language gets set in Linux. Some applications, however, reference the LANG variable in order to determine language type. One in particular that I am fond of is sublime text. This isn’t an issue until you install the package manager - which you will probably want to do eventually.

A temporary fix, as the error logged will inform you, is to set the LANG variable either before or with the startup of sublime text.

However, this may not always be viable, and can be annoying. There are two solutions to set this variable upon system startup.

A “hacky” way to get around this problem would be to set the LANG variable within your .bashrc file, as such:

export LANG =“en\US.UTF-8”

However, the above only sets the variable for your user/login session.

To set the LANG variable system wide(the prefferred method), edit or create the file /etc/locale.conf to contain:

LANG =“en\US.UTF-8”

And upon restart your LANG variable will be set correctly.