24

I'm trying to have everything ready to install a new desktop with a few command line instructions. Unfortunately, to install the language packages, I couldn't find how to do it.

I can run

gnome-language-selector

But it doesn't seems to be usable in command line directly. I need to go on with clicks...

An other thing that could be done is that I do those clicks and find out which packages have been installed and read the changes in /etc/environment and /etc/default/locale (and other /etc/... file?) but the list of packages is probably different depending on the packages installed (Firefox, Thunderbird, LibreOffice, Gnome, ...)

Is there a tool for that? Like let's say :

gnome-language-selector --install fr

or a package that has all necessary dependencies :

sudo apt-get install super-language-pack-fr

Thanks,

4 Answers 4

24

For desktop you can

sudo apt-get install language-pack-[cod] language-pack-gnome-[cod] language-pack-[cod]-base language-pack-gnome-[cod]-base 

But each applications can have its language pack. To know the packages to be installed try:

check-language-support -l [cod]

For example:

check-language-support -l fr
6
  • Thank you, but this doesn't install all that would be installed by gnome-language-selector; in my case : libreoffice-l10n-fr language-pack-gnome-fr language-pack-fr-base hunspell-fr language-pack-gnome-fr-base firefox-locale-fr mythes-fr libreoffice-help-fr hyphen-fr wfrench language-pack-fr thunderbird-locale-fr
    – samb
    Jun 12, 2012 at 14:49
  • There are no language-support-writing-[cod] package available for 12.04 ... It disappeared with 11.10.
    – samb
    Jun 12, 2012 at 14:55
  • 1
    Edited. Please, check if the last additions are useful...:)
    – jasmines
    Jun 12, 2012 at 15:17
  • 1
    Excellent! The final command is sudo apt-get install $(check-language-support -l fr)
    – samb
    Jun 12, 2012 at 15:51
  • 1
    Or yes | sudo apt-get install `check-language-support -l fr` Jun 18, 2013 at 19:52
15

Auto install all dependecies:

sudo apt-get -y install `check-language-support -l fr`

where fr is the desired language code.

1
  • 1
    hint: the apt-get install can take the -y option. No need to use yes and pipe.
    – hytromo
    Jun 4, 2014 at 12:56
4

First, you need to edit the locale.gen file.

sudo vim /etc/locale.gen

Then looking for the language pack you need and remove the comment mark, for example, if I want to install zh_CN.GBK GBK zh_CN.UTF8, I just remove the # symbol in these lines, alternatively, you can also add your lines directly into the file. Finally, run:

sudo locale-gen

This is the simplest way I found online.

0

To add french language to Ubuntu using the Software Center:

Install via the software center

Quoted from there:

This metapackage depends on all packages that provide native language support for applications. (like spell checkers, dictionaries, OpenOffice and Mozilla locale packages, etc.).

If you also want your applications and the desktop to be translated, please additionally install language-pack-fr.

So it may not have the language for certain programs.


To add a language to Ubuntu using the Command line:

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the commands below.

sudo apt-get install language-support-fr
1
  • Thank you, but this doesn't install all that would be installed by gnome-language-selector; in my case : libreoffice-l10n-fr language-pack-gnome-fr language-pack-fr-base hunspell-fr language-pack-gnome-fr-base firefox-locale-fr mythes-fr libreoffice-help-fr hyphen-fr wfrench language-pack-fr thunderbird-locale-fr
    – samb
    Jun 12, 2012 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.