Bug 312967

Summary: Two adjacent placeholders for the i18n replacement are wrongly replaced.
Product: WebKit Reporter: Kanaru Sato <i.am.kanaru.sato>
Component: WebKit ExtensionsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 26   
Hardware: Mac (Apple Silicon)   
OS: macOS 26   

Kanaru Sato
Reported 2026-04-21 23:24:31 PDT
Named placeholder substitution in WebExtensions localization (`i18n.getMessage`) fails when two placeholders are adjacent. Step to reproduce: - set a message in messages.json as follows: ``` "adjacent_named": { "message": "$prefix$$suffix$", "placeholders": { "prefix": { "content": "$1" }, "suffix": { "content": "$2" } } } ``` - Then call like this from JavaScript. ``` const args = ["3", "4"]; console.log(browser.i18n.getMessage("adjacent_named", args)); ``` Expected Result: - it shows `34`. Actual result: - it shows `3$SUFFIX$`.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-04-21 23:24:37 PDT
Kanaru Sato
Comment 2 2026-04-21 23:25:15 PDT
EWS
Comment 3 2026-04-22 07:03:02 PDT
Committed 311769@main (9d2313b02b23): <https://commits.webkit.org/311769@main> Reviewed commits have been landed. Closing PR #63298 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.