To show the project setting dialog choose -> from KBabel's or Catalog Manager'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 button. At any time 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.
Pages for settings for KBabel (the editor) and for Catalog Manager are in the list.
These settings are for KBabel.
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 (that is, for Romania). This information is used when updating file headers. You can find the options that 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 GNU gettext plural forms.
These settings are for KBabel.
TODO This seems to document only the "General" tab but not the "Header" and "Copyright" ones
This section allows you to edit the options for PO file saving. The first group of checkboxes controls general behavior for actions performed in PO file saving.
Check this button, to update the header information of the file every time 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 -> 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 validation enabled unless you know what you are doing.
If you do not want to touch some fields in a PO file header or want to force updating of specific fields, there are five checkboxes which control this: 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 -> in the editor window. Deactivate 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 of the formats: Default, Local, Custom.
You should keep the default setting of Default. The two other settings make that the generated PO file is not a standard GNU gettext PO file anymore, so this should be avoided.
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.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 |
The option to select the date format for the PO file is considered to be deprecated, and will probably be removed in a future version of KBabel.
The lower group covers encoding options for PO files when saving. If you work on the KDE project you should be aware that at least PO files must be UTF-8 encoded in KDE. Alternatively you can select the encoding corresponding to your locale. If, for some reason, you do not want to accidentally change the current PO file encoding, turn on .
For reason of informtation interchange, GNU gettext limits the encodings allowed for a PO file. KBabel does not know of this restriction, so the encoding correspondig to your locale might not be suitable. (UTF-8 is always supported by GNU gettext.)
These settings are for KBabel.
Here you can set your spell checking preferences. This is of interest if you have a dictionary file for the language you are translating to. Below are the items to consider setting:
For new words added to the personal dictionary, the spell checker will create root/affix combinations to match more than one word (variations).
If this is turned on, joined words will be treated as errors. However, such words are very common in the German language, which have a very large number of compound words, so it 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 tdespell documentation for more details.
The encoding selected here is not linked to encodings of the PO files. Depending on the spellchecker (especially in the case of ispell), you might not have much choice for the encoding. (For example, a few Western European languages can only work with ispell when using ISO-8859-1.)
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
$
,
where HOME
/.trinity/share/apps/kbabel/spellignores$
is your home folder.
HOME
These settings are for KBabel.
This dialog is for setting how KBabel should construct the full path from each source references, which are in the comments of each entry of a PO file.
In the edit line Base folder for source code, you can set a
base folder where the source code of your project is. This defines the value of the variable
@CODEROOT@
, which is described below.
In the group Path Patterns, you can define patterns or rules
to construct the paths with the help of a few variables:
@CODEROOT@
, @PACKAGEDIR@
,
@PACKAGE@
, @COMMENTPATH@
,
@POFILEDIR@
, which are defined below.
The variable @PODIRFILE@
was introduced in KBabel version 1.11.1 (for KDE 3.5.1).
With the button , you can add the line from the text box to the list of used path patterns. With the button , you can remove the selected pattern from the list. With the buttons and , you can change the priority of the path patterns.
@CODEROOT@
: The base folder of the source code.
@PACKAGEDIR@
: The folder of the package (i.e. PO file).
@PACKAGE@
: The package name (i.e. PO file name without extension).
@POFILEDIR@
: The folder of the PO file.
@COMMENTPATH@
: The relative path given as source reference in the comment of an entry of the PO file.
The variables @PACKAGEDIR@
and @POFILEDIR@
have similar
meaning but not the same result. The variable @POFILEDIR@
will always hold the folder of PO file,
@PACKAGEDIR@
might not. If the PO file was loaded
by the help of the Catalog Manager then @PACKAGEDIR@
has only the part of
the path, based on the PO base path defined for the Catalog Manager
(see below).
The variables @CODEROOT@
and @POFILEDIR@
can only be used at
the beginning of a pattern to be useful. The variable @COMMENTPATH@
can only be used at the
end of a pattern and is nearly mandatory.
The variables @PACKAGEDIR@
and @POFILEDIR@
should not be used in the same pattern. The variables @CODEROOT@
and @POFILEDIR@
should not be used in the same pattern either.
From KBabel 1.11.1 (of KDE 3.5.1) on, there are five default path patterns:
@PACKAGEDIR@
/@PACKAGE@
/@COMMENTPATH@
@CODEROOT@
/@PACKAGEDIR@
/@PACKAGE@
/@COMMENTPATH@
@CODEROOT@
/@PACKAGE@
/@COMMENTPATH@
@POFILEDIR@
/@COMMENTPATH@
@POFILEDIR@
/../@COMMENTPATH@
KDE projects need typically the third pattern. The last pattern is typical for GNU projects, where the source references are related to the parent of the directory where the PO file is.
In most cases the default path patterns should be enough, whatever the project is for KDE (assuming that you have set the correct base directory) or if the project is a GNU one (or structured like a GNU project).
For KDE, some PO files do not contain enough information (including the file path and name) for KBabel to find the right source file that is supposed to be refered. To fix that you would need precise path patterns for such files, which is nearly impossible to define by the numbers of such files in KDE. But if you work often with such a file, may be it is worth to set a path pattern explicitely for supporting that PO file.
For creating your own path patterns, you can use the variables defined above,
but apart @COMMENTPATH@
not any variable is mandatory to use.
(To be exact, @COMMENTPATH@
is not mandatory either,
but not using it will probably lead to no result.)
An example of path pattern could be that you want to display the source reference
of KDE's file desktop_tdebase.po. In that case you will probably need a path pattern like:
@CODEROOT@
/@PACKAGEDIR@
/tdebase/@COMMENTPATH@
(compared to one of the default path patterns, the sequence @PACKAGE@
has been
replaced by tdebase).
In case of really complex problems you can, of course, define an absolute path
without any variables beside @COMMENTPATH@
, like for example:
/home/usr/kde-source/tdebase/@COMMENTPATH@
assuming that
/home/usr/kde-source/tdebase is the path where the tdebase source module is.
These settings are for KBabel.
Miscellaneous section holds KBabel settings that do not fit anywhere else.
Here you can select your own character to serve as the keyboard accelerator indicator in a GUI. By default it is & (ampersand), but in some programming toolkits it may vary. For example, in Gnome/GTK translations the underscore character “_” is the marker for the keyboard accelerator.
For inexperienced users "regular expression" may sound strange. So you are advised to change the default value only if you know what you are doing. Some GUI programming toolkits provide their own context information description methods. Consult an experienced developer if you translate PO files other than standard KDE files. For the sake of completeness I will "translate" for you what the default regular expression means: "the text matches if it starts with _: and is followed by one or more characters and ends with a newline".
These settings are for Catalog Manager.
Here are two edit lines with folder buttons. Type in or select the folders that contains all your PO and respectively POT files. The files and the folders in these folders 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 the program closes 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 , the updating of file information will be much slower. On the other hand, it speeds up find/replace operations considerably.
These settings are for Catalog Manager.
Here you can insert commands you want to execute in folders from the Catalog Manager. The commands are then shown in the submenu in the Catalog Manager's context menu.
Insert in the Command Label field the label of the command. The label can be chosen freely and is only used to be displayed in the menu. In the Command field insert the command you want to have executed when selecting the corresponding menu item. Then press the button to add the command to your available commands. To edit a command, select it, press the button and press after you have finished. To remove a command, select it from the list and press the button. If you want a different order in the contextual submenu, you can use the 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 to. The commands are executed in the (PO file) folder you have selected in the Catalog Manager.
The following strings will be replaced in a command:
@PACKAGE@
: The name of the folder without path
@PODIR@
: The name of the PO-folder with path
@POTDIR@
: The name of the template folder with path
E.g.: If you want to execute make and then make
install you could insert in Make install
in the
Name field, and make; make install
in the Command field. If you then select
->
from the context menu of a folder, the commands listed above will be
executed in that folder.
These settings are for Catalog Manager.
Here you can insert the commands you want to execute on files from the Catalog Manager. The commands are then shown in the submenu in the Catalog Manager's context menu.
Insert in the Command Label field the label of the command. The label can be chosen freely and is only used to be displayed in the menu. In the Command field insert the command you want to have executed when selecting the corresponding menu item. Then press the button to add the command to your available commands. To edit a command, select it, press the button and press the button after you have finished. To remove a command, select it from the list and press the button. If you want a different order in the contextual submenu, you can use the 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) folder, 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 folder the PO file is in, with path
@POTDIR@
: The name of the folder the template file is
in, with path
For example, if you want to merge the template file into your PO file you could
insert Merge
in the Name field and
msgmerge @POFILE@ @POTFILE@ > @PACKAGE@.new && mv @PACKAGE@.new
"@PACKAGE@.po
in the Command field.
If you then select
->
from a file's context menu, the PO file will be merged with its template file.
These settings are for Catalog Manager.
The checkboxes switches on or off the corresponding column of the Catalog Manager's view.
Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team