Posts Tagged ‘localization’

deb Linux: How to add support for Bulgarian, Russian, Belarusian, Ukrainian, Serbian, Macedonian, Bosnian language cyrillic localization to Xfce, GNOME, KDE Desktop

Monday, March 18th, 2013

If just installed Ubuntu or Xubuntu and choose as a default language English by mistake and you happen to live in Bulgaria, Russia, Ukraine, Belarus or any other cyrillic speaking / writting country and you want to make the desktop graphical environment to display menus in mother language Cyrillic. Here is how;

To add cyrillic localization, native support in GUI environment for major Dsektop Graphic Environments (XFCE, GNOME, KDE …) run in terminal:

For Bulgarian Cyrillic language Desktop support:

linux:~# apt-get install language-pack-bg

Четене на списъците с пакети… Готово
Изграждане на дървото със зависимости      
Четене на информацията за състоянието… Готово
Следните допълнителни пакети ще бъдат инсталирани:
  firefox-locale-bg language-pack-bg-base
Следните НОВИ пакети ще бъдат инсталирани:
  firefox-locale-bg language-pack-bg language-pack-bg-base
0 актуализирани, 3 нови инсталирани, 0 за премахване и 2 без промяна.
Необходимо е да се изтеглят 0 B/1048 kB архиви.
След тази операция ще бъде използвано 3533 kB допълнително дисково пространство.
Искате ли да продължите [Y/n]? Y
Selecting previously unselected package language-pack-bg-base.
(Reading database … 287291 files and directories currently installed.)
Unpacking language-pack-bg-base (from …/language-pack-bg-base_1%3a12.04+20130128_all.deb) …
Selecting previously unselected package language-pack-bg.
Unpacking language-pack-bg (from …/language-pack-bg_1%3a12.04+20130128_all.deb) …
Selecting previously unselected package firefox-locale-bg.
Unpacking firefox-locale-bg (from …/firefox-locale-bg_19.0.2+build1-0ubuntu0.12.04.1_i386.deb) …
Processing triggers for software-center …
Updating software catalog…this may take a moment.
INFO:softwarecenter.db.pkginfo_impl.aptcache:aptcache.open()
Software catalog update was successful.
Инсталиране на firefox-locale-bg (19.0.2+build1-0ubuntu0.12.04.1) …
Инсталиране на language-pack-bg (1:12.04+20130128) …
Инсталиране на language-pack-bg-base (1:12.04+20130128) …
Generating locales…
  bg_BG.UTF-8… up-to-date
Generation complete.
 

Two packages language-pack-bg and language-pack-bg-base packages add to system localization files which in Linux are in the format of .mo files. Here is list of 2 packs file content:

 

linux:~# dpkg -L language-pack-bg

/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/language-pack-bg
/usr/share/doc/language-pack-bg/copyright
/usr/share/doc/language-pack-bg/changelog.gz
/usr/share/locale-langpack
 

 

linux:~# dpkg -L language-pack-bg-base

/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/language-pack-bg-base
/usr/share/doc/language-pack-bg-base/copyright
/usr/share/doc/language-pack-bg-base/changelog.gz
/usr/share/locale-langpack
/usr/share/locale-langpack/bg
/usr/share/locale-langpack/bg/LC_MESSAGES
/usr/share/locale-langpack/bg/LC_MESSAGES/Linux-PAM.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/pidgin.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/findutils.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/mutt.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/help2man.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/pppconfig.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/jade.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/recode.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/wdiff-gnulib.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/software-properties.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/grub.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/cracklib.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ggzcore.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/libapt-inst1.4.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/system-service.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/gwibber-service-sohu.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/mlocate.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/lynx.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/dnsmasq.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/apparmorapplet.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/gettext-tools.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/binutils.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/hello.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/quota.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ld.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/libvisual-0.4.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/friendly-recovery.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/gnupg2.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/git-gui.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/bash.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/apturl.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/sharutils.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ubuntuone-control-panel.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/pulseaudio.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/hello-debhelper.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/hunspell.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/dctrl-tools.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/gwibber-service-sina.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/popt.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/powertop.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/xdiagnose.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ubuntuone-client.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/gettext-runtime.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/debian-tasks.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/nano.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/lvm2.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ecryptfs-utils.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/duplicity.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ubuntu-wallpapers.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/dselect.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/debconf.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/mountall.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/JabberBot.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/net-tools.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/apport.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/libidn.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/newt.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/tar.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/gnupg.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/coreutils.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/make.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/libapt-pkg4.12.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/kerneloops.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ldm.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ufw.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/pidgin-libnotify.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/pppoeconf.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/acl.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/python-apt.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/gutenprint.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/MoinMoin.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/usbcreator.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/launchpad-integration.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/example-content.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/avahi.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/transmission-gtk.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/xkeyboard-config.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/dpkg-dev.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/libgpg-error.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/human-theme.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/grep.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/sane-backends.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/NetworkManager.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/libvirt.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ubuntu-sso-client.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/app-install-data.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/dpkg.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/whois.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/system-config-kickstart.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/gprof.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/zeitgeist.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/shared-mime-info.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/virt-manager.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/bison-runtime.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/wget.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/quilt.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/command-not-found.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/jockey.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/attr.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ltsp-login.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/kcm_gtk.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/alsa-utils.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/aspell.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/fetchmail.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/man-db-gnulib.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/devscripts.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/xscreensaver.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/unity-2d.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/compiz.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/apt.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/gODBCConfig.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/libc.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/plasma_applet_menubarapplet.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/update-manager.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/psmisc.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/screen-resolution-extra.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/unattended-upgrades.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/adduser.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/sysstat.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/checkbox.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/apt-listchanges.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/ubuntuone-installer.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/upstart.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/upower.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/tasksel.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/byobu.mo
/usr/share/locale-langpack/bg/LC_MESSAGES/language-selector.mo
/var
/var/lib
/var/lib/locales
/var/lib/locales/supported.d
/var/lib/locales/supported.d/bg
 

 

