framework icon indicating copy to clipboard operation
framework copied to clipboard

Issue of encoding apostrophes when using a plural rule in translation

Open qiaeru opened this issue 3 years ago • 3 comments

Current Behavior

I have an issue that I can't solve. I'm the author of the French translation of Flarum and its extensions.

This issue concerns the display of the apostrophe which is badly encoded. Instead of displaying ', it displays '. The issue seems to appear only when there is a singular or plural rule.

You can see on line 69 of the translation file: tags_text: '{count, plural, one {l''étiquette {tags}} other {les étiquettes {tags}}}'

This should work, but it displays l'étiquette, not l'étiquette.

Again, the display of apostrophes works everywhere else in the translation, it's really related to the plural rule. I also checked, the file is encoded in UTF8 without BOM so that's okay. Do you have any idea how to solve this issue? Thank you.

This issue have been reported by a user of the translation: https://discuss.flarum.org/d/615-french-language-pack/314

Steps to Reproduce

Install the French language pack and see the issue.

You can see the issue on: https://lepointdarret.com/public/d/32-avatar-autre-que-gravatar

Expected Behavior

Display ' instead of '.

Screenshots

No response

Environment

  • Flarum version: 1.6.3

Output of php flarum info

Output of "php flarum info", run this in terminal in your Flarum directory.

Possible Solution

No response

Additional Context

No response

qiaeru avatar Feb 15 '23 10:02 qiaeru

I think this is a duplicate of #3685

clarkwinkelmann avatar Feb 15 '23 19:02 clarkwinkelmann

I think this is a duplicate of #3685

Yep you're right it's the same issue. Do I close this one?

qiaeru avatar Feb 15 '23 20:02 qiaeru

These are different issues. This bug is caused by using trans() result as parameter for another trans() call - I have failing test for this in #3735 without using plural rules.

rob006 avatar Feb 15 '23 21:02 rob006