Skip to content

Support plural translations

Cédric Krier requested to merge topic/default/trytond-ngettext into branch/default

This adds the support for plural translation. Only report and ir.message are concerned as the other types are labels that have no counter.

The plural rule is a Python expression which return an integer following the gettext design. Another option would have been to use the CLDR Plural Rules because Babel support them and can convert them to Python or Javascript. But they are also less flexible and would require to add Babel as dependency. The Javascript conversion would be nice but actually we have only 2 messages in the client which would require plural. And we do not have yet a JS library that support ngettext.

For the report, it is possible to use the Genshi i18n:choose, i18n:singular, i18n:plural and for OpenDocument the gettext and ngettext methods are added to the evaluation context.

Merge request reports

Loading