Closed Bug 1453341 Opened 7 years ago Closed 3 years ago

[FTL] Make machinery usable for complex strings

Categories

(Webtools Graveyard :: Pontoon, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED MOVED

People

(Reporter: mathjazz, Unassigned)

References

Details

We need to figure out how to use machinery with complex strings. Complex strings have more than one value, e.g.: - multiple attributes - value + attribute(s) - plural and other variants etc. Machinery on the other hand only takes one value when making a request to its services. Possible solutions: 1. Make requests to Machinery for each input field separately (on focus). 2. Investigate the possibility of only showing one input field at the same time in rich editor (similar as we do with Gettext plurals).
As part of this bug, we should also figure out how to store TM entries in a data model. Right now we store entire FTL messages, which include keys. As a consequence, even for simple FTL strings, we never find any 100% matches, because the key is different. E.g., if the source string is "key1 = Value" and we have "key2 = Value" stored in TM, we'll display translation of the "Value" in Machinery as a 92% match (11 out of 12 characters are the same).

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

Right now we store entire FTL messages, which include keys.

Another consequence of this is are string identifiers in downloadable TMX files, as pointed out by Jordi in bug 1519665:

<tu tuid="common-voice:messagesftl:action-tap" srclang="en-US">
  <tuv xml:lang="en-US">
    <seg>action-tap = Tap
    </seg>
  </tuv>
  <tuv xml:lang="ca">
     <seg>action-tap = Toqueu
     </seg>
  </tuv>
</tu>

Here's our action plan to improve TM support for Fluent strings:

Step 1:
Store Fluent strings in TM as they appear in the string list (as_simple_translation()). This will prevent Fluent syntax (including keys) from appearing in TMX files and fix TM mismatching of simple strings caused by different keys. Bug 1576120.

Step 2:
Create separate TM entries for value and each attribute of Fluent strings and make requests to Machinery for each input field separately (on focus). This will further improve TM matching.

Step 3:
Create separate TM entries for each selector variant of Fluent strings.

Depends on: 1576120
*This bug has been moved to GitHub.* *Please check it out on https://github.com/mozilla/pontoon/issues.*
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → MOVED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.