# O manual de &lokalize;

Nick
Shaforostoff

    shaforostoff@kde.ru

Marce
Villarino

    mvillarino@users.sourceforge.net

Tradutor do proxecto Trasno
2007-2009
Nick Shaforostoff
&FDLNotice;
2009-05-09
1.0

&lokalize; is a computer-aided translation system that focuses on productivity and quality assurance. It has components usual for CAT tools: translation memory, glossary, and also a unique translation merging (synchronization) capability. It is targeted for software translation and also integrates external conversion tools for freelance office document translation.

&lokalize;
localización
l10n
internationalización
i18n
tradución
globalización
g11n
XLIFF
gettext
OpenDocument
KBabel

## Introdución

When you start &lokalize; first time, you will see an empty Project Overview tab. Lokalize workflow implies that you start with creating/opening a project.

If you are working along, chances are you are going to translate OpenDocument file. To do this select Project Create new project. The wizard will ask you about your source document, convert it to &lokalize; internal format, XLIFF, and create project for it. After you finish translating choose Tools Merge into ODF to integrate your translation into a copy of source document.

If you are doing translations for KDE, then either you will already have &lokalize; project file in your languages folder (usually named `index.lokalize`), or you can select Project Create new project and the wizard will download translation files for your language and will create project for you.

Translation files are opened in separate tab, with two big multi-line edits as well as a bunch of toolviews. These views can be stacked (similar to tabs), shown separately, or hidden. Translation files consist of many English-target pairs called units. A unit typically correspond to a single string in the user interface, or one paragraph in the documentation. The purpose of the first multi-line edit is to display the original part of the pair. The purpose of the second multi-line edit is to display the translation. You can navigate through the units via the Translation Units view or by using Page Down and Page Up.

It is recommended that you get used to the keyboard shortcuts instead of the menus and toolbars for increased productivity. For example, use the &Ctrl;L to focus Quick search input line to filter unit list in Translation Units view. Once you are done, press Page Down to start moving along the filtered list.

A unit may be translated or untranslated. A translation of a translated unit may be ready or not ready (also called fuzzy sometimes). If the unit is not ready, its translation is rendered in italics. &lokalize; allows you to easily navigate through the file according to the state of their translation. See Go menu for the shortcuts. When navigating, untranslated units are treated as not ready. Also you may use filtering feature of Translation Units toolview. Pressing Page Down actually takes you to the next unit in filtered/sorted list of that toolview.

If you are working with translation files in XLIFF format (definitely the case when you translate OpenDocument), then extended states are available (new, needs review, approved, &etc;). You may select them in drop-down menu of Approved button in the toolbar. Classification of the state as ready or not ready depends on the current workflow phase (translation, review, approval). A default phase for you depends on your role in the project (set in project settings). Each unit usually contains information about phase it was changed last time, and for each phase its owner is logged to the file.

## Proxectos

Os proxectos son un dos conceitos principais de &lokalize;. Un proxecto represéntase por un ficheiro que contén rotas, cartafoles con traducións, modelos e outros ficheiros: o glosario, scripts de automatización, memorias de tradución. Sempre que &lokalize; abra un ficheiro sen ter un proxecto cargado, procurará por un ficheiro de proxecto nos cartafoles superiores (até catro níveis). Alternativamente, pode especificar o ficheiro do proxecto mediante a opción `--project` se inicia &lokalize; desde a liña de comandos.

For each project you select your role in it (translator, reviewer, approver), which in turn affects a workflow phase &lokalize; automatically picks up for files you edit.

As memorias de tradución, a diferenza dos ficheiros de proxecto, glosario e scripts, a non son compartidas entre os membros da equipa de tradución, xa que son criadas e gardadas no cartafol persoal do usuario, o que significa que as memorias de todos os proxectos son gardadas no mesmo cartafol e por ende poden ser empregadas cando se abren outros proxectos.

### Project Overview tab

The Project Overview tab displays a file tree with statistics for a current project, such as the percentage of translated units completed and the last translator. It allows you to open a selected file in new tab of the current &lokalize;, window.

## Glosario

Cansou algunha vez de escreber o mesmo texto longo varias veces só porque lle levaría máis tempo achar unha copia da tradución e apegala? Agora só ten que achar a secuencia (frecuente) de palabras na vista do Glosario, e inserila premendo nun atallo.

Por suposto o glosario debe ser elaborado previamente con secuencias de palabras. &lokalize; ten un útil editor de glosario que permite facer unha procura explícita en todo o glosario.

Glossary view in the bottom right corner displays glossary entries appropriate for the current unit
Glossary view in the bottom right corner displays glossary entries appropriate for the current unit

## Memoria de tradución

The Translation Memory view allows you to drag and drop a folder with translation files from say Dolphin into the view, and then, within few minutes, translation suggestions will be shown automatically on the unit switch. To insert the translation suggestions into the file, use &Ctrl;1, &Ctrl;2 and so on, depending on the number of suggestion.

