本页介绍了如何离线翻译。 如果您对此感兴趣，您可能已经知道Gettext PO文件是什么。出于这个原因，我们将仅讨论如何在带有Translate扩展的wiki中使用它们。否则，您可能对如何在线翻译的教程更感兴趣。 For this reason, we'll only discuss how to use them in a wiki with the Translate extension here. Otherwise, you're probably more interested in the How to translate tutorial for online translation.
更一般地说，如果您的互联网连接速度非常慢或有限，或者离线工具不能没有，您可能不希望使用网页界面。但请注意，翻译扩展程序是作为协作过程设计的。这意味着您不应长时间保持文件脱机，并且应始终在开始翻译之前下载新文件。否则，您可能会与在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.
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.
"X-Language-Code: nl\n" "X-Message-Group: ext-abc\n"
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
Example entry in a Translate Gettext po file.
#. [Wiki] This text is used on the history tab. #. [Wiki] msgctxt "history_short" msgid "History" msgstr "Versionsgeschichte"
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.
The way how imports of off-line translations are handled (or not) depends on your wiki.
- Multi-format translation tool based on the toolkit above. Currently working in Windows and Linux.
- 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
- Better PO Editor
- Available as source code for Windows, BSD, Unix, Linux, Mac OS X. Includes spell checker and Google Translate suggestions.