[GRASS-dev] Plural form support in GRASS 7 translated messages

Maris Nartiss maris.gis at gmail.com
Mon Mar 3 12:50:06 PST 2014


Hello all devs,
starting from r59156 (and r59189) GRASS 7 is capable of using gettext
provided plural form support for translatable messages. Thus finally
users with different plural form handling than in English language
will be able to see grammatically correct translated messages. For
English speaking GRASS users it also would mean departure from such
strange forms as "map(s)", "file(s)" etc.

I kindly ask from now on to use the new function (a macro wrapper of
dngettext) _n() to wrap any translatable text messages where its
content depends on a number. Syntax of function is following:
_n("English singular", "English plural", number)
For some usage examples, please, see locale/README

Gettext documentation on ngettext function and its use (with examples):
http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms

Relevant commits:
_n() macro: r59156 and r59189
update to documentation: r59174
extraction of _n() content to POT files: r59157
a fix for some of library messages: r59158

Currently _n() works only in C code. I hope some of Python gurus will
clarify/implement same thing for Python parts of GRASS.

Thanks to Paulo, Martin, Vaclav for a fast feedback.

When the code will settle down (read - C gurus will fix all mistakes I
made), a separate notice to translators with a request to report
"strange" strings should be made.

Thank you all,
Maris.


More information about the grass-dev mailing list