From Mageia wiki
Jump to: navigation, search


this page is a draft.
It requires improvements. If you want to improve it, simply log in and click on the Edit tab.

Please remove this {{Draft}}template, when you're sure the page is complete and correct.


View the other draft pages, or other pages to improve and maintain.

Using Lokalize To Translate Mageia Software, Web Sites and Documentation

Introduction

There are two separate workflows in the translation process, suited to the different types of content, namely, static content (fiction books, scientific monographs, other static texts) and dynamic content (application interfaces, documentation, common documents, etc.).

Lokalize can be used in both workflows but better suits to translate dynamic content.

Why Lokalize?

There is a plenty of FLOSS software for translation you can install and use in Mageia. So why Lokalize? Below is a comparison table of the application features.

A comparison table
Feature GTranslator Qt Linguist Lokalize OmegaT poEdit VirTaal
File format PO PO, TS PO, TS, XLIFF PO, INI, SRT, HTML, LaTeX, etc. PO PO, MO, TS, QM, XLIFF
Technological base GNOME Qt KDE Java GTK+ GTK+
Autocomplete - - + - - -
Translation memory
support
+ - + + - +
Translation memory
import/export
- - + + + +
Translation synchronization
between separate files
- - + - - -
Projects support - - + + - -
Automatic pre-translation - +
(pre-created phrasebook)
+ - +
(limited)
-
Can work with tags and entities + - + + - +
Comparison with
translations into
other languages
- + + - - -
Out of box integration
with Internet dictionaries
and translation services
- - - + - +
Configurable shortcuts - - + - - -
Fuzzy translation with
with word-by-word diffs
+ + + + - +

Common Formats of the Translation Material

Mageia consists from a very large set of different packages with very different localization systems. The Mageia localization core includes the following components:

  1. Mageia documentation and Mageia exclusive software (Drak, bootloader and some other tools). These components use gettext PO files for translation.
  2. Mageia website. This component uses specially crafted format of translation files (lang-files).
  3. Mageia documentation. This component is based on DocBook format.
  4. Mageia blog. This component can be translated as plain text or HTML.

There are also several other source text formats that are used in Mageia packages:

  1. Qt TS files.
  2. Uncommon localization formats, like in GNU TeXmacs, SciTE, Man2DVD, Chromium, etc.

It is not very convenient to have separate tools for each of these formats, but they can be easily converted to a common denominator which is PO format for this case.

All Mageia core component texts can be converted to PO files for further consistent and convenient translation using FOSS software from Mageia repositories.

A comprehensive guide to the structure of PO files can be found in the official GNU Gettext manual.

But for the usual translator, there is no need to learn Gettext procedures extensively. In the real world, it is usually enough to know how to use some translation tool with a graphical interface, e.g. Lokalize.

Lokalize Interface and Tools

Lokalize has its own documentation which is installed with the application and available online as HTML and PDF.

Here, we only concentrate on the details that can be useful for Mageia translations.

Lokalize main window (click to enlarge)

The numbers in the figure above denote the following components of Lokalize window

  1. Menu bar. The translation memory and glossary can be configured using the Tools menu. The Tools menu can be used to search and replace translation in the whole translation catalog (Search and Replace item or simply F6). Use Settings → Toolviews to add or remove toolviews, e.g., Secondary Sync, from Lokalize window.
  2. Toolbar. Can be configured using Settings → Configure Toolbars... menu item.
  3. Translation units list. Can be used to see the context (adjacent units), filter the messages (e.g. filter out all the messages that were not changed) and quicksearch in the current file for the units.
  4. Source unit pane. Here, you can see the source string (spelling mistakes are underlined).
  5. Translation unit pane. Here, you can enter the translation. Autocompletion and spellchecking are made by KTextPart (KDE text editor module), so the colors of highlighting should be configured in KDE System Settings.
  6. Additional toolview windows (the Secondary sync is shown). Can be useful to fix the translation of the same file for the different Mageia releases (see the Lokalize docs to learn more).
  7. Translation memory pane. Fuzzy matches are shown with highlighted diffs. The shortcuts to copy the matches into the translation are shown at the left. Hover the mouse cursor on the matching item for a while to see some information about its source. The item to open the source file can be reached by the right clicking on the match.
  8. Glossary pane. The pane to show and to configure the glossary of your translation team.

All these interface elements are configurable. You can completely change the layout with a simple drag and drop.

Tutorials

A screencast of the tutorials below can be found here.

Creating Mageia translation project

  1. Use check_for_translation_work.sh script to download all available Mageia translations into your language. A comprehensive instructions on how to use this script are given here. For those who prefer to not follow the links the detail description is given below.
    • Download the script and save in in your home directory under subdirectory bin (just right-click the link and choose Save Link As..., then create bin directory in you home folder and click OK).
    • Install git package with Mageia package manager.
    • Navigate to the bin subdirectory in your file manager and open console in the subdirectory (press F4 in Dolphin)
      Konsole panel in Dolphin file manager (click to enlarge)
    • Type bash che then press Tab and Enter.
    • Press Alt + F2 and type kwrite ~/.mageia-i18n-config then press Enter (you can use any text editor you want instead of KWrite).
    • Use the instructions in the opened window to fill up the necessary data.
    • Please upload your public key if you have an access to commit changes into Mageia repositories.
    • Save the changes and quit the editor.
    • Switch back to the file manager window.
    • Press in the console part of the window, then press Enter.
    • The script will download all Mageia translation files with one command.
  2. Start Lokalize.
    Lokalize initial screen (click to enlarge)
  3. Click on Configure Lokalize...
    Lokalize configuration screen (click to enlarge)
  4. Choose your identity parameters and your language.
  5. Switch to the Translation Memory page and configure its parameters as follows:
    Translation Memory page (click to enlarge)
  6. Press OK button.
  7. Press Create new project.
    Project directory choose window (click to enlarge)
  8. Choose translations directory and a name for your project (e.g. mageia).
  9. Choose mailing list and your language for the project.
    Project general configuration window (click to enlarge)
  10. Switch to the Advanced page.
    Project advanced configuration window (click to enlarge)
  11. Choose _ as an accelerator (Mageia uses GTK+ scheme).
  12. Choose the translations directory for templates, any branch folder if you want to translate different branches simultaneously and an alternative translation folder (if you want to compare your translation with some translation into a different language).
  13. Press OK button.

Filling up Mageia translation memory

  1. Choose Tools → Manage translation memories form Lokalize main window menu.
    Translation memories management page (click to enlarge)
  2. Press Add Data button.
  3. Select a directory with your translation file. (e.g. translations).
  4. Press OK button.
  5. Wait until scanning is finished.
    Notification about TM scanning (click to enlarge)

Searching for some phrase in the translation memory

  1. Suppose you want to fix some Mageia translation.
  2. Open Lokalize window.
  3. Press F7
    Lokalize Translation Memory search tab (click to enlarge)
  4. Configure the search parameters as you like.
  5. Click on the Search button.
  6. Right click on the matches to proceed.

Mass search and replace in the translations

  1. Suppose you want to fix some Mageia translation in all Mageia project files.
  2. Open Lokalize window.
  3. Choose Tools → Search and replace in files... from Lokalize main menu or press F6.
    Lokalize search and replace tab (click to enlarge)
  4. Configure the parameters as needed.
  5. Click on the Preview button.
  6. Click on the Mass Replace button.

Using translation memory to ease up the work

  1. Open some documentation PO file for translation using Lokalize File → Open...menu item (or press Ctrl + O, or use Open toolbar button).
  2. It is evident that some of the strings in this documentation have been already translated in the interface. Use Tools → Fill in all exact suggestions and mark as fuzzymenu item to fill the exact suggestions.
  3. Use Ctrl + Page Up and Ctrl + Page Down to move between fuzzy translations and Ctrl + U to approve them.
  4. Use Alt + Page Up and Alt + Page Down to move between untranslated messages.
  5. Some of the messages can have fuzzy suggestions shown on the Translation memory pane. Use the shown suggestion shortcuts and Lokalize stemming feature to fill in the translations.
Fuzzy message in Lokalize before stemming usage
Fuzzy message in Lokalize after stemming usage (Ctrl + 1)

Proofreading an external translation

  1. Open with Lokalize the main .po file that is in the Mageia repository.
  2. From the Sync menu select Open file for sync/merge
  3. Select the contributed PO file (the one that you want to review and merge).
  4. Copy the changes from the contributed file to the main file one by one with Alt + ↓ and Alt + Enter (checking and correcting them if needed).
Note:
You can also copy all the changes at once with Copy all new translations (Ctrl + Alt + A). then filter the changes with the Translation units list.