Issue of plural form in CJK language

For example:

{0, plural, one{# new message} other{# new messages}}

now the jp trans is

{0, plural, one{# 件の新着メッセージ} other{# 件の新着メッセージ}}

the ko is

{0, plural, one{#개의 새 메세지} other{#개의 새 메세지}}

It looks like they all translated for many years and the system then did not check the correction of it.now they all in " Python brace placeholders" error status.

there are much more items like this.As I am now working on the zh_tw translation job,I am sure that all the CJK translation have these problem.

I need an instruction about these.

1 Like

As I speak neither Japanese nore Korean, I don’t know what corrections were made and if they appear in Haiku or not.

I also stumble over these “Python brace placeholders” critical errors whenever there’s a plural substitution. I think you just do the translation, press “Submit”, and when the “critical error” flashes, click on the error symbol to “mute” the error. The translation was already successfully submitted when you clicked the “Submit” button.

@niels, could we disable this “Python brace placeholders” error at Pootle?

简体中文有,翻译后发现显示正常,我把它“消除质量检查“了。

It depends on which plural forms are used in your language how these parts should be translated. See Formatting Messages | ICU Documentation for a description of these messages.

English has 2 forms (singular and plural), so there are 2 variants (one and other). Other languages may have different plural forms (or only a single form), so they may need different placeholders here.

More on pluralization, including an instructive example at i18n/GUI-Localization – Haiku

Oh, and apparently I already explained the “muting” on that same page further down… :slight_smile:

1 Like

I don’t like to “mute” the bug,that is the bug that exite,mute won’t solve the problem.

As I am not the programmer,I will try to translate it as its original form,or should I say,copy the original one to the translation form.Something that not translate as “5 mails,1 new” won’t effect the daily use.

The second reason that I need to do that is,I don’t like there is something that still holding on,and you could finish it ASAP.That make me unpleasure.

If there is no solve way in one week,I will do that.And if there is a way in the future,any one could make a issus,then any others including me could translated it as usual.

I checked the link,what I am thinking in my head is,that should not left to me the translator to solve.Maybe we should make an issus to github or something?

I’ll open a ticket at Trac, asking to remove that “Python bracket” check.

It’s a false positive. Pootle thinks it sees Python code with an erroneous usage of curly brackets, when in fact it is a snippet of C code.

I’m not quite sure I understand you correctly.
The translators only need to concern themselves with the texts between the curly brackets. The example of the above linked wiki page:

{0, plural,
	zero{There are no new messages}
	one{There is a single new message}
	few{There are only # new messages}
	other{There are # new messages}
}

Depending on the number of plurals in their language, they can also add or remove cases. If in your language exists a special form for 2 items, you add a line starting with two{.......}.
The keyword before the curlies represent different plural forms that may or may not exist in a language. That’s something the programmer cannot know and is up to the translators to decide.
In English, for example there’s normally just “one” (=1) and “other” (>1). But you can still have fun by using different translations for different amounts, as seen above.

After readinghttps://www.unicode.org/cldr/charts/46/supplemental/language_plural_rules.html#rules,I tried

{0, plural, other{# 新信息} other{# 新信息}} for %name\n

{0, plural, other{# 新信息}} for %name\n

{0, plural, zero{無新信息} one{# 新信息} few{# 新信息} other{# 新信息}} for %name\n

all failed

Then I tried to forget the rule

{0, plural, one{# new message} other{# new messages}} 信息 for %name\n

It success.

As the unicode file said,Chinese just have one single form,so how can I write?For example

https://i18n.haiku-os.org/pootle/zh-Hant/haiku/translate/servers/mail/zh-Hant.catkeys#search=%7B0%2C%20plural%2C%20one%7B%23%20new%20message%7D%20other%7B%23%20new%20messages%7D%7D&sfields=source,target&unit=569448

I read many documents and think it should be

{0, plural, other{# 新信息}}

But it doesn’t work.say

Python brace placeholders
Watch out for:* [括号]

Should we change the topic to “Issue of plural form in CJK language”?It need the administration.

Just the single “other” form should work just fine. You can ignore the “Python brace placeholders” warning. That is a false positive, see #19328 (Pootle: wrong 'critical errors') – Haiku

Maybe you can even simplify it further and remove the plural formatting altogether and just write “{0} 新信息”.

Just mute the python error, this isn’t python code and the warning is wrong.