Dictionaries
&kbabel; has 3 modes which can be used to search translated
PO message strings:
Searching translation, using a translation database
Rough translation
&kbabeldict;
Translation database
Translation database allows you to store translations in a
database based on Berkeley Database IV, &ie; it is stored in a binary
file on your disk. The database guarantees fast searching in a large
number of translations.
This mode is the one best integrated with &kbabel;. Besides
searching and rough translation it also supports the following
features:
Every new translation typed in the &kbabel; editor can be
automatically stored in the database.
This database can be used for diff
-ing
msgid.
Of course, the more translations are stored in the database, the
more productive you can be. To fill the database, you can use the
Database tab in the preferences dialog or you can
turn on automatic addition of every translated messages on the same
tab.
Settings
You can configure this searching mode and how it should be used by selecting
Settings
Configure Dictionary
Translation Database
in &kbabel; menu.
The Generic tab contains general settings for searching in the
database.
Search in whole database (slow)
Do not use good keys
, search in the whole database.
This is slow, but will return the most precise results.
Search in list of "good keys" (best)
Use good keys
strategy. This option will give you the
best tradeoff between speed and exact matching.
Return the list of "good keys" (fast)
Just return good keys
, do not try to eliminate any more
texts. This is the fastest provided method, but can lead to a quite large
number of imprecise matches.
Case sensitive
Distinguish case of letters when searching the text.
Normalize white space
Skip unnecessary white space in the texts, so the searching will ignore small
differences of white space, ⪚ number of spaces in the text.
Remove context comment
Do not include context comments in search. You will want this to be turned on.
Character to be ignored
Here you can enter characters, which should be ignored while searching.
Typical example would be accelerator mark, &ie; & for &kde; texts.
The Search tab contains finer specification for searching the text.
You can define how to search and also allows to use another special way of searching
called Word substitution. By substituting
one or two words the approximate text can be found as well. For example, assume you
are trying to find the text My name is Andrea.
Equal
Text from database matches if it is the same as the searched string. In our example it can
be My name is &Andrea (if & is set as ignored character
in Characters to be ignored on Generic tab).
Query is contained
Text from database matches if the searched string is contained in it. For our example it can
be My name is Andrea, you know?.
Query contains
Text from database matches if the searched string contains it. For our example it can
be Andrea. You can use this for enumerating the possibilities to
be found.
Regular Expression
Consider searched text as a regular expression. This is mainly used for
&kbabeldict;. You can hardly expect regular expressions in PO files.
Use one word substitution
If the query text contains less words than specified below, it also
tries to replace one of the words in the query. In our example it will
find Your name is Andrea as well.
Max number of words in the query
Maximal number of words in a query to enable one word substitution.
Local characters for regular expressions
Characters to be considered part of regular expressions.
Two-word substitution is not implemented yet.
Filling the database
The Database tab allows to define where is the database stored on
disk (Database folder) and if it should be used for automatic
storing of the new translations (Auto add entry to database).
In this case you should specify the author of the new translation in Auto added
entry author.
The rest of the tab allows you to fill the database from PO files that already exist. Use one
of the buttons in the middle of the dialog box. The progress of the file load will be
shown by progress bars below the buttons. The Repeated strings
button should be used in the special case where one translated string is repeated many
times, to prevent storing unnecessary copies. Here you can limit the stored strings.
Filling the database
Filling the database by existing PO-files
Defining good keys
On the Good keys tab are the thresholds to specify how to fill
the list of good keys.
Minimum number of query words in the key (%) specifies exactly that.
Text will need to contain only this per cent of the words to qualify as good key. Opposite can
be specified via Minimum number of words of the key also in the query (%).
The length of the words can be set by Max length spinbox.
Searched text typically contains number of generic words, ⪚ articles. You can
eliminate the words based on the frequency. You can discard them by
Discard words more frequent than or consider as always present by
frequent words are considered as in every key. This way the
frequent words will be almost invisible for queries.
Auxiliary PO file
This searching mode is based on matching the same original
English string (the msgid) translated in some other language in an
auxillary PO file. It is very common for Romance
languages to have similar words, similarly for Anglo-Saxon and
Slavic ones.
For example, say I wanted to translate the word
on
, from kdelibs.po, into Romanian
but have no clue. I look in the same file for French and find
actif, and in the Spanish one find
activado. So, I conclude that the best one in Romanian
will be active.
(Of course, in English instead of on
the word could have been
active
or activated
,
which would have made the translation process easier.)
&kbabel; automates this task. Currently you can define only one auxiliary file to search.
Settings
You can configure this searching mode by selecting
Settings
Configure Dictionary
PO Auxiliary
from the &kbabel; menu.
In the Configure Dictionary PO Auxiliary
dialog you can select the path to the auxiliary PO
file. To automate PO-file switching when you
change current edited file there are many variables delimited by
@ char that are replaced by appropriate
values:
@PACKAGE@
The name of application or package currently being translated.
For example, it can expand to kbabel, kdelibs, konqueror
and so on.
@LANG@
The language code.
For example can expand to: de, ro, fr etc.
@DIRn@
where n
is a positive integer. This expands to
the n
-th folder counted from the filename (right to
left).
The edit line displays the actual path to the auxiliary
PO file. While it is best to use the
provided variables in a path it is possible to choose an absolute,
real path to an existing PO file. Let's take an
example.
I'm Romanian and I have some knowledge about French language and
I work on &kde; translation.
First step is to download a very fresh
kde-l10n-fr.tar.bz2 from the &kde; &FTP;
site or to use the CVS system to put on my
hard-disk a French translation tree. I do this into
/home/clau/cvs-cvs.kde.org/kde-l10n/fr.
My PO sources folder is in
/home/clau/cvs-cvs.kde.org/kde-l10n/ro. Do not
forget to select PO Auxiliary as the default
dictionary and check Automatically start search
on the Search tab from &kbabel;'s
Preferences dialog.
PO compendium
A compendium is a file containing a collection of all
translation messages (pairs of msgid and
msgstr) in a project, ⪚ in &kde;. Typically,
compendium for a given language is created by concatenating all
PO files of the project for the
language. Compendium can contain translated, untranslated and fuzzy
messages. Untranslated ones are ignored by this module.
Similarly to Auxiliary PO, this searching
mode is based on matching the same
original string
(msgid) in a compendium. Currently you can define
only one compendium file to search.
This mode is very useful if you are not using the translation
database and you want to achieve consistent translation with other
translations. By the way, compendium files are much easier to share
with other translators and even other translation projects because
they can be generated for them as well.
Settings
You can configure this searching mode by selecting
Settings
Configure Dictionary
PO Compendium
in &kbabel;'s menu.
In Configure Dictionary PO Compendium
dialog you can select the path to a compendium file. To automate
compendium file switching when you change the translation language,
there is a variable delimited by @ char which si
replaced by appropriate value:
@LANG@
The language code.
For example can expand to: de, ro, fr etc.
In the edit line is displayed the actual path to compendium
PO file. While you had best use provided variables in
path, it's possible to choose an absolute, real path to an existing
PO file to be used as a compendium.
A very fresh compendium for &kde; translation into ⪚ French
you can download fr.messages.bz2 from the &kde; &FTP;
site.
You can define how to search in the compendium using options
below the path. They are divided into two groups: text-matching
options, where you can specify how the text is compared and whether to
ignore fuzzy translations, and message-matching options, which
determine if the translation from compendium should be a substring of
searching message or vice versa.
Case sensitive
If the matching of message in compendium should distinguish between uppercase and lowercase letters.
Ignore fuzzy string
If the fuzzy messages in the compendium should be ignored for searching. The compendium can contain fuzzy messages, since it is typically created by concatenating the PO files of the project which can include fuzzy messages. Untranslated ones are ignored always (You can't search for translation in untranslated messages, right?)
Only whole words
If the matching text should start and end at the boundaries of words.
A text matches if it is equal to search text
A text in compendium matches the search text only if it is exactly the same (of course using the options above).
A text matches if it is similar to search text
A text in compendium matches the search text only if it is similar
. Both texts are compared by short chunks of letters (3-grams
) and at least half of the chunks has to be same.
A text matches if it contains search text
A text in compendium matches the search text if it contains the search text.
A text matches if it is contained in search text
A text in compendium matches the search text if it is contained the search text.
A text matches if it contains a word of search text
The texts are divided to words and a text in compendium matches the search text only if it contains some word from the search text.