SSH Language Localization

June 7, 2012 — Leave a comment

When you get a new VPS, you’ve got a powerful new system that is a server all unto yours. There is quite a bit of customization you can do to make it suite your needs. Today, I am going to show you how to change the language of your SSH terminal.

Changing your VPS language setting allows you to type and sort by special characters not available in English. But more than that, it is language localization. You pick not only your language, but your country as well. This allows the server to reset date formats, use of commas and points in numbering systems, display options, etc. Bear in mind that changing VPS language settings won’t translate things such as file names or contents of files.

In addition, most GNU programs on your server use localization, wherein they customize their interface based on the VPS language localization settings. Intelligent applications using internationalization can greatly reduce the difficulty of interfacing with a server for non-English speakers.

While logged into your server via SSH, you can see what the current language setting is by running the following command:

The output of the command will be something like this:

en_US is the language code (English) followed by the country code (United States).

To change the language of your system–as well as all the other parameters above–you will modify the LANG. To see list of all the supported locales, run:

You’ll notice that names on the list are named with the format: Language_Country. Simply looks for the two letter code for language and country that you want. For example, if you want to set it to Spanish/Puerto Rico, you would select: es_PR. If you want to set it to Farsi, you would use: fa_IR

Check out this handy guide to look up the right code for your language and location:

Once you have picked out the language and location you want to use, you will need to edit the following file:

And then simply modify the line the reads something like this:

You will need to close your SSH session and restart a new session for the changes to take effect.

*Note: If you are using Terminal on a Mac, you may need to also type the following for your session to load the updated configuration:

If you are having trouble getting these changes to take effect and show up when you initiate another locale command, then check that the default language is not set. In Nano, look at the entire file. Which lines are preceded by hash marks (#)? Those lines are designated as “comments” and not read by programs accessing the file. For example:

In this example, the LANG will always be the default (C). To change this, switch the line that is read by erasing and creating hash marks:

Now the session configuration will be based on the first line–not the fourth–and you can replace the language/location information as desired.


Here is a ‘Before’ language change:

Here is an ‘After’ language change (to Farsi):

Note about this article

This article is one I had written for the ServInt blog as part of the ‘Tech bench’ series. You can view it on the ServInt blog here. They are using my article with my permission.

Change Log:

  • 06/26/13 | More verbage changes

  • 06/20/12 | Revised for more details

Jacob "Boom Shadow" Tirey

Posts Twitter

A linux web hosting administrator, a professional production sound man, and a renegade cop without nothing left to lose.... Ok, that last part is made up. In all seriousness, my passion in life is to help people; whether that be with help running their sites or with their productions. The name 'Boom Shadow' was given to me by a great group of filmmakers called Star Wipe Films. back in 2005 and has been with me since. I hope my site is helpful to you, and if there's something you need, drop me a line!