Above .mo files are  binary files, generated from plain text .po / .pod files. In free software OS .po files are the most common language translation files, where for each different language a set of .po files exist. Translators usually translate from English to respective language using a GUI text editor called poedit. Once translation is made from those .po files .mo binaries are generated and shipped as localizations for program or group of programs. Below is edit of one of Polish translation of lang file belonging to CUPS Printing service.

poedit gnu linux xubuntu screenshot editing cups .po language plain text file

Once .po files are created, generation of .mo files can be done in various way, however usually Linux system uses msgfmt – (compile message catalog to binary format). In order to generate .mo file out of lets say cups_pl.po;

hipo@linux:~$ msgfmt cups_pl.so
hipo@linux:~$ ls -al *.mo
-rw-rw-r-- 1 hipo hipo 31988 Mar 18 12:38 messages.mo

Anyways, here is how to add Cyrillic support for rest of Major cyrillic speaking countries, issue;

For Russian Cyrillic language Linux Desktop env support;

linux:~# apt-get install --yes language-pack-ru
...

For Belarusian Cyrillic Linux Desktop;

linux:~# apt-get install --yes language-pack-be

For Linux Desktop in Ukrainian;

linux:~# apt-get install --yes language-pack-uk

For Linux Desktop in Serbian language;

linux:~# apt-get install --yes language-pack-sr
...

For Graphic Environment in Macedonian;

linux:~# apt-get install --yes llanguage-pack-mk
...

For Linux GUI in Bosnian;

linux:~# apt-get install --yes language-pack-bs
...

For Kyrgyz language Linux localization;

linux:~# apt-get install --yes language-pack-ky

Whether, you are using Linux Desktop internationalization on some other Cyrillic related language, which I'm missing here please feel free to drop me a comment how you install it? I

 

How to change Debian GNU / Linux console (tty) language to Bulgarian or Russian Language

Wednesday, April 25th, 2012

Debian has a package language-env. I haven't used my Linux console for a long time. So I couldn't exactly remember how I used to be making the Linux console to support cyrillic language (CP1251, bg_BG.UTF-8) etc.

I've figured out for the language-env existence in Debian Book on hosted on OpenFMIBulgarian Faculty of Mathematics and Informatics website.
The package info with apt-cache show displays like that:

hipo@noah:~/Desktop$ apt-cache show language-env|grep -i -A 3 description
Description: simple configuration tool for native language environment
This tool adds basic settings for natural language environment such as
LANG variable, font specifications, input methods, and so on into
user's several dot-files such as .bashrc and .emacs.

What is really strange, is the package maintainer is not Bulgarian, Russian or Ukrainian but Japanese.
As you see the developer is weirdly not Bulgarian but Japanese Kenshi Muto. What is even more interesting is that it is another japanese that has actually written the script set-language-env contained within the package. Checking the script in the header one can see him, Tomohiro KUBOTA

Before I've found about the language-env existence, I knew I needed to have the respective locales installed on the system with:

# dpkg-reconfigure locales

So I run dpkg-reconfigure to check I have existing the locales for adding the Bulgarian language support.
Checking if the bulgarian locale is installed is also possible with /bin/ls:

# ls -al /usr/share/i18n/locales/*|grep -i bg
-rw-r--r-- 1 root root 8614 Feb 12 21:10 /usr/share/i18n/locales/bg_BG

