KBabel is a suite of of an advanced and easy to use PO-file editor KBabel, a multi functional Catalog Manager and a dictionary for translators KBabelDict. It supports many advanced features and it lets you customize many options.
Table of Contents
KBabel is an advanced and easy to use PO-file (GNU gettext message catalogs) editor. It has many features, that makes editing and managing your PO-files easy. This includes full navigation capabilities, extensive editing functionality, search functions, syntax checking and statistics function. Catalog Manager is a file manager view, which helps you to keep an overview over your PO-files. KBabelDict enables to translate any text using KBabel capabilities for automated translation. The KBabel suite will help you to translate fast and also keep translations consistent.
With KDE project continous growing the number of PO messages is over 47000 at time writing this documentation (plus another 20000 messages used for translating application documentation). There is a need to stay organized and consistent along all translations.
Usually program messages and documentation are written in English. Using a framework made from a set of tools and libraries it is posible to have your favorite applications speaking your native non-English language. This process of adapting an application to a specific language is known as localization. The localization process includes translating the program's interfaces and documentation to the various languages users need and, in some countries or regions, making the inputs and outputs conform to particular conventions. KBabel is a tool which will assist you in the internationalization process to make an application's interface speak many languages.
Every internationalization-aware program makes available for translation one or more message-catalog files. The extension of these files is .pot. POT is an acronym for “Portable Object Template”.
Every translator takes a POT file copy and begins translating messages. That, this file will became a PO file - Portable Object and represents only one language.
Each translator takes a copy of one of these POT templates and begins filling in the blanks: each message is translated into the language desired. The file containing the translated text is referred to as a PO (Portable Object) file.
Once all the messages have been translated the PO file is compiled into a machine-readable binary format, known as a MO (Machine Object) file. These files, which will be stored with a .mo extension, act as a database to minimize the time taken by the applications to look up each translated message.
There is a question in the air: do I need to know what is inside a PO file even though I have KBabel? The answer is, undoubtfully, yes. There are situations when a message catalog can become corrupt and needs to be manually fixed. Most of these problems are the so-hated CVS conflicts which occur when a translating process is coordinated by a concurent version system (see the CVS documentation). KBabel can't help you very much if a problem like this arises so a text editor some knowledge of PO-files is needed. Let's see how a PO file is made.
PO files consist of pairs of messages—a msgid and a msgstr. The msgid is the text in English and the msgstr is the text translated into the appropriate language. The text that accompanies each msgid and msgstr is enclosed within C-like double quotes. An example, taken from a PO file for Noatun, is msgid "Open a Playlist"
Empty lines and those starting with # are ignored. Lines starting with a # represent comments and are a useful means of providing a note detailing which file this message is going to be used in and, in the case of the application writers, to provide additional comments to aide translation. KBabel displays these comment lines for every message.
In many cases the first msgid-msgstr pair in PO file is a fake entry (acting as PO file header) that contains various information about the translated PO file, such as the application name, translating date, translator name and so on.
Recent versions of GNU gettext added another usefull i18n feature called plural forms. English uses only singular and one plural form of nouns, e.g. “1 file ” and “10 files”. This leads many developers to an idea that world is that simple and they can use messages like “Do you want to delete %1 file(s)?”, where %1 denotes a number of files to be deleted. But this is fundamentally wrong. For Slovak translation you need 3 different forms of the message. This number is different for different languages and even if it is the same, e.g. Czech uses 3 forms as well, a rule to decide which form to use can be very different.
Plural forms in PO files are here to help. Unfortunately, KDE developers do not like the plural forms implementation in GNU gettext and they introduces their own format and handling for them.
Here is a screenshot of KBabel. For convenience KBabel has toolbars to speed up many operations and, for busy users, there are many keyboard shortcuts. The main window is divided into four parts.
The upper-left edit box is read-only and contains the current msgid field from the opened PO-file and its English text.
The bottom-left edit box contains the msgstr field related to the msgid shown and here you can edit the translated text.
The top-right part of the window is a comments panel where you can view the comments added for entry currently being edited.
It can be used:
to find out how the current message is treated by the application (c-formatted or simple)
in some cases to read helpful comments added by the application's developer to assist the translators in their work—for example, there may be technical hints (used to great effect in the LyX project)
when you need to know from what file current messages is because you want to report a spelling mistake in the original English string.
The editor window (in the bottom right) is the most sophisticated part of KBabel's main window. Its size can be adjusted using the splitter line between it and the comment panel (the panel in the top right). The editor window has two tabbed panels—one storing search information, the other context information. The context information tab contain a scrolled view which shows the previous and next 4 entries associated with the current entry—essentially it's a small 'snapshot' of the PO file. While translating it is very common for message strings to be related to subsequent and previous messages, so the context panel is useful for looking at the nearby messages to get an indication as to how the current message can best be translated. Dialog interface translation is a good example or widgets with their associated text and "what's this" message.
Each msgid entry can be in three states:
there is no translated text currently associated with the msgstr
msgmerge has tried to match a translated string by looking in rest of PO-file entries. This does not work perfectly and you must edit the translated text to fit the current English text.
the msgid is the completed translated form of the msgstr
The state of the current entry is indicated by two LEDs. Depending on your configuration these can either be in the status bar or above the translated string edit box. Both have a customizable color (to reflect your visual requirements or taste). Please read the Preferences section to see how you can adjust these settings.
Now you have an idea how to translate a PO-file. In this section we will follow standard way for translating a new PO-file using the advanced features of KBabel. We assume you have already opened a template POT-file and saved as PO file.
KBabel allows you to easily navigate through the file according to the state of their translation. The untranslated/fuzzy status was introduced already. A message can be marked as errorneous as a result of validation checking or validation done by msgfmt. And, of course, KBabel supports the history of visited messages by Forward/ Back similar to Konqueror.
All commands for navigation are in Go menu.
Page Up | Move to the previous message |
Page Down | Move to the next message |
Ctrl+Page Up | Move to the previous fuzzy message |
Ctrl+Page Down | Move to the next fuzzy message |
Alt+Page Up | Move to the previous untranslated message |
Alt+Page Down | Move to the next untranslated message |
Shift+Page Up | Move to the previous error message |
Shift+Page Down | Move to the next error message |
Ctrl+Shift+Page Up | Move to the previous fuzzy or untranslated message |
Ctrl+Shift+Page Down | Move to the next fuzzy or untranslated message |
Clever editing means that the editor will help you easily edit the translation while taking into account specials of the PO format. It will correctly “escape” as necessary.
It also supports more than one mode for inserting end of the line. This is very useful because of the way gettext handles end of the lines. It simply ignores them. (You can imagine that all the text in msgstr is a single line.) If you want insert a “real” end of the line, you need to insert \n. But most of translators do not realize, that a new line in msgstr does not add any space between the lines. This can be easily solved by adding a space at the end of every line. But you can easily forget, so clever editing does this automatically for you.
The table below summarizes clever editing features.
Tab | Insert \t |
" | Insert \" |
Enter | If the last character before cursor is not a space, insert one space. Then start a new line. |
Ctrl+Enter | Start a new line without any additional logic |
Shift+Enter | Insert \n and start a new line |
If you wnat to see where are spaces, you can turn on Highlight background and/or Mark whitespaces with points in preferences dialog on tab Edit Appearance.
As the first step when starting a new translation, KBabel provides function for automatic filling of the messages translations by the older translations. Choose Tools->Rough Translation and KBabel will present the following dialog:
In the dialog, you should specify what to translate and choose the sources for the old translations.
At the top of the What to translate frame are three checkboxes (Untranslated entries, Fuzzy entries , Translated entries) for specifying the kind of messages you want to translate. Untranslated and fuzzy entries are natural choices for automatic translation, but you can change already translated messages as well.
The exact matching for msgids will be used for rough translation always. However, you can add more strategies, i.e. Allow fuzzy translation (slow) and Allow single word translation. Both of these additional strategies must be supported by the sources used (see below). There is no specification, what does “fuzzy translation” mean, but the purpose is quite obvious. “Single word translation” is suitable for only some of the languages. KBabel will try to translate each word in msgid separately and then put the translated words (or phrases) in the same order in msgstr .
As a source for rough translation, any dictionary module available can be used. There is a list of Don't use modules and Use modules. Modules are used in the order in the Use list. First module is asked for translation. If it is not found, next module in the list is asked and so on. You can use the buttons with arrows for moving modules between the lists. Don't forget to change the order to suit your needs by Move Up and Move Down buttons.
Normally KBabel will mark every roughly translated message as fuzzy, because it assumes that any automatic translation needs to be reviewed by a translator. If you are 100% sure that the automatic translation will be correct, or you will review all the translation anyway. Mark changed entries as fuzzy allows you to turn off this automatic fuzzy marking, but you will need to confirm this.
If you have set all the options to suit your needs, push Start to automatically translate messages. You can follow the progress bar and in case, there is always the Stop button.
Everyone makes mistakes. So KBabel supports number of checks for typical problems in translations. These checks (not syntax check) can be basically performed in two ways.
Checks can be done at each change of the translated text. These are called automatic checks and they can be turned on in the KBabel configuration dialog. Automatic checking of syntax is possible at each saving of the file.
The automatic checks can slow down KBabel. If you have a slower computer, you can turn off the automatic checks and use only the second possibility. You can invoke every kind of check from the Tools-> Validation. Then the check is performed for all messages in the file and faulty ones are marked as errors.
This invokes msgfmt to check validity of the PO file as seen by gettext package. It will show the result of the command and mark error msgstrs.
Incorrect translations can crash the application. The most dangerous parts of translation are arguments, e.g. for printf-like functions. This check compares the number and types of the arguments in msgid and msgstr. They must match.
GUI text commonly contain accelerators, i.e. letters which can be used for fast access to GUI elements by keyboard. They are denoted by special character, e.g. & in KDE. Typical requirement of the translation is that translated text should contain accelerator as well. This check will notice this problem for you. The accelerator character can be specified in Preferences on Misc tab.
You will probably need this only for KDE translation. Some of the text are too common and they need to be translated differently in different contexts. In KDE is context described at the beginning of msgid after the special sequence :_. But if some translators are not aware of this convention and they try to translate context information as well. This check will try to find these. If it founds translated context info, you should remove it.
If the msgid is specified as a “plural form”, the translation has to contain the correct number of translations separated by \n. The correct number depends on the language of translation and is specified on Identity tab in Preferences dialog. This is implemented only for KDE at the moment.
Equations are special format of msgid typically used in .desktop files. And because your translations will be merged back to these files, msgstr must use this special format as well. This means that the translation must start (up to the first occurence of = with the same text as the original message, e.g. Name=.
As always, it is very important to spell check your translation before using your result. This way you can find typos and other problems in your translation. KBabel uses the standard KDE library for spellchecking and its standard configuration can found in the KBabel configuration dialog. Spell checking itself can be found in Tools->Spelling submenu. You can use a number of modes for spell checking:
This is a generic invocation of a dialog, where you can choose the spellchecking mode and set a default mode, which is invoked by a Ctrl+I.
Spellcheck all messages in the file.
Start spellchecking at the position in the current message and progress towards the end of the file.
Spellcheck the current message only.
If there is a selected text in msgstr editor, this option is available and will spellcheck this text only.
Markup languages are used more and more in GUI. KDE project also uses PO-files for translating DocBook documentation files (which is also a markup language). KBabel contains quite a lot of functionality to support this trend.
Here, we will describe only functions related to tags used for markup itself. The other problem introduced by using markup languages is translation of longer texts. This issue is addressed by the diff feature described in the following section.
The current version of KBabel is capable to find out which tags are used in msgid and provide an easy access to them using following actions from the Edit:
This inserts next tag found in msgid to the translation. KBabel finds the tag to be inserted by counting the number of tags from the beginning of the translation.
This submenu contains all different markup tags found in original english string. By selecting one of them you can insert at the current position of cursor in translated text. translation.
As we said already, current applications, trying to be user friendly, contain a lot of longer descriptive texts, including markup. If a developer changes a part of the text, the GNU gettext system will, in better case, retain the old translation and mark it as fuzzy. (In worse case you will loose the translation completely, depending on the size of the text changes). This works OK, if a msgid is short, because them you can find the changes quickly. But if the text is long enough, you will struggle to find out what has been changed (For example, it can be only an article change by proof-reading team.)
To help, KBabel can be asked to lookup the original msgid and to show the difference. The changes are graphically displayed in the Original String editor. The exact way can be set in the KBabel configuration dialog. Tools->Diff->Show Diff will show the differences found. To see the current text without the mix with the original text, use Tools->Diff->Show Original Text.
You can turn on and off automatic lookup of difference by choosing Tools->Diff->Diff Mode. When the diff mode is on, difference searching starts when you go to another message.
As always, you can use different sources for finding the old version of the text, all being set in in KBabel configuration dialog:
You can use Translation Database for difference lookup. We strongly recommend to turned on automatic storing of the newly translated messages into Translation Database in Translation Database configuration dialog. This mode can be turned on by Use messages from Translation Database.
This will be used only if searching in Translation Database is turned off. By setting Base directory for diff files you can navigate KBabel, which file to use for difference. It takes the relative path of the opened file and uses this relative path in the directory specified here. If there is a corresponding file, it will be used. To you this mode, you should make a copy of old files before each update.
If the previous possibility do not work, correctly, you can always set the difference file manually by choosing Tools->Diff->Open File for Diff.
The difference lookup is not always accurate, because the PO-file does not contain any reference to the original message.
Because plural forms are quite a complicated issue, we devote a special section for their suport in KBabel.
KBabel can read the GNU plural forms only, but cannot edit them. It only supports KDE version of plural forms at the moment.
Every language, to which KDE is translated, must have set a correct number of plural forms. This is done by translating an entry in kdelibs.po. The number is set by selecting the name of a language, which uses the same number and rules for finding the right plural form. The up-to-date list of possible values can be found in the kdelibs source code, in the file kdecore/klocale.cpp.
KDE plural forms are denoted by comment _: containing the %n argument. This argument is then used in the message itself and it controls which plural form of your language should be used depending on the rules for your language.
The translation of a plural form message has to have a special format. It must contain the correct number of translations (one for each plural form) separated by an end of the line \n. For example, “Selected %n files” translated to Slovak would be:
Vybraný %n súbor\n Vybrané %n súbory\n Vybraných %n súborov
To check, if your translation contain correct number of plural forms, use the Tools->Validation ->Check Plural Forms (KDE only) menu.
The Catalog Manager merges two directories into one tree and displays all the PO- and POT-files in these directories. The display allows you to easily see if a new template has been added or an old one has been removed. Some information is shown along with each file name: total number of entries, number of fuzzy entries, number of untranslated entries, the date of the last revision and the last translator of the file.
To make it easier for you to find files that need work or are missing the status of each file is also displayed using an icon:
All the messages in this file are translated.
Some of the messages in this file are fuzzy or untranslated
This file does not exist in the directory of the PO files.
This file contains syntax errors.
Information about this file is being currently updated. When the update is
finished, it will get one of the icons listed above to reflect its state.
If an icon is marked with this icon
, like
,
it indicates that this file or directory does not exist in the
directory of the POT files.
You can mark or unmark a file by selecting Toggle Marking in the context menu of a file.
If you want to toggle or remove all markings in a directory, press the right mouse button over the directory and select Toggle Markings or Remove Markings. The markings are automatically saved when leaving KBabel.
To open a file either double-click on the file, select Open from the context menu or press either Return or Ctrl+O.
You can configure the Catalog Manager by Settings-> Configure Catalog Manager.... See section Preferences for more details.
Besides the main feature for opening the files in KBabel Catalog Manager supports number of other features for maintaining a tree of PO-files.
One of the most requested features for KBabel was a possibility to search and replace in multiple files at once. Catalog Manager supports this feature with a tight integration with KBabel
Catalog Manager can show you a number of statistics about a single file or about the whole directories. The statistics contain number of files, how many of the files have their templates, how many are templates missing. It also counts number of messages in the files and shows statistics about how large parts of the messages are translated, fuzzy-translated or untranslated.
This allows you to check the syntax of multiple PO-files using msgfmt. If a file fails this check, it cannot be used for generating a MO-file for binary distribution. Such an incorrect file will typically result in failing compilation of the package the PO-file belongs to.
Because Catalog Manager cannot provide any functionality you would like to use, you can extend it by defining your own commands.
There are two sets of commands. One for directories and one for single files. You can set them in configuration dialog and access by pressing right mouse button on an entry in the file list.
KBabelDict is a simple interface for translation modules for KBabel. It allows you to search for translations.
The screenshot above does not contain settings for selected module. You can show them using Show Settings. Preferences widget for selected module will be shown on the right side of the window. The KBabelDict window then looks like this:
The usage is very simple. You select a module to in the Search in module combo-box. Then you enter the phrase to lookup and press Start Search. All found messages are shown in the list below, which is the same as a tool in the KBabel main window. Searching can be stopped by pressing Stop. In case you want to search in translated text, not in original English message, you should use Search in translations.
Buttons on the bottom of the window can be used for closing KBabelDict, showing/hiding the module settings or displaying a dialog with credits for KBabelDict and the modules themselves.
For description of the standard modules and their settings see Chapter 5.
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 allows you to store translations in a database based on Berkeley Database II, i.e. 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, 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.
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.
Do not use “good keys”, search in the whole database. This is slow, but will return the most precise results.
Use “good keys” strategy. This option will give you the best tradeoff between speed and exact matching.
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.
Distinguish case of letters when searching the text.
Skip unnecessary white space in the texts, so the searching will ignore small differences of white space, e.g. number of spaces in the text.
Do not include context comments in search. You will want this to be turned on.
Here you can enter characters, which should be ignored while searching. Typical example would be accelerator mark, i.e. & 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.
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).
Text from database matches if the searched string is contained in it. For our example it can be My name is Andrea, you know?.
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.
Consider searched text as a regular expression. This is mainly used for KBabelDict. You can hardly expect regular expressions in PO files.
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.
Maximal number of words in a query to enable one word substitution.
Characters to be considered part of regular expressions.
Two-word substitution is not implemented yet.
The Database tab allows to define where is the database stored on disk (Database directory) 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 already existent PO files. Use one of the buttons in the middle of the dialog box. The progress of the file loading will be shown by progress bars below the buttons. The Repeated strings button should be used in special case when one translated string is repeated many times, so you do not want to store too many of them. Here you can limit the stored strings.
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, e.g. 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.
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 romanic languages to have similar words, similarly for for anglosaxon and slavonic 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 “activ”. KBabel automates this task. Currently you can define only one auxiliary file to search.
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:
The name of application or package currently being translated. For example, it can expand to kbabel, kdelibs, konqueror and so on.
The language code. For example can expand to: de, ro, fr etc.
where “n” is a positive integer. This expands to the “n”-th directory counted from the filename (right to left).
In the edit line the actual path to the auxiliary PO file is displayed. 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-i18n-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-i18n/fr.
My PO sources directory is in /home/clau/cvs-cvs.kde.org/kde-i18n/ro. Don't forget to select PO Auxiliary as the default dictionary and check Automatically start search on the Search tab from KBabel's Preferences dialog.
A compendium is a file containing a collection of all translation messages (pairs of msgid and msgstr) in a project, e.g. 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.
You can configure this searching mode by selecting Settings->Configure Dictionary->PO Compedium 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:
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 e.g. 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.
If the matching of message in compendium should distinguish between uppercase and lowercase letters.
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?)
If the matching text should start and end at the boundaries of words.
A text in compendium matches the search text only if it is exactly the same (of course using the options above).
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 in compendium matches the search text if it contains the search text.
A text in compendium matches the search text if it is contained the 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.
To show the Preferences dialog choose Settings->Configure KBabel... from KBabel's menu. It uses a structured configuration dialog which makes it very easy to find an option without having to perform an extensive search for it.
The left side of the preferences dialog lists the categories of customizable items and the right side shows the corresponding tab for the selected category. KBabel keeps changes if you move between categories, so when you're finally happy click the OK button. At any moment you can use quick help—just click on the question mark on the title bar and, after the cursor has changed to an arrow with a question mark, click on a button, label, or preference entry to find out more about it.
This section allows you to set standard fields for every translated PO file. These are your name, email address, full language name, email address for your translation team mailing list. There is also a timezone field to track your “last modified” time for PO files. You can specify it as character sequence like EEST or offset from GMT time like +0200 (i.e. for Romania). This information is used when updating file headers. You can find the options control what fields in the header should be updated in the Save section of the Preferences dialog.
Character sequences for timezones are not standardized. So you should not use the string set here in time specification for saving in Save tab. You should use %z instead.
Use this for setting number of plural forms for your language. For example, it is 2 for German (one for the singular and one for the plural form).
This feature is currently implemented only for plural forms format used in KDE. It does not work with gettext plural forms.
The editor preferences category is divided in 3 subwindows: General, Appearance, Spell Check and Fonts. All these settings customize how the editor behaves and looks.
This section contains a set of checkboxes.
The first checkbox in the upper side sets if the fuzzy status is resetted automatically when a character is inputted into the MsgStr editor. When this option is disabled you have to manually choose Edit->Unset Fuzzy Status or use the Ctrl+U shortcut. Note that this means the string , fuzzy is removed from the entry's comment.
Next option allows you to enable “clever” editing, where editor automatically inserts special characters escaped correctly, e.g. \t after pressing Tab and it allows special handling of Enter.
The lower checkboxes are very useful in assisting not the correctness of the translation corectness but if the translated string is a suitable replacement for the first within the sofware. For example, many messages represent menu items with keyboard accelerator and C-like formated strings whose structure must remain intact once translated.
When this option is selected C-format strings in the original and the translation are checked to ensure the number of format sequences and the order are consistent.
When this option is selected KBabel checks if the number accelerator characters is identical in both the original and the translated string. Note that accelerator marker is & (but not in every programming toolkit). See the Miscellaneous section below to find how to change a keyboard accelerator.
This is a feature for KDE project development. .desktop files are simply text files which store various parameters in value=key format. Some of these key are translatable. The only restriction is to maintain the left side of equality unchanged. Equation check allows you to spot many errors determined by the fuzzy msgmerge algorithm. Note that there are situations where this function generates false errors on some PO-files.
Some original messages are marked with context information to mark them as being unique even if they represent same word. This is because many simple words, such as “Save”, are translated into many languages. Context information is marked with _:. Many unexperienced translators translate the context information and fill their PO files with garbage. Check this box to make sure you will be warned about these errors in a file.
If you are translating KDE project, it uses a special kind of syntax for specifying plural forms of messages. This check automatically counts the number of forms in msgstr and compares it with the number specified in Identity tab. Incorrect number of plural forms can result in crash of an application.
Your system bell will beep when you switch on entries with errors like those described above.
This is another type of warning about errors in current message. It is a good solution for those who are hearing impaired or dislike bell noise. See also the Appearance tab to find out how to change the text color on errors.
These options let you configure the appearance for the message editor. In upper part there are 4 checkboxes:
Setting this option will enable syntax highlighting for special characters, accelerators and text background in the msgid viewer and msgstr editor. If don't have a monochrome display or have a visual impairment, you should enable this option.
The background will be highlighted only for existing characters in the msgid and msgstr. This includes spaces. This is useful if you don't want to see the surrounding quotes (see below) for the PO entry, and you will still be able to observe starting and ending spaces in a text line.
When you feel the need to count spaces and background highlighting is not your taste then you can check this option to have a point sign drawn in the middle of whitespace characters. Note that the point is a point sign in the center of a character box and is not a decimal point.
If you think that viewing the terminal characters a in msgstr or msgid's text line is better for you then check this option to view the surrounding quotes for every text line.
If you are experienced editing PO files with ordinary text editors you may feel safer if you can track starting and ending double quotes in PO entry lines.
For the different items in edited text there are different color choices to make editing easy. Colors can be changed by clicking on color-picker buttons. From the 'select color' dialogs you can choose from standard colors, custom colors or just pick color from any part of your screen.
This sets the background color for characters in the MsgID view and the MsgStr editor. To change the general background color of edit boxes you must use the KDE Control Center.
Here you can adjust the color for escaped characters like (\") double quotes or (\n) newline.
This is the color for the entire text entry if errors are detected when you try to save PO file. Errors are triggered by not terminating identically both msgid and msgstr, or escaping characters incorrectly.
This sets the color for a characters sequence like in C language printf or scanf functions. In general these start with (%) percent char and are continued by one char.
Keyboard accelerators start with (&) “ampersand” character in KDE but if you are translating for other projects there might be an different character marking the accelerator key. See Miscellaneous section below to find how to change keyboard accelerator.
The status for the current edited entry is marked by three LEDs. For your convenience you can choose where to put these LEDs—either on the statusbar or in the editor section (between the msgid and msgstr entry). If have difficulties viewing some colors or you want to be able to track LED status changes easily without moving your eye you can select the prefered color using the color button chooser.
This is a standard KDE font chooser dialog with a little addition. You can select to view only fixed fonts by checking the Show only fixed fonts option. This is highly recommended for easy translating. The font dialog let you set font family, style, size and encoding. The bottom box shows a preview of the current for user convenience.
This section allows you to edit the options for PO file saving. The first checkboxes group control general behavior for actions performed at PO file saving command.
Check this button, to update the header information of the file everytime when it is saved. The header normally keeps information about the date and time the file was last updated,the last translator etc. You can choose which information you want to update from the Fields to update checkboxes area below. Fields that do not exist are added to the header. If you want to add additional fields to the header you can edit the header manually by choosing Edit->Edit Header in the editor window.
Check this to automatically check syntax of file with msgfmt --statistics when saving a file. You will only get a message if an error occurred. You should keep this options enabled unless know what you're doing.
If you don't want to touch some fields in PO file header or want to force updating specific fields, there are five checkboxes which control: revision date, PO file language, text encoding, last translator name, charset. If a field does not exist, it is appended to the header. If you want to add other information to the header, you have to edit the header manually by choosing Edit->Edit Header in the editor window. Deactivate Update header when saving above if you don't want to have the header updated.
For date and time of the header field PO-Revision-Date you can choose one from bellow formats:
Default is the format normally used in PO files.
Local is the format specific to your country.
Custom lets you define your own format, where you can use the following C-like format strings:
Table 6.1. Year
Format | Meaning | Range |
---|---|---|
%y | year | 00 to 99 |
%Y | year | 0001 to 9999 |
Table 6.2. Month
Format | Meaning | Range |
---|---|---|
%m | month of year | 01 to 12 |
%f | month of year | 1 to 12 |
%b,%h | month abbreviation | Jan to Dec |
Table 6.3. Day
Format | Meaning | Range |
---|---|---|
%j | day of the year | 001 to 366 |
%d | day of month | 01 to 31 |
%e | day of month | 1 to 31 |
%a | weekday abbreviation | Sun to Sat |
Table 6.4. Hour
Format | Meaning | Range |
---|---|---|
%H | hour | 00 to 23 |
%k | hour | 0 to 23 |
%i | hour | 1 to 12 |
%I | hour | 01 to 12 |
%p | AM or PM |
Table 6.5. Minute, Second, Timezone
Format | Meaning | Range |
---|---|---|
%M | minute | 00 to 59 |
%S | second | 00 to 59 |
%Z | timezone | (given in identity settings) |
%z | timezone | (numeric offset as specified by system settings) |
The lower group cover encoding options for PO file when saving. If you work on KDE project you should be aware that at least desktop.po file must be UTF-8 encoded. Popup list let you select messages encoding. At least your language setting and UTF-8 must be. If, for some reasons, you don't want accidentally change current PO file encoding, turn on Keep the encoding of the file.
Here you can set your spell checking preferences. These is for interest if you have dictionary file for your translating language. Bellow are items to consider setting:
For new words added to the personal dictionary, spell check engine will create root/affix combinations to match more than one word (variations).
If this is turned on then joined words will be treated as errors. However, this situations is very usual in German language, which have a very large number of compound words, so should be left turned off in that case.
From the popup list you can choose which dictionary to use. Note that you must install an appropriate dictionary for your language. Check your ispell or aspell distribution to find out if you have one.
Here you choose the encoding for your text. This option is passed to the spellchecker, and is used as the encoding for your words dictionary. See the kspell documentation for more details.
Backend program to use for spell checking. Currently either ispell (International Ispell) or aspell.
Keep track of user-ignored words when spell-checking PO files. It is very convenient to ignore the abbreviations or strange letter combinations you meet in GUI interfaces.
Here you can set location of the file for ignored words. Click on the folder icon to the right of the edit box. The default is $(HOME)/.kde/share/apps/kbabel/spellignores, where $(HOME) is your home directory.
The search section allows you to customize various settings for searching in previous translated strings.
General settings are common for all search types. If you check the Automatically start search option then the search is automatically started whenever you switch to another entry in the editor. Currently there are at three posibilies you can choose from, but since KBabel can use dictionary plugins the available dictionaries depend on those installed. Using Settings->Configure Dictionary->... you can configure every search plugin.
The default installed dictionary plugins are:
This new method is still in alpha stage of development and base it task on KBabelDict which accompanies KBabel. See KBabelDict documentation for further info on configuring search engine.
The compendium is a normal PO file, which should contain a list of standard translation from your translation team. If you don't have one, you can also use a file that contains all translations of your team (e.g. the $lang.messages file in the KDE Project, that can be found at i18n.kde.org).
The auxiliary should help you finding the context of a translation by looking up the same message in a message catalog of the same package but translated to another language. This way you can have a look how this message is translated in another language.
You can also start searching manually by choosing an entry in the popup menu that appears either by clicking Dictionaries->Search Text->PO Compendium or by keeping the search button on the toolbar pressed for a while.
The Diff section hold settings how to display differences in msgids.
Every difference can be displayed by two added parts and by removed characters of the text. For both you can specify the method of displaying and the color, which will be used. Highlighted means that the background of the corresponding characters will be shown in the selected color, while Underlined(for added characters) or Striked Out (for removed characters) will denote the changed parts by colored lines.
Diff mode needs to find the original msgid to compare to. For this purpose, KBabel can use translation database if you turn in on by Use messages from Translation Database. Second possibility is to use a tree of original PO files. Then you need to specify the root of the tree in Base directory for diff files.
Miscellaneous section hold settings which don't feet anywhere. Currently are two:
Here you can put your own character which serve as marker for keyboard accelerator indicator in GUI. By default it is & (ampersand), but in some programing toolkits it may vary. For example in Gnome/GTK translations the underscore character “_” is the marker for the keyboard accelerator.
For unexperienced user "regular expression" sound strange. However, you're advised to change default value only you know what you are doing. Some GUI programming toolkits provide own context information description methods. Consult an experienced developer if you translate PO files other than KDE specifics. For the sake of completness I "translate" for you what default regular expression mean: "the text match if it start with _: and is followed by one or more characters and end with a newline".
This dialog allows you to edit the options for the Catalog Manager.
Here are two editlines with Browse... buttons. Type in the directories which contains all your PO- and respectively POT-files. The files and the directories in these directories will then be merged into one tree in Catalog Manager window.
Below you can turn on and off if:
If this is activated all files that are opened from the Catalog Manager are opened in a new window.
If you check this KBabel tries to kill the processes, that are not exited already when program close by sending a kill signal to them.
It's not guaranteed, that the processes are killed.
If you check this KBabel will create an index of contents for every file in the tree. This index is then used in find/replace operations.
There is a large speed trade-off. If you enable creating index, the updating of file information will be much slower. On the other hand, it speedup find/replace operation considerably.
Here you can insert commands you want to execute in directories from the Catalog Manager. The commands are then shown in the submenu Commands in the Catalog Manager's context menu.
Insert in field Name the name of the command. The name can be chosen freely and is only used to be displayed in the menu. In field Command insert the command, you want to have executed when selecting the corresponding menu item. Then press Add button to add the command to your available commands. To edit a command, select it, press Edit button and press Add after you have finished. To remove a command, select one from list and press Remove button. If you want different order in contexual submenu, you can use up and down buttons.
The command is executed through your default shell, so you can execute multiple commands at once by separating them with a semicolon, and you can set environment variables, if you need. The commands are executed in the (PO file) directory, you have selected in the Catalog Manager.
The following strings will be replaced in a command:
@PACKAGE@: The name of the directory without path
@PODIR@: The name of the PO-directory with path
@POTDIR@: The name of the template directory with path
E.g.: If you want to execute make and then make install you could insert in field Name Make install and in field Command make; make install. If you then select Commands->Make install from the context menu of a directory, the commands listed above will be executed in this directory.
Here you can insert the commands you want to execute on files from the Catalog Manager. The commands are then shown in the submenu Commands in the Catalog Manager's context menu.
Insert in field Name the name of the command. The name can be chosen freely and is only used to be displayed in the menu. In field Command insert the command, you want to have executed when selecting the corresponding menu item. Then press Add button to add the command to your available commands. To edit a command, select it, press Edit and press Add after you have finished. To remove a command, select one from list and press Remove button. If you want different order in contexual submenu, you can use up and down buttons.
The command is executed through your default shell, so you can execute multiple commands at once by separating them with a semicolon, and you can set environment variables, if you need. The commands are executed in the (PO file) directory, in which the file, you have selected in the Catalog Manager, is.
The following strings will be replaced in a command:
@PACKAGE@: The name of the file without path and extension
@POFILE@: The name of the PO file with path and extension
@POTFILE@: The name of the corresponding template file with path and extension
@PODIR@: The name of the directory, the PO file is in, with path
@POTDIR@: The name of the directory, the template file is in, with path
For example, if you want to merge the template file into your PO file you could insert in field Name Merge and in field Command msgmerge @POFILE@ @POTFILE@ > @PACKAGE@.new && mv @PACKAGE@.new "@PACKAGE@.po. If you then select Commands->Merge from a file's context menu, the PO file will be merged with its template file.
Open PO file. If the current file is modified you will be prompted to save it first.
The recently-used documents list menu is displayed, allowing you to open recently edited PO files.
Saves current POfile. If it's not modified no action is taken.
Saves current PO file under new name.
Load the last saved version of the current PO file.
Open a new window with current file loaded. Very useful if you have to translate large files and you need to keep an eye back to some strings.
Open a new empty window.
Quits KBabel
Undo the last edit action in the translation edit box.
Redo last undoedne edit action in translation edit box.
Cut the selected text and move it in clipboard.
Copy the selected text to the clipboard.
Paste the contents of the clipboard at the current cursor position in the translation edit box.
Select all text from translation edit box.
Open Find dialog for searching strings in current PO file.
Find next occurrence of string from previous search action.
Open the Replace dialog for searching and replacing strings in current PO-file.
Clears the translation for current msgid.
The original English string is copied into the translation edit box. This useful when you need to make from no adjustment to minor changes in the original English text (msgstr).
String found after translation searching is copied in msgstr edit box. This is very useful if you don't want to work on retranslating the same message again and again.
Toggles fuzzy status for currenty entry. It can be useful to turn fuzzy on, e.g. to mark the translation for another review.
If original english string contains markup tags, this inserts next tag found in msgid to the translation.
This submenu contains all markup tags found in original english string. By selecting one of them you can insert at the current position of cursor in translated text. translation.
Edit PO-file header. Actually there are many header lines, which keep last translated date, translator name and email, language and translated text encoding etc..
Skip to previous entry in PO file.
Skip to next entry in PO file.
Open dialog to jump to specified entry number from PO file.
Jump to first entry in PO file.
Jump to last entry in PO file.
Jump to first previous entry which is untranslated or marked as fuzzy.
Jump to first next entry which is untranslated or marked as fuzzy.
Jump to first previous fuzzy entry.
Jump to first next fuzzy entry.
Jump to first previous untranslated entry.
Jump to first next untranslated entry.
Jump to previous entry with error. It's likely to happen when you forget to escape doublequotes or original string end in "return" (\n) char and translated string don't (and vice versa).
Jump to next entry with error. It's likely to happen when you forget to escape doublequotes or original string end in "return" (\n) char and translated string don't (and vice versa).
Jump to last visited entry in PO file.
Jump to previous visited entry in PO file.
Note that this menu is dynamic. It depend on installed dictionaries plugins. By default are three of them.
Start searching translation for current original english message using KDE Database Search Engine.
Start searching translation for current original english message in PO file defined by user.
Start searching translation for current original english message in compendium file (made by merging all translated messages for one language).
Start searching selected text using KDE Database Search Engine.
Start searching selected text using file defined by user.
Start searching selected text using compendium file with all language translated messages.
Allow you to edit content of current dictionary. Usefull if you found errors in dictionary and want to not be bored by errors when searching and replacing strings. (Not implemented yet)
Bring up spell check configuration dialog. After you select desired options hit OK and the normal spell checking dialog will appear.
Start spell checking all words for opened PO file.
Start spell checking from current cursor position.
Spell check only current entry from PO file.
Spell check only selected text in MsgStr editbox.
Check syntax for current PO file. Errors may appear from CVS merging or users mistakes when translating process is made by hand.
When this option is selected C-format strings in the original and the translation are checked to ensure the number of format sequences and the order are consistent.
When this option is selected KBabel checks if the number of accelerator characters is identical in both the original and the translated string. Note that accelerator marker is & in KDE (but not in every programming toolkit). See the Miscellaneous section below to find how to change a keyboard accelerator.
Some original messages are marked with context information to mark them as being unique even if they represent same word. This is because many simple words, such as “Save”, are translated into many languages. Context information is marked with _:. Many unexperienced translators translate the context information and fill their “PO” files with garbage. Check this box to make sure you will be warned about these errors in a file.
Check if PO file contains right number of translation for each KDE-specific plural form messages.
Check if left side from translated string is same with left side from original string. Sides are delimited by equal sign character.
Show difference found to the original translated message.
Hide difference markings and show msgid only.
Open file to be used for difference lookup.
Toggle difference mode.
Invoke rough translation dialog for automated translation.
Open Catalog Manager. Read Catalog Manager section for more details.
When checked, standard toolbar is displayed.
When checked, bottom statusbar is displayed.
When checked, navigationbar is displayed.
When checked, upper right part of main window which contain current entry comments will be displayed.
When checked, bottom right part of main window which contain search results through dictionary will be displayed.
Open configure dialog for keys bindings to actions. This will let you to customize default key bindings to suite your needs.
Standard toolbars configuration dialog will open. You can choose which actions will go in toolbars and what toolbar you customize.
All KBabel specific settings go here. Please read Preferences section for specific topics.
Open dialog for KDE Database Search Engine configuration.
Open dialog for PO auxiliary file configuration.
Open dialog for PO compendium file configuration.
Open the KBabel handbook. It's what you read now.
Cursor change to arrow with question mark and you can click with it on various elements on main window. A quick help window will open.
Open the gettext manual page in KDE Help Center. This package of tools help in process of POT and PO files handling.
This will open a standard error reporting dialog for KDE It's useful if you experience abnormal behavior of KBabel. KBabel's developer will be glad to receive any comments, wishes and bug reports.
Open message box which inform you about KBabel's version, developer name and e-mail address.
Open message box which inform you about the KDE project, contact information and how you can report bugs and whishes.
Show up an message box with information about people who made KDE Database Search Engine.
Show up an message box with information about people who made searching in auxiliary file.
Show up an message box with information about people who made searching in compendium file.
Load PO file in KBabel for editing.
Save current PO file if it's modified.
Undo last operation.
Redo last operation.
Cut selected text and move it in clipboard.
Copy selected text in clipboard.
Paste text from clipboard at current cursor position.
Find specified string in current PO-file.
Skip to previous entry in PO-file.
Skip to next entry in PO file.
Copy original string to translated string edit box.
Drop down toolbar for searching selected text using: KDE Database Search Engine, PO auxiliary file, PO compendium file and others dictionary plugins if available.
Stop current searching in progress.
Open Catalog Manager window.
Skip to previous entry in PO file.
Skip to next entry in PO file.
Jump to first entry in PO file.
Jump to last entry in PO file.
Jump to previous fuzzy or untranslated entry in PO file.
Jump to next fuzzy or untranslated entry in PO file.
Jump to previous fuzzy entry in PO file.
Jump to next fuzzy entry in PO file.
Jump to previous untranslated entry in PO file.
Jump to next untranslated entry in PO file.
Jump to previous error in PO file.
Jump to next error in PO file.
Jump to last visited entry in PO file.
Jump to previous visited entry in PO file.
Current message in edited PO file.
Total number of messages in PO file.
Number of messages marked as fuzzy. They should be revised and translated if needed.
Number of yet untranslated messages.
INS - insert, and OVR - overwrite. Same meaning like in every ordinary text editor.
RO - read-only file, RW - read-write access on file. When file is read-only you cannot modify entries in editor.
Usualy, this bar is hidden. It is displayed only when saving is done or you search messages in PO-file, compendium or else.
Open Find dialog for searching strings in a set of PO files.
Open Replace dialog for searching and replacing strings in a set of PO files.
Stop currently running find/replace operation.
Toggle mark for the selected file.
Removes mark for the selected file or directory.
Toggles marks for the selected file or directory (recursively).
Remove marks for the selected file or directory (recursively).
Show statistics about number of translated/untranslated/fuzzy messages for the selected file or subtree.
Check syntax for the selected file or subtree using msgfmt.
When checked, standard toolbar is displayed.
When checked, bottom statusbar is displayed.
Open configure dialog for keys bindings to actions. This will let you to customize default key bindings to suite your needs.
Standard toolbars configuration dialog will open. You can choose which actions will go in toolbars and what toolbar you customize.
All Catalog Manager specific settings go here. Please read Preferences section for specific topics.
Invokes the KDE Help system starting at the KBabel help pages. (this document).
Changes the mouse cursor to a combination arrow and question mark. Clicking on items within KBabel will open a help window (if one exists for the particular item) explaining the item's function.
Opens the Bug report dialog where you can report a bug or request a “wishlist” feature.
This will display version and author information.
This displays the KDE version and other basic information.
is a KBabel specific issue. It is an option for the user to set up one PO file so search through for original messages. For example, if you're a member of French team and have some Spanish or Italian knowledge you can grab and set-up an auxiliary Spanish PO file associated with the file currently being translated.
is a collection of all translations for one language. This big PO file is made by unique messages from all applications PO files. It can be used to fill in all already translated strings into new yet untranslated or partially translated PO file. KBabel use such file in “PO Compendium” search engine.
is the operation by which an application is made aware and able to support multiple languages. The word “internationalization” has 20 characters so, to shorten it, people started to write only the first and last characters and between them write the number of intermediate characters (18) forming the common abbreviation i18n.
See Also Localization.
is the operation by which an application already internationalized is made to process input and output in a fashion desired by some cultural and language habits. The word “localization” has 12 characters so, to shorten it, people started to write only the first and last characters and between them write the number of intermediate characters (10) forming the common abbreviation l10n.
See Also Internationalization.
MO stands for “Machine Object”. A MO file contains binary data suitable for reading by computers. The contents of a MO file are organised as a database to minimize the lookup time for translated strings. MO files are obtained by compiling PO files using msgfmt.
msgid is the keyword which introduce the original string in PO file. It is followed by C-like string that span on one or multiple lines.
See Also Message String.
msgstr is the keyword which introduce the translated string in PO file. It is followed by C-like string that span on one or multiple lines.
See Also Message ID.
PO stands for “Portable Object”. PO files contain sets of strings which associate each translatable string with its translation in a particular language. A single PO file relates only to one language. A PO file is derived from an POT file and is edited either by hand or using KBabel.
POT stands for “Portable Object Template”. A “POT” file is built by extracting all the translatable strings from application source files. A “POT” file does not contain translations into any particular language— it is used by the translators as a template.
KBabel
Program copyright 1999-2000 Matthias Kiefer <matthias.kiefer@gmx.de>
Contributors:
Thomas Diehl <thd@kde.org>
Stephan Kulow <coolo@kde.org>
Documentation copyright 2000 Claudiu Costin <claudiuc@geocities.com> and Matthias Kiefer <matthias.kiefer@gmx.de>
Update for KDE 3.0 copyright 2002 Stanislav Visnovsky <visnovsky@kde.org>
This documentation is licensed under the terms of the GNU Free Documentation License.
This program is licensed under the terms of the GNU General Public License.
KBabel is part of the KDE project http://www.kde.org/.
KBabel can be found in the kdesdk package on ftp://ftp.kde.org/pub/kde/, the main FTP site of the KDE project.
In order to successfully use KBabel, you need KDE 3.x.
All required libraries as well as KBabel itself can be found on ftp://ftp.kde.org/pub/kde/.
If you want to use Translation database, you need Berkeley Database II.
In order to compile and install KBabel on your system, type the following in the base directory of the KBabel distribution:
% ./configure % make % make install
Since KBabel uses autoconf and automake you should have no trouble compiling it. Should you run into problems please report them to the KDE mailing lists.