Skip to content

i18n problem (hardcoded plurals) #354

Closed
timsk opened this Issue Oct 26, 2012 · 1 comment

3 participants

@timsk
timsk commented Oct 26, 2012

https://github.com/mysociety/fixmystreet/blob/master/templates/web/fixmystreet/report/_support.html contains this line:

[% IF !problem.interest_count %][% text=loc('No supporters') %][% ELSIF problem.interest_count == 1 %][% text = loc('1 supporter') %][% ELSE %][% text = tprintf( loc('%d supporters' ), problem.interest_count ) %][% END %]

Hard-coding plurals like this makes i18n and translation impossible in many languages, as they treat plurals differently (i.e. not just n=0, n=1, and n>1; some languages have a separate form for n=2, or 2<=n<=4, n>5, etc.) See e.g. http://translate.sourceforge.net/wiki/l10n/pluralforms

Your i18n framework will no doubt have a way of coding plurals which allows translators to do their job.

@dracos
mySociety member
dracos commented Feb 21, 2013

Fixed by d6ecb31

@dracos dracos closed this Feb 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.