Это старая версия документа.


Ссылка на источник: Англоязычная wiki

FIXME: нужен перевод статьи

Введение

Перевод документации выполняется немного иначе, чем перевод программ. Эта страница содержит инструкции для переводчиков и объяснение последовательности команд, используемых для преобразования документации в шаблоны перевода и обратно.

Информация для переводчиков

Для перевода документации Ubuntu, как и для перевода программ, используется портал Launchpad Translation (Rosetta).

Документацию можно найти в следующих пакетах : 'ubuntu-docs', 'kubuntu-docs', 'edubuntu-docs' и 'xubuntu-docs'.

Имеется несколько особенностей, которые надо учитывать при переводе документации.

Несоблюдение этих инструкций приведёт к повреждению переводимого документа.

  1. Не следует переводить теги. Если вам встретился в тексте тег (например: «'<xref linkend=«free-software»/>'»), то этот тег и всё, что находится внутри самого тега, переводить не следует. Очень важно копировать и вставлять теги точно так, как они выглядят в английском тексте. Исключением является тег, содержащий URL, если имеется URL русскоязычного ресурса. В этом случае переводчик должен сам выбрать, какой URL указывать.
  2. Не следует переводить специальные комбинации символов. Если вы видите выражение типа «'&gt;'», не переводите его.
  3. Не меняйте исходный порядок тегов. Если вы видите теги, вложенные один в другой (например: «'<menuchoice><guimenu>System</guimenu><guimenuitem>Administration</guimenuitem><guimenuitem>Users and Groups</guimenuitem></menuchoice>'»), не следует менять этот порядок — копирование и вставка из английского сообщения будет лучшим способом убедиться, что вы его не нарушили. Переведите только слова между тегами.
  4. Чтобы увидеть, в каком контексте используются те или иные сообщения в англоязычной справочной документации, щёлкните Система → Справка и поддержка в Ubuntu или Khelpcenter в Kubuntu. Вся эта документация также доступна на http://doc.ubuntu.com
  5. Документы не импортируются в Ubuntu автоматически (как при переводе программ). Их нужно экспортировать и вручную загрузить в пакеты. Об этом должна позаботиться команда документации.

Если у вас возникли вопросы, задайте их в списке рассылки ubuntu-translators или в списке рассылки ubuntu-doc.

Проверка переводов

FIXME: Пример явно устарел (Interpid!) и он для французского языка. Надо бы обновить.

You can now test the translations you've done in Rosetta by inserting them into our repository and viewing them in Yelp.

  1. Download the LANG.po file for a particular document from Rosetta. For example the relevant templates for Intrepid can be found here. These instructions use the example of the french (fr) translation of the 'internet' document.
  2. Get the Intrepid branch of our repository:
sudo apt-get install bzr xmlto gettext gnome-doc-utils
bzr checkout --lightweight lp:ubuntu-doc/intrepid ubuntu-docs-intrepid
  1. Browse to the documentation directory
cd ubuntu-docs-intrepid
  1. Insert the new po file in the relevant document folder, under the 'po' subfolder using the naming scheme LANG.po:
mv ~/Desktop/internet-fr.po internet/po/fr.po
  1. Run the translate script and choose the relevant document and language:
./scripts/translate.sh -d internet -l fr
  1. The script will update the docbook xml for your document and language and will check the file created for validity. It will print any errors as output.
  2. Open the file in the GNOME help viewer, called yelp:
yelp file://${PWD}/internet/fr/internet.xml

Yelp always requires the full path to the xml document.

To build all documents with the latest translation run:

for doc in $(cat libs/shipped-docs); do ./scripts/translate.sh -d $doc -l LANG; done

A html version be created by running:

mkdir -p build/html
for doc in $(cat libs/shipped-docs); do find ${doc}/LANG -name "*.xml" -exec xmlto -o build/html html-nochunks {} \;; done

A nice formated html version (similar to help.ubuntu.com) be created by running:

for doc in $(cat libs/shipped-docs); do
     xsltproc --xinclude -o build/html/$doc/$lang/index.html \
	libs/ubuntu-html-chunk-cust.xsl $doc/$lang/$doc.xml 
done

Create a copy of libs/ubuntu-html-chunk-cust.xsl into libs/ubuntu-html-chunk-cust-$lang.xsl to customize/localise it's content. Also check ubuntu-banner.xsl.

LANG should be replaced by your language code.

NOTE: if you wish to make any changes to the translation, you should do so in Rosetta.

For Documentation Team Members

The rest of this page is a description of how the Documentation Team work gets translated and inserted into Ubuntu. It is primarily intended for reference of the Documentation Team: translators do not need to know all this information.

Package Requirements

To install all packages required to build ubuntu-docs, including translations, run:

apt-get build-dep ubuntu-docs

Process

There are three steps to getting documentation translated:

  1. generating a translation template
  2. letting the translators work their magic
  3. importing the translations back into our repository

These are taken in turn below.

1. Generating a translation template

  • When an English XML document is ready for translation, we make a POT file, which is the template that translators use. To make this, we use the command:
xml2po -e -o output.pot input.xml
  • For documents spread over more than one file, these can be included as follows:
xml2po -e -o output.pot chapter1.xml chapter2.xml
  • IMPORTANT: For documents which have an omf file, these should also be included in the pot file.
  • As a result, generally the appropriate command is:
xml2po -e -o output.pot C/*.xml C/*.omf

NOTE: We have an automatic script to generate POT files, called 'get-pot.sh'. Running this script refreshes the POT files for all documents.

2. Letting the translators work their magic

  • The pot file should then be uploaded to rosetta. This is done automatically if the pot is in a source deb package uploaded into the current version of Ubuntu, if not, it must be done manually at the relevant template page in Rosetta.
  • Translators then do the rest!

3. Importing the translations back into our repository

  • Automatic exporting from Rosetta into the docteam tree is not implemented. So here is what happens.
  • When a good time comes to import the translations, the translations can be downloaded from rosetta (for example, the «Download Translations link here). You can either download translations for all documents or for documents individually.
  • The translations from the tarball are placed in the relevant document's directory.
  • The translation script (translate.sh) is then used to convert the translations back to xml in the appropriate directory.
  • The script also checks the resulting xml for validity, and there are generally errors that must be corrected which are displayed onscreen. This must be done manually.

That's it!


На главную страницу переводчиков