How to translate numeric plurals

Ľudovít Lučenič August 3, 2016

Hello, how do I translate this label: admin.issuesettings.statuses.workflows.count in JIRA Core, when there is used numeric choice for plural in this case? Basically, I do not understand the format used:

  • {0,choice,0#No associated workflows|1#1 associated workflow|1<{0,number} associated workflows}. 

Could you give me some hints, please, on how to formulate a version for Slovak, where we have these plural forms: 0, 5+ / 1 / 2-4 ?

Please, and also verify that there is not a bug in the translation string provided. Using it without modification as a translation corrupts the rendering, only "1 associated workflow" is printed then regardless of the count.

Note: the string can be found in Administration / Issues / Issue attributes / Statuses form in a particular column in the list of statuses.

Thank you very much in advance.

3 answers

1 accepted

0 votes
Answer accepted
Ľudovít Lučenič August 5, 2016

The actual solution was this

{0,choice,0#Nepoužitý v žiadnom|1#1 priradený postup|2#{0,number} priradené postupy|5#{0,number} priradených postupov}

It is based on the documentation to the ChoiceFormat.

1 vote
Peter Geshev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2016

Can you try 

{0,choice,0#No associated workflows|1#1 associated workflow|1&lt;{0,number} associated workflows 2-4|5 associated workflows|5&lt;{0,number} workflows 5+}
Ľudovít Lučenič August 5, 2016

Thank you, however, there are some problems with your answer:

  1. the section for 5 does not have any 5# prefix, so I assume it won't work
  2. I was also looking for the explanation of the format
  3. the question stated we have 3 plural forms, not 4 (5+ was meant 5,6,7,...)
  4. I tried and it did not work sad
Peter Geshev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 5, 2016

Hi, Ľudovít, you are right, the section for 5 is missing #5, and the whole section is unnecessary. Maybe you could try the following

{0,choice,0#No associated workflows|1#1 associated workflow|1&lt;{0,number} associated workflows 2-4|4&lt;{0,number} workflows 5+}

The syntax used is the one for MessageFormat and in particular the ChoiceFormat clauses.

 

Ľudovít Lučenič August 5, 2016

Hi Peter, thank you for the clarification. Unfortunately your suggested format did not work either. The ChoiceFormat link is also a bit misleading as it goes to some irrelevant anchor in the page. However, you have helped me to find the solution, so +1 for you smile

Kindest regards,
Ľudovít

0 votes
Ľudovít Lučenič August 5, 2016

The only working solution for me so far is the following boilerplate...

{0,choice,0#Nepoužité v žiadnom|1#1 priradený|2#2 priradené|3#3 priradené|4#4 priradené|5&lt;{0,number} priradených}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events