Closed
Bug 1447103
Opened 7 years ago
Closed 7 years ago
[FTL] Placeable names should not be used to generate access keys candidates
Categories
(Webtools Graveyard :: Pontoon, defect, P3)
Webtools Graveyard
Pontoon
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: flod, Assigned: mathjazz)
Details
Attachments
(3 files)
For example in Fluent:
When {-brand-short-name} starts
"{-brand-short-name}" should be excluded when generating the list of potential access keys.
Attaching a screenshot, because I'm not sure how long the link will be active
https://mozilla-pontoon-staging.herokuapp.com/sl/test-fluent/preferences.ftl/?search=accessk&string=176235
Reporter | ||
Updated•7 years ago
|
Summary: Variable and placeholder names should not be used to generate access keys candidates → [FTL] Placeable names should not be used to generate access keys candidates
Assignee | ||
Comment 1•7 years ago
|
||
Is it safe to simply strip "{placeable}" out of textarea elements to generate candidates from?
Priority: -- → P3
Reporter | ||
Comment 2•7 years ago
|
||
(In reply to Matjaz Horvat [:mathjazz] from comment #1)
> Is it safe to simply strip "{placeable}" out of textarea elements to
> generate candidates from?
It sounds rough, but given the target I don't think it's too dangerous to strip via regex (unless there's a better way via AST)
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Commit pushed to master at https://github.com/mozilla/pontoon
https://github.com/mozilla/pontoon/commit/46315b38d8d2f364dcf81edf33d458359b2b126c
Fix bug 1447103: Exclude placeables from access key candidates (#907)
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → m
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Commit pushed to master at https://github.com/mozilla/pontoon
https://github.com/mozilla/pontoon/commit/62e3fb682d080b53cbc2400007db120e95941a4f
Fix bug 1447103 more reliably (#908)
Exclude Placeables from generating access key candidates by building a
fake FTL Message from textarea contents, parsing it and only taking
TextElements into account.
Previous implementation used regex to try to do the same, which would
fail when curly brackets are escaped, e.g.:
```
key = Hello \{ and then { -brand-short-name} World
```
If we hit a`ParseError` (also happens on untranslated strings), the entire
element content is used to generate access key candidates.
Updated•3 years ago
|
Product: Webtools → Webtools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•