Pressing F7 will open Translation Memory tab, which allows free querying TM. Clicking a search result will open corresponding file on corresponding unit. If you want to quickly open some file in the project (and it is added to TM), then instead of browsing Project Overview you just type its name into File mask field accompanied by '*'.

TM engine indexes all entries, including non-ready and untranslated ones. This allows it to completely replace Search-in-Files feature which required scanning every file in the project each time a search is done.

&lokalize; with translation memory search results for the current unit
&lokalize; with translation memory search results for the current unit

## Capacidade de sincronización entre traducións

O modo Sincronizar (anteriormente coñecido como Modo de fusión) aforra grande cantidade de tempo aos editores, e para casos nos que dous ou máis tradutores traballen á vez no mesmo ficheiro, ou cando se manteñen traducións de varias versións do software.

&lokalize; allows quick navigation through units that differ, and displays word-by-word differences. Also, &lokalize; has two Sync views - Primary Sync and Secondary Sync. They are identical, but the former is usually used to merge translations and second to keep in sync translations for two software branches.

After you copied translation from auxiliary file (synchronized it), any subsequent changes made to this unit will be replicated back to auxiliary file.

### Fundindo

Un uso dos modos de Sincronización é a revisión das modificacións feitas por (novos) contribuintes, cando non se pode estar certo da calidade do traballo feito.

Open a base file, then drop its changed version into the Primary Sync view, followed by &Alt;Down or &Alt; Up (remember that shortcuts may be modified in a usual way for all &kde; applications) to navigate through entries that are different.

&lokalize; fusionando modificacións na tradución
&lokalize; fusionando modificacións na tradución

### Replicación

Sync Mode may also be used to make changes to translation for two branches simultaneously. Set Branch folder path in your project options to the path that corresponds to base folder of the branch, and Secondary Sync view will automatically open files from branch. Then, each time you make changes in files of your main branch, they will automatically be replicated to the branch (of course, if it contains the same English string).

For example, if you work on KDE translation, you can checkout trunk to `/home/xx/hacking/kde/trunk/l10n-kde4/YOUR_LANG` and branch to `/home/xx/hacking/kde/branches/stable/l10n-kde4/YOUR_LANG`. Create &lokalize; project: `/home/xx/hacking/kde/trunk/l10n-kde4/YOUR_LANG/project.lokalize` and set `BranchDir=../../../branches/stable/l10n-kde4/YOUR_LANG`, then work via this project, and commit changes in both trunk and branch folders.

### Alternate Translations

Each unit may have several alternate translations associated with it. Such translations may appear during file update, when the source string is slightly changed. In this case the old translation with it's (old) source is moved to alternate translations list, so that they are not lost.

When translating software, usually gettext tools are used to prepare translation files. When original text changes, gettext tools update translation files and mark entries with changed original text as fuzzy (or non-ready in other terminology). They store previous original text so that translators could see what changes exactly were made. &lokalize; simplifies life of translator and highlights parts of original text that were changed in Alternate Translations view.

&lokalize; realza as partes do texto orixe que foron modificadas desde a última revisión da tradución
&lokalize; realza as partes do texto orixe que foron modificadas desde a última revisión da tradución

## Scripting &lokalize;

&lokalize; is extensible using scripts in several interpreted languages, including Python and JavaScript. Scripts are usually integrated into &lokalize; UI as menu actions (to which you may assign a keyboard shortcut). The location and name of menu entry for the script is defined in its accompanying .rc file. On each project open &lokalize; scans `PROJECTDIR/lokalize-scripts` folder for .rc files and adds them to a cache file called `PROJECTDIR/lokalize-scripts/scripts.rc` (so you shouldn't generally want to add it project's version control system). RC files also contain script paths, which may be relative to .rc file folder, or to a system scripts folder - they are tried both (actually they should be relative if you want to share .rc file with other people in your project). So you for example can specify `../../scripts/lokalize/opensrc.py` to load script from global kde4-l10n scripts folder (&ie; not specific to your language).

Examples of .rc files may be found in &lokalize; install folder (usually `/usr/share/kde4/apps/lokalize/scripts/`) and in KDE repository. Here you can find more script examples, including JavaScript-based `check-gui.js` that runs automatically on each file save (this is achieved via special option in .rc file). If you're familiar with Python or JavaScript, the code should be self-explanatory.

Below are links to API references. Everything marked as Q_SCRIPTABLE may be used from scripts.

- Editor object API reference

- Lokalize object API reference

- Project object API reference

## Recoñecimentos e Licenza

&lokalize;

Program Copyright © 2007-2009, Nick Shaforostoff shaforostoff@kde.ru

Algo de código foi tomado de &kbabel;, o antergo de &lokalize;.

Documentation Copyright © 2007-2009 Nick Shaforostoff shaforostoff@kde.ru

Autor:

- Nick Shaforostoff shaforostoff AT kde.ru

See the &lokalize; homepage for more details.

mvillarinomvillarino@users.sourceforge.net

&underFDL; &underGPL;

&documentation.index;