Plural Forms

Plural Forms

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.

KDE Logo