Dictionaries
Prev
Next

Chapter 5. Dictionaries

KBabel has 3 modes which can be used to search translated PO message strings:

Translation database

Translation database allows you to store translations in a database based on Berkeley Database IV, that is, 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, for example, 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, that is, & 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.

Note

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 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, for example, 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.

Prev
Next
Home


Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team