Open crowbot opened 7 years ago
Note n_()
can only handle 1 count value at a time so without splitting the string into 2 parts, we'd have to choose between being able to generate plural form translations for requests or authorities.
FastGettext.n_
Although having looked at this in a bit more detail, I am struggling to work out under what circumstances the front page would need this, particularly given that IPV currently has over 6,000 public requests and nearly 12,000 authorities.
What am I missing?
What am I missing?
I think that there need to be three options, rather than two:
We need one, few and many version for the number of requests and number of authorities."
I guess this means adding an abnormal pluralisation rule to FastGettext.
I guess this means adding an abnormal pluralisation rule to FastGettext
It's already in the pofile so we don't need to add anything to the Ruby code:
"Language-Team: Czech (http://www.transifex.com/mysociety/alaveteli/language/cs/)\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
So to solve this for Czech, I just need to add an extra option to the call to n_
(Although it looks as though Polish has 4 plural forms and Arabic has 6...)
Although I still can't work out how to deal with this format:
Search over<br/>" \
"<strong>{{number_of_requests}} requests</strong> " \
"<span>and</span><br/>" \
"<strong>{{number_of_authorities}} authorities</strong>"
as it has multiple plurals in a single string
Ah with you. Seems like you can't.
I guess you'd have to have a few different strings to handle the different cases
if number_of_requests.size == 1 && number_of_authorities.size == 1
# …
elsif number_of_requests.size > 1 && number_of_authorities.size == 1
# …
#etc
end
Not sure its worth the effort for one string, but @crowbot probably has a better idea of the specific issue the partner is concerned about.
It looks like their extra rule is for > 4 which is going to apply most of the time on that page
ToDo:
n_
translation
The text
doesn't use
n_()
and so can't handle variants in plural forms - reuser says "We need one, few and many version for the number of requests and number of authorities."