pontoon icon indicating copy to clipboard operation
pontoon copied to clipboard

Fluent string with [ at line start not caught as syntax error

Open flodolo opened this issue 8 months ago • 2 comments

Error: [common-voice:web/locales/common-voice/en/pages/contribute/common.ftl, mua] Update failed: Expected an entry start

The file is translated: https://pontoon.mozilla.org/mua/common-voice/web/locales/common-voice/en/pages/contribute/common.ftl/?string=312744

But not committed to the repo: https://github.com/common-voice/common-voice/tree/main/web/locales/common-voice/mua/pages/contribute

Trying to download translations also crashes Pontoon. EDIT: can't seem to crash Pontoon, just get a 404 now.

flodolo avatar Apr 16 '25 13:04 flodolo

The problematic translation is this one: https://pontoon.mozilla.org/mua/common-voice/web/locales/common-voice/en/pages/contribute/common.ftl/?string=312854

Its actual string value is

contribution-background-noise-example-1-fixed-title =
     <strong>[ɓan fuŋ fane]</strong> <strong>
     [tǝhele]</strong>

where the last line is invalid Fluent, because it starts with a [. In the front-end, it's displayed without that line, probably because the parser has found a complete message before that.

I'm not sure how this managed to sneak in past our validation filters.

eemeli avatar Apr 16 '25 14:04 eemeli

Thanks. I've rejected the current translation, so we can commit the file in the meantime https://github.com/common-voice/common-voice/commit/6d357e78e14c8baa7283d3e8194c463fdb038e8d

flodolo avatar Apr 16 '25 15:04 flodolo