Xfce Wiki

Sub domains
 

This is an old revision of the document!


Проверка ваших переводов

When an application is being translated it is interesting to see the result. This allows you to figure several points, e.g. to appreciate your labour, to check for ugly vs pretty messages, to spot mistakes, etc.

PO-файлы компилируются в MO-файлы с помощью утилиты msgfmt. These files are installed on the system with the same prefix1) as the application.

Теория

1. Создайте резервную копию
Внимание: замените элементы <ЯЗЫК> и <ПРИЛОЖЕНИЕ> (например, путь к русскому переводу Xfburn будет выглядеть как /usr/share/locale/ru/LC_MESSAGES/xfburn.mo).

cd /usr/share/locale/<ЯЗЫК>/LC_MESSAGES/
sudo cp <ПРИЛОЖЕНИЕ>.mo <ПРИЛОЖЕНИЕ>.mo~

2. Скомпилируйте PO-файл

msgfmt -o <APPLICATION>.mo <LANG>.po

3. Install the MO file

sudo cp <APPLICATION>.mo /usr/share/locale/<LANG>/LC_MESSAGES/

4. Run the application
NB: you can test an application in several languages by tweaking the environment variable LANG. However the locales have to be available on the system (this is particular to the underlying system you are running), otherwise the translations won't show up.

NB: you can display available locales with the command line tool “locale -a”. To display the current locale run the command “echo $LANG”.

LANG=<LANG> <APPLICATION>

Практика

... connect to https://translations.xfce.org/projects/p/xfburn/ and download the PO file ...

poedit xfburn.master.ru.po

... labour labour labour ...

msgfmt xfburn.master.ru.po -o xfburn.mo
sudo mv /usr/local/share/locale/ru/LC_MESSAGES/xfburn.mo xfburn.mo.orig
sudo cp xfburn.mo /usr/local/share/locale/ru/LC_MESSAGES/
LANG=ru_RU.utf8 xfburn

Если вас не устраивает этот перевод и вы хотите попробовать новую версию…

poedit xfburn.master.de.po
msgfmt xfburn.master.de.po -o xfburn.mo
sudo cp xfburn.mo /usr/local/share/locale/ru/LC_MESSAGES/
LANG=ru_RU.utf8 xfburn
1)
/usr/local, /usr, /opt, etc