Closed Bug 1430941 Opened 5 years ago Closed 5 years ago

[FTL] UI is broken when translating a string with label and attribute

Categories

(Webtools Graveyard :: Pontoon, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ravmn, Assigned: mathjazz)

Details

Attachments

(2 files)

When trying to translate the following string
https://pontoon.mozilla.org/es-CL/firefox-screenshots/all-resources/?string=175028 the UI from the WYSIWYG area doesn't work as expected.

I couldn't replicate the issue with other strings. I tried refreshing the cache and it didn't improve.
Hi Richard!

It looks like this https://github.com/mozilla-services/screenshots/blob/master/locales/en-US/server.ftl#L227 causes this problem.

I feel that every entity looking like this will cause this problem:

```
liked-comment = aaaa
   .title= bbbb
```
:mathjazz

Unfortunately, currently I don't have an environment to reproduce this issue.
However, I've read the code and I have a premonition that We don't hide the textarea when it should be hidden. This patch should change that:
https://gist.github.com/jotes/d4f70d2338c884d0e1083b2a37574f51

The second possible issue is The FTL "show source" mode:
https://imgur.com/a/d7hM7
(I'm thinking that structure of the entity (attributes, main-value etc.) should be reflected in The "show source" mode)
I don't know if there's a bug or if it's an issue in the current design - could you verify?
It also breaks the source view.

1) Switch to FTL Advanced View, enter

shotIndexNoExpirationSymbol = ∞
    .title = This shot does not expire

2) Switch back. There's a label, but not attribute title.

3) Switch to advanced view again, and you're back to the broken translation.
Sorry, one more thing: tried to save the string directly from the source view, I end up with a label, but
1) It doesn't show up if I download the source.
2) It keeps asking me "Leave anyway", because apparently it thinks I have pending changes to save.

I tried changing the FTL offline and uploading

shotIndexNoExpirationSymbol = ∞
    .title = Questa immagine non ha scadenza

and made things worse (2 strings appear, and they're quite random).
https://pontoon.mozilla.org/it/firefox-screenshots/server.ftl/?search=shotIndexNoExpirationSymbol&string=175028

Indefinitely ∞
∞
Summary: Cannot translate a FTL string → [FTL
Summary: [FTL → [FTL] UI is broken when translating a string with label and attribute
That's a regression from:
https://github.com/mozilla/pontoon/commit/1159b6f2de9057960e9083dcbe600f45a98cf4c3

We somehow managed to lose the ability to support such strings.
Assignee: nobody → m
Priority: -- → P1
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/e65d7d59f301f499de144cc638bf2255c4236a23
Fix bug 1430941: Support strings with value and attributes (#800)
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.