Jump to content

Custom pluralization in language strings?


MMXII

Recommended Posts

Short question: Can I add custom pluralization in language strings? If so, how?

Example: (Yes, I am not talking about the following language string specifically - this is a general question)
A language string says "%s has posted %s".
Can I change it to "{# [1:A person has][?:Many people have]} posted %s"?

Can this be done with any language string that just has "%s" in it, or does it require more?

I did not find anything regarding this in the help section or I did not understand pluralization correctly. 🙂

Link to comment
Share on other sites

35 minutes ago, MMXII said:

Can this be done with any language string that just has "%s"

no

35 minutes ago, MMXII said:

or does it require more?

yes

Pluralisation has to be called inside the template or php code and next to the language string you also need to pass the "number" which will be used to determine what to return.

See also

and

 

Link to comment
Share on other sites

28 minutes ago, Daniel F said:

Pluralisation has to be called inside the template or php code and next to the language string you also need to pass the "number" which will be used to determine what to return.

I see.

So I have found quite a few language strings that need pluralization, but as of now they do only offer "%s", which unfortunately is not enough to work with. Should I report each and every one of them as a bug? Or what is the best way to continue from here on?

Also, while having the next major release (version 5) in mind, please allow me to ask the following questions: Will translations and how they are handled get more attention? Will you consider improvements to the current way language strings are being used? Right now there are some serious issues to create good (precise) translations when it comes to languages other than English. (It is not really needed to answer these questions as I think you do not want to talk about v5 at this time. I would be happy though if translations were receiving more attention in the near future.)

Link to comment
Share on other sites

21 hours ago, MMXII said:

Should I report each and every one of them as a bug? Or what is the best way to continue from here on?

I am also interested of how to give feedback on it. Actually I have "unpluralized" string x_records_in_this_category in Pages. Where should I report it? In support ticket or in feedback forum?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...