Project Settings
Prev
Next

Project Settings

To show the project setting dialog choose Project->Configure... 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 OK 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.

Note

Pages for settings for KBabel (the editor) and for Catalog Manager are in the list.

Identity

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.

Warning

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.

Number of singular/plural forms

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).

Note

This feature is currently implemented only for plural forms format used in KDE. It does not work with GNU gettext plural forms.

Save

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.

Update header when 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 Edit->Edit Header in the editor window.

Check syntax of file when saving

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 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 of the formats: Default, Local, Custom.

Important

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.1. Year

    FormatMeaningRange
    %yyear00 to 99
    %Yyear0001 to 9999

    Table 6.2. Month

    FormatMeaningRange
    %mmonth of year01 to 12
    %fmonth of year1 to 12
    %b,%hmonth abbreviationJan to Dec

    Table 6.3. Day

    FormatMeaningRange
    %jday of the year001 to 366
    %dday of month01 to 31
    %eday of month1 to 31
    %aweekday abbreviationSun to Sat

    Table 6.4. Hour

    FormatMeaningRange
    %Hhour00 to 23
    %khour0 to 23
    %ihour1 to 12
    %Ihour01 to 12
    %p AM or PM

    Table 6.5. Minute, Second, Timezone

    FormatMeaningRange
    %Mminute00 to 59
    %Ssecond00 to 59
    %Ztimezone(given in identity settings)
    %ztimezone(numeric offset as specified by system settings)

Note

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 Keep the encoding of the file.

Caution

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.)

Spell Check

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:

Create root/affix combinations not in dictionary

For new words added to the personal dictionary, the spell checker will create root/affix combinations to match more than one word (variations).

Consider run-together words as spelling errors

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.

Dictionary

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.

Encoding

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.

Note

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.)

Client

Backend program to use for spell checking. Currently either ispell (International Ispell) or aspell.

Remember ignored words

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.

File to store ignored words

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/.trinity/share/apps/kbabel/spellignores, where $HOME is your home folder.

Source reference

These settings are for KBabel.


Project Settings, source reference

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.

Dialog elements

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.

Note

The variable @PODIRFILE@ was introduced in KBabel version 1.11.1 (for KDE 3.5.1).

With the button Add, you can add the line from the text box to the list of used path patterns. With the button Remove, you can remove the selected pattern from the list. With the buttons Up and Down, you can change the priority of the path patterns.

The variables

  • @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.

Important

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).

Note

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.

The default path patterns

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@

Note

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.

Creating New Path Patterns

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).

Note

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.

Miscellaneous

These settings are for KBabel.

Miscellaneous section holds KBabel settings that do not fit anywhere else.

Marker for keyboard accelerator

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.

Regular expression for context information

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".

Project folders

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:

Open files in new window

If this is activated all files that are opened from the Catalog Manager are opened in a new window.

Kill processes on exit

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.

Note

It's not guaranteed that the processes are killed.

Create index for file contents

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.

Warning

There is a large speed trade-off. If you enable Create index for file contents, the updating of file information will be much slower. On the other hand, it speeds up find/replace operations considerably.

Folder Commands

These settings are for Catalog Manager.


Project Settings, folder commands

Here you can insert commands you want to execute in folders from the Catalog Manager. The commands are then shown in the submenu Commands 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 Add button to add the command to your available commands. To edit a command, select it, press the Edit button and press Add after you have finished. To remove a command, select it from the list and press the Remove 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 Commands->Make install from the context menu of a folder, the commands listed above will be executed in that folder.

File Commands

These settings are for Catalog Manager.


Project Settings, file commands

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 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 Add button to add the command to your available commands. To edit a command, select it, press the Edit button and press the Add button after you have finished. To remove a command, select it from the list and press the Remove 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 Commands->Merge from a file's context menu, the PO file will be merged with its template file.

Catalog Manager

These settings are for Catalog Manager.


Project Settings, Catalog Manager

The checkboxes switches on or off the corresponding column of the Catalog Manager's view.

Diff

These settings are for Catalog Manager.


Project Settings, diff

TODO

Prev
Next
Home


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