mathjazz / pontoon

In-place localization tool
https://pontoon.mozilla.org/
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Pilcrow in message #956

Closed mathjazz closed 3 years ago

mathjazz commented 3 years ago

This issue was created automatically with bugzilla2github.

Bug 1711736

Bug Reporter: @clouserw CC: @Pike, @flodolo, @mathjazz, @peiying2

This was reported at https://github.com/mozilla/fxa/issues/8483 but it seems like a bug in Pontoon that this is getting passed through so I'm filing here. We've run into it a couple of times.

On the Firefox Accounts Profile page, the Secondary Email note contains a pilcrow where it should just be a space:

Note: a secondary email won’t restore your information — you’ll¶need a recovery key for that.

This message comes from the FTL for se-content-note, which looks like a correctly formatted line continuation according to the Fluent spec, so it's quite likely this is a bug in whatever Fluent implementation this page is using. Steps to reproduce

URL: https://accounts.firefox.com/settings#secondary-email

Add a secondary email to your account. Then open your account profile and look at the grey note in the Secondary email section. Expected result

The message should end with "you'll need a recovery key for that." Actual result

The message ends with "you’ll¶need a recovery key for that." Environment

Using Firefox 88, production Firefox Accounts.

mathjazz commented 3 years ago

Comment Author: @Pike

I tried to reproduce this, and this seems to be an issue with en-CA. Or one contributor there. https://pontoon.mozilla.org/en-CA/firefox-accounts/settings.ftl/?author=d.nisbetjones%40protonmail.com&string=220482 for Pei.

The only way I could reproduce this was to copy-n-paste the original string with the newline markup into the text area. When clicking the copy button, that doesn't happen.

mathjazz commented 3 years ago

Comment Author: @mathjazz

Yeah, this looks like something we could prevent in Pontoon. There are also other places (outside Pontoon) users could copy translations from, which are harder to prevent, hence the P4.

Peiying, it'd be great if you could warn the user Axel found out and tell them they should use the Copy button instead of copying and pasting the source string into translation area manually to avoid copying the newline markup.

mathjazz commented 3 years ago

Comment Author: @peiying2

I am adding this note to the monthly report to the community so I gave the solution a try.

I used the Copy button, though visually it removes the pilcrow in the localized field, once you save it, the pilcrow remains in the Saved version. Pilcrow is a hard/manual line-break. Additionally, this break location varies from language to language. I think it is best/safe to suggest to remove pilcrow manually.

mathjazz commented 3 years ago

Comment Author: @mathjazz

(In reply to Peiying Mo [:CocoMo] from comment #3)

I used the Copy button, though visually it removes the pilcrow in the localized field, once you save it, the pilcrow remains in the Saved version.

Peiying, are you saying the pilcrow ends up in the translation in VCS? I'd be surprised if that's the case.

We do render pilcrow in original strings and translations, but that's just a visual indication of a new line.

mathjazz commented 3 years ago

Comment Author: @peiying2

(In reply to Matjaz Horvat [:mathjazz] from comment #4)

(In reply to Peiying Mo [:CocoMo] from comment #3)

I used the Copy button, though visually it removes the pilcrow in the localized field, once you save it, the pilcrow remains in the Saved version.

Peiying, are you saying the pilcrow ends up in the translation in VCS? I'd be surprised if that's the case.

I tried to use the method Axel recommended to change en-CA. It looked good in the box, but once I saved the string, pilcrow is still there. You can give en-GB a try.

mathjazz commented 3 years ago

Comment Author: @flodolo

I've fixed multiple errors in Firefox, and it works without issues. Last example https://hg.mozilla.org/l10n-central/id/rev/0454a293b9be862d8cf59f46b6bc6ab94b9440ee

mathjazz commented 3 years ago

Comment Author: @mathjazz

Note to self: check how many translations include the ¶ character and prioritize the bug accordingly.

We should also "mass remove ¶" from translations.

mathjazz commented 3 years ago

Comment Author: @mathjazz

620 translations across 82 locales from 146 authors are affected.

Seems like this bug is affecting a lot of people, let's bump the priority.

I'll also remove ¶ from all existing translations using something like:

for t in Translation.objects.filter(string__contains="¶"):
    t.string = t.string.replace("¶", "")
    t.save(update_stats=False)