Inconsistency in plural definition

AI-generated summary

A discussion on the inconsistency in plural definition in various languages led to the discovery of a problem affecting multiple languages, not just Hungarian. Moin started investigating after finding an issue in Hebrew and found more cases in other languages.

To address the issue, david made a change to limit the impact of failed compilations to _MF strings. Later, flink91 merged a patch that relaxes the MessageFormat compiler, allowing invalid plural keys in messages. Two more patches were merged: one to prevent creating invalid MF overrides in the admin UI and another to update pluralization rules in Ruby to match those in JavaScript.

Continuing the discussion from Issue with pluralized (count) translation override:

I think Hungarian is not the only language affected by this. After checking Hebrew because of this Contribute > Bug mentioning problems, I thought maybe even more languages are affected, so I started looking for more cases.

After finding another one, I expect that even more languages are affected.

2 Likes

Thanks @Moin!

I’ve made this change to stop the bleeding. This will limit the impact of failed compilations so that they only affect _MF strings, rather than taking down the whole site.

We’ll keep digging into the root cause, and update here when we have a solution.

11 Likes

We’ve just merged a patch that relaxes the MessageFormat compiler, allowing invalid plural keys in the messages:
https://github.com/discourse/discourse/pull/28062

This should take care of most of the problems. Other patches should follow soon.

5 Likes

Another patch has just been merged:
https://github.com/discourse/discourse/pull/28083

This will prevent creating invalid MF overrides in the admin UI.

5 Likes

Just merged this PR:
https://github.com/discourse/discourse/pull/28097

Pluralization rules in Ruby should now be up-to-date with the ones we have in JS :slightly_smiling_face:

4 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.