Error message I don't find : "Error: No 'other' form found in pluralFormatPattern 0"

AI-generated summary

Users reported an error message: ‘Error: No ‘other’ form found in pluralFormatPattern 0’, appearing only in Spanish locale and tied to custom themes. Hilario initially couldn’t locate the error, but simon traced it to the MessageFormat.prototype.precompile method. Switching to English resolved the issue, pointing to theme-related translation problems. leog identified that plural form keys like ‘one’ and ‘other’ had been incorrectly translated into Spanish (e.g., ‘uno’, ‘otros’), breaking the pluralization engine. He submitted a PR to fix the issue, which gerhard redirected to Transifex for proper translation updates. After gerhard marked strings as unreviewed, leog corrected additional strings like reached_hour_MF and others. Hilario asked what to do as an admin; gerhard confirmed translations were updated and advised rebuilding the container or upgrading via Docker Manager to apply fixes. Hilario acknowledged the solution and thanked the team.

I tried to locate this error message but don’t find any reference.
image

Can someone help me to get information.
The error appear at the top of the screen
This is a brand new installation (just some days I am configuring it)
And I don’t habe the feeling to have seen it before today, before I upgrade to the last update.
Thanks

The error you are seeing is from the MessageFormat.prototype.precompile method: https://github.com/discourse/discourse/blob/master/lib/javascripts/messageformat.js#L1519. I am not sure what is causing the error though.

What locale are you using on your site?

Spanish language.
This is message appearing in my administrator. It doesn’t appear on basic users.
Correct. I changed to English and the message dissapear.
But I have another system also in spanish but no problem there.
Aparently the only difference is different themes. The one which is OK is standard theme.
The one with problem is another theme. I am going to try to change the standard one to check.

Found that the error hit is the following:

I18n._compiledMFs = {
“too_few_topics_and_posts_notice_MF”: function() {
return “Invalid Format: Error: No ‘other’ form found in pluralFormatPattern 0”;
},

Which in my case makes sense, it’s a newly installed instance.

Well in my case, I have changed to basic Themes and the message disappear.
Then I return to the “Material Design Theme” and message till absent..
I don’t know much about you comment then I don’t know if this make sense with @leog findings.

Got it. The parameters used for pluralization were also translated to Spanish: “one” to “uno/una” and “other” to “otros/otras”. Changing them back to English solves the issue. I tested this with my instance by changing the value for too_few_topics_and_posts_notice_MF to the following Spanish translation:

<a href="https://blog.discourse.org/2014/08/building-a-discourse-community/">¡Comencemos la discusión!</a> Hay {currentTopics, plural, one {<strong>#</strong> tema} other {<strong>#</strong> temas}} y {currentPosts, plural, one {<strong>#</strong> publicación} other {<strong>#</strong> publicaciones}}. Los visitantes necesitan más contenido para leer y responder – recomendamos al menos {requiredTopics, plural, one {<strong>#</strong> tema} other {<strong>#</strong> temas}} y {requiredPosts, plural, one {<strong>#</strong> publicación} other {<strong>#</strong> publicaciones}}. Solo los miembros del staff pueden ver este mensaje.

I created a PR to fix this; other texts were compromised as well, not just too_few_topics_and_posts_notice_MF.

Thanks for the PR, but we accept translation updates only through Transifex.

@gerhard not sure how to change these already (wrongly) translated strings in Transifex. Any tutorial available?

I marked those strings as unreviewed. Can you try again?

Done. I think you missed other strings that needed the same changes: reached_hour_MF, reached_minute_MF, exceeded_hour_MF, exceeded_minute_MF.

All done. Thanks @gerhard and the other folks for pitching in to diagnose the issue.

OK everybody. Thanks for all this actions.
But what do I have to from my administrator side.
Just wait for next release?

I updated the translations. Rebuilding your container or upgrading via docker manager should fix the translations.

Great @gerhard. I understand that Rebuilding take the last modules for everything. Thanks again