The language-env contains a perl script called set-language-env which is doing the actual Debian Bulgarization / cyrillization. The set-language-env author is another Japanese and again not Slavonic person.

Actually set-language-env script is not doing the Bulgariazation but is a wrapper script that uses a number of "hacks" to make the console support cyrillic.

Further on to make the console support cyrillic, execute:

hipo@noah:~$ set-language-env
Setting up users' native language environment
by modifying their dot-files.
Type "set-language-env -h" for help.
1 : be (Bielaruskaja,Belarusian)
2 : bg (Bulgarian)
3 : ca (Catala,Catalan)
4 : da (Dansk,Danish)
5 : de (Deutsch,German)
6 : es (Espanol,Spanish)
7 : fr (Francais,French)
8 : ja (Nihongo,Japanese)
9 : ko (Hangul,Korean)
10 : lt (Lietuviu,Lithuanian)
11 : mk (Makedonski,Macedonian)
12 : pl (Polski,Polish)
13 : ru (Russkii,Russian)
14 : sr (Srpski,Serbian)
15 : th (Thai)
16 : tr (Turkce,Turkish)
17 : uk (Ukrajins'ka,Ukrainian)
Input number > 2

There are many questions in cyrillic list necessery to be answered to exactly define if you need cyrillic language support for GNOME, pine, mutt, console etcetera.
The script will create or append commands to a number of files on the system like ~/.bash_profile
The script uses the cyr command part of the Debian console-cyrillic package for the actual Bulgarian Linux localization.

As said it was supposed to also do a localization in the past of many Graphical environment programs, as well as include Bulgarian support for GNOME desktop environment. Since GNOME nowdays is already almost completely translated through its native language files, its preferrable that localization to be done on Linux install time by selecting a country language instead of later doing it with set-language-env. If you failed to set the GNOME language during Linux install, then using set-language-env will still work. I've tested it and even though a lot of time passed since set-language-env was heavily used for bulgarization still the GUI env bulgarization works.

If set-language-env is run in gnome-terminal the result, the whole set of question dialogs will pop-up in new xterm and due to a bug, questions imposed will be unreadable as you can see in below screenshot:

set-language-env command screenshot in Debian GNU / Linux gnome-terminal

If you want to remove the bulgarization, later at certain point, lets you don't want to have the cyrillic console or programs support use:

# set-language-env -r
Setting up users native language environment' 

For anyone who wish to know more in depth, how set-language-env works check the README files in /usr/share/doc/language-env/ one readme written by the author of the Bulgarian localization part of the package Anton Zinoviev is /usr/share/doc/language-env/README.be-bg-mk-sr-uk

Fix audioCD play problems with VLC on GNU Linux

Monday, January 23rd, 2012

I've not played audio CD for ages. Anyways I had to set up one computer with Linux just recently and one of the requirements was to be able to play audiocds.
I was surprised that actually a was having issue with such as simple tasks.
Here is how i come with this article.

If you encounter errors playing Audio CDs on any Linux distro in VLC or other players, you might need to apply the following fix.

root@xubuntu-desktop:~# apt-get install xubuntu-restricted-extras
...
root@xubuntu-desktop:~# apt-get install ubuntu-restricted-extras
...

I'm not sure if this packages are required, anyways having them installed is a good idea especially on computers which will have to support as much multimedia as possible.

Trying to play a CD with VLC the result was not nice, you see in the picture above the error that poped up while trying it with VLC:

Due to wrong configuration of the play device VLC will be looking to read the audio cd from.

To succesfully play the audiocd invoke VLC command with a cdda///dev/sr0 argument like so:

hipo@xubuntu-desktop:~$ vlc cdda:///dev/sr0
...

To permanently fix the error you will have to edit ~/.config/vlc/vlcrc :

Inside ~/.config/vlc/vlcrc find the lines:

dvd=/dev/cdrom

Substitute the above line with:

dvd=/dev/sr0

Next find the line:

vcd=/dev/cdrom

Change the above line with:

vcd=/dev/sr0
Due to a bug in generating vlcrc , the dvd= might be set also to other messy unreadable characters (different from /dev/cdrom). This can also be the reason why it fails to properly read the disc.

If dvd= and vcd is set to a different unreadable characters delete them and substitute with /dev/sr0 .I've experienced this on Xubuntu Linux with a Bulgarian localization (probably the bug can be seen in other Linuxes when GNOME is installed in Russian, Chineese and other UTF-8 languages.

The strange error can be observed also in other players when the localization is set to someone's native language …
Alternative solution is to install and use rhythmbox instead of VLC.
Other program to play audio CDs called workman , you will have to get used to the interface which uses gtk1 and therefore obsolete. Putting aside the ugly interface it works 😉