Installing new locales on Debian

Published: 7 years ago web dev

Because I never remember how to do this, here's the process for installing new locales on Debian. In this case we will be installing a Spanish locale.

Firstly make sure you have the locales package installed, otherwise install it:

sudo apt-get install locales

Confirm the locale isn't already installed with:

locale -a

Add the new local:

sudo local-gen es_ES.UTF-8

If you're using it on a website you need to restart Apache etc. for the new locale to be picked up:

sudo service apache2 restart