About [[Mifos:Ui-EXCEEDING NUMBER OF DIGITS AFTER DECIMAL SEPARATOR FOR MONEY/en]]

This message needs plural support.

Siebrand17:39, 19 March 2011

Hi Siebrand,

I see the message reads: EXCEEDING_NUMBER_OF_DIGITS_AFTER_DECIMAL_SEPARATOR_FOR_MONEY=Only %s digit(s) after decimal separator is allowed

This seems to take care of plural support. Is this resolved or perhaps I don't understand your comment.

Jasmine21:19, 9 April 2011

There are languages where adding (s) for plural just does not work. Whenever you use numbers in running sentences, you really, really need a proper implementation for plurals in your i18n framework. Have a look at Plural to see how many different grammers there are...

Siebrand23:51, 9 April 2011

Thanks Siebrand. I read a little bit about plural-forms on gettext utilities. If I understand correctly, in some languages, the plural form will depend on the value of %s. In this case, the translation would have to be generated on the fly depending on %s, which seems like it would be difficult to do.

Here's another ignorant question. If we rephrase the message to read as follows: EXCEEDING_NUMBER_OF_DIGITS_AFTER_DECIMAL_SEPARATOR_FOR_MONEY=The number of digits after the decimal separator exceeds the allowed number, %s.

Is this equally difficult to translate because the plural form 'digits' is still dependent on %s?

Alternatively, I also tried to look through the code to see what %s should be, but it wasn't straightforward - I'll look more carefully and post what I discover.

Jasmine05:55, 12 April 2011

In PHP using gettext extraction, you'd need something like this:

<?php
  sprintf(ngettext('Only %d digit after decimal separator is allowed',
                   'Only %d digits after decimal separator are allowed',
                   $digitsAllowed),
         $digitsAllowed);

I do not know which language Mifos is written in. We can probably provide examples for plural implementations in at least PHP, Ruby and Java.

Siebrand16:25, 12 April 2011

Mifos is written in Java. It uses Spring MVC and Freemarker as well as Javascript.

Jasmine01:20, 15 April 2011

A JIRA task has been filed to properly implement plurals in i18n framework.

http://mifosforge.jira.com/browse/MIFOS-4946

Jasmine06:42, 19 April 2011

Excellent progress, Jasmine. Thanks.

Siebrand06:51, 19 April 2011