Help:Extensão:Translate/Tradução off-line

From mediawiki.org
This page is a translated version of the page Help:Extension:Translate/Off-line translation and the translation is 23% complete.
Outdated translations are marked like this.

Esta página explica como fazer traduções off-line. Se estiver interessado, provavelmente, você já conhece o que são arquivos Gettext PO. Por esta razão, somente discutiremos como usá-los em uma wiki com a extensão Translate aqui. Caso contrário, você pode estar mais interessado no tutorial Como traduzir para traduções online.

Mais em geral, você pode querer não usar a interface web se você tiver uma conexão com a internet muito lenta ou limitada ou ferramentas off-line imprescindíveis. Esteja ciente, no entanto, que a extensão Translate é concebida como um processo colaborativo. Isto significa que você não deve manter os arquivos off-line por longos períodos, e você deve sempre baixar um novo arquivo antes de começar a traduzir. Caso contrário, você pode entrar em conflito com outros tradutores que trabalham na wiki. Be aware, however, that the Translate extension is designed as a collaborative process. This means that you should not hold the files offline for long times, and you should always download a new file just before you start translating. Otherwise you might conflict with other translators who work in the wiki.

Exportação

Você pode baixar qualquer grupo de mensagens como arquivo Gettext PO escolhendo a tarefa exportar para tradução off-line em "Special: Translate". Alguns sites podem ter desativado essa tarefa. Você deve verificar em todas as guias locais como processar esses arquivos antes de começar. Some sites might have disabled this task. You should check any local guides how to process these files before you start.

Embora alguns grupos de mensagens possam ter uma opção de exportação, que exporta traduções no formato nativo desse grupo, e esse formato pode ser Gettext, esses não são os arquivos que podem ser usados para tradução off-line!

The files are standard Gettext PO files with some extra information. The header contains some extra fields shown below; the msgctxt for each message contains an identifier that the Translate extension needs. Some editors are known to strip either the header comments or the msgctxt lines, so start with a small file to make sure that your editor does not remove these ― it's not funny to realize the editor was buggy after translating hundreds of messages that you cannot import back into the online system! The message documentation is exported as translation comments.

Campos de cabeçalho importantes:

"X-Language-Code: nl\n"
"X-Message-Group: ext-abc\n"

Neste exemplo, "ext-abc" é o nome do grupo de mensagens. For translatable pages, the corresponding message group has the name "page-" + the page name (i.e. for the page "Example", the header would contain the line "X-Message-Group: page-Example\n").

Example entry in a GetText .po file, translated here from English (on the "msgid" line) to German (on the "msgstr" line) :

#. [Wiki] This text is used on the history tab.
#. [Wiki] 

msgctxt "history_short"
msgid "History"
msgstr "Versionsgeschichte"

Notice the line starting by msgctxt: it briefly explains the context of usage for the message given in the next msgid line. Such msgctxt line is optional but recommended. After importing the .po file, this contextual text will be made visible to users of the Translate UI on the wiki, and it should be kept or updated when needed.


Importação

There is no need to translate the file completely. Uploading partially translated message groups is perfectly fine. There are two ways to import these files.

The users with correct user rights can use Special:ImportTranslations to upload and import the translations. The special page processes the file, shows the changes and lets the user import them. For large files with lots of changes the importing might take multiple steps, as the processing time is limited.

Importing can also be done using a command line script in Translate/script/poimport.php. It's less flexible but can import everything in one go. It also needs intervention from someone with shell access to the server.

A maneira como as importações de traduções off-line são tratadas (ou não) depende da sua wiki.

Editores Gettext

Aqui estão algumas ferramentas que você pode usar para editar os arquivos off-line.

POedit
Available for all platforms supporting the wxWidgets toolkit, tested on Unix with GTK+ and Windows.
WARNING: make sure you are using version 1.4.2 or above, otherwise "msgctxt" lines are dropped and your work cannot be processed.
gtranslator
Can be used in the GNOME desktop environment on Unix and Linux platforms.
Lokalize
Uses the KDE 4 Desktop Environment on all platforms supporting it. Has a user wiki and online handbook
Translate Toolkit
Toolkit written in the python programming language which must be installed as well, usable on all platforms. Supports several other file formats as well.
Virtaal
Multi-format translation tool based on the toolkit above. Currently working in Windows and Linux.
OmegaT
Free tool for professional translators written in Java, requires Java installed; available on all platforms. Supports a variety of other file formats, glosssaries, fuzzy matching, and translation memories.
Eazy PO
Small program, runs on Windows, no installation required.
Gorm PO file editor
Small powerful program, runs on Windows, no installation required, version 1.0 fails on msgctxt tags.
Better PO Editor
Available as source code for Windows, BSD, Unix, Linux, Mac OS X. Includes spell checker and Google Translate suggestions.
gted
Usable as a plugin in the Eclipse IDE under Linux, Windows and MAC OS X; embeds various tools.