Closed Bug 1491867 Opened 6 years ago Closed 3 years ago

Enclose accented pseudolocale strings in markers

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: flod, Assigned: mathjazz)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Every pseudolocale string should have an opening and closing marker (e.g. brackets). This allows to identify truncation easily: if the string is ending with an ellipsis and not a marker, that's a truncation. If the opening marker is missing, the string is not displayed for some reasons.
Attached image test.png
I took a look at the code, and it's really simple to add opening and closing markers, so I guess it mostly comes down to a product decision. https://searchfox.org/mozilla-central/rev/21588b2a9824e0758fe11d10065e2c01ea9f32be/intl/l10n/L10nRegistry.jsm#341 With a caveat: placeables will be enclosed in markers as well, but I personally don't see a problem in that. On a side note, not sure why tests use .include and not equal() (it makes totally sense for BiDi) https://searchfox.org/mozilla-central/rev/21588b2a9824e0758fe11d10065e2c01ea9f32be/intl/l10n/test/test_pseudo.js#69
Looking at the screenshot, adding markers in this way would be misleading, I think? [Connect with a ][Firefox Account] This suggests that the string is created via concatenation, whereas in reality it's properly constructed via interpolation in FTL: Connect with a { -fxaccount-brand-name } IIUC, the goal of adding the markers is to detect cases were this string would be built as: <span data-l10n-id="connect-string" /><span data-l10n-id="fxaccount-name" /> To that end, the implementation should only add them around the result of `bundle.format()`. The interpolation is encapsulated in the format() method, and would have no effect on the position of the markers.
(In reply to Staś Małolepszy :stas from comment #2) > IIUC, the goal of adding the markers is to detect cases were this string > would be built as: This is something I didn't think of, but I'm also more interested in detecting truncations, especially if we move to small screens.
Priority: -- → P3
Depends on: 1711028
Blocks: 1711028
No longer depends on: 1711028
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Assignee: nobody → m
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: