[Webkit-unassigned] [Bug 266933] New: browser.i18n.getMessage() 'recursively' applies substitutions, can get stuck in infinite loop
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Dec 29 10:55:21 PST 2023
https://bugs.webkit.org/show_bug.cgi?id=266933
Bug ID: 266933
Summary: browser.i18n.getMessage() 'recursively' applies
substitutions, can get stuck in infinite loop
Product: WebKit
Version: Safari 17
Hardware: Mac (Intel)
OS: macOS 14
Status: NEW
Severity: Normal
Priority: P2
Component: WebKit Extensions
Assignee: webkit-unassigned at lists.webkit.org
Reporter: 94fpgyqtc at mozmail.com
CC: timothy at apple.com, webkit-bug-importer at group.apple.com
Created attachment 469240
--> https://bugs.webkit.org/attachment.cgi?id=469240&action=review
Test extension xcode project
Using this _locales/en/messages.json:
{
"hello": {
"message": "Hello $1"
}
}
I get this output in Safari's console when inspecting background page or service worker:
browser.i18n.getMessage("hello", "world") // "Hello world"
browser.i18n.getMessage("hello", "world $2") // "Hello world "
browser.i18n.getMessage("hello", ["world $2", "!"]) // "Hello world !"
browser.i18n.getMessage("hello", "$1") // ** never returns **
Firefox gives expected results:
browser.i18n.getMessage("hello", "world") // "Hello world"
browser.i18n.getMessage("hello", "world $2") // "Hello world $2"
browser.i18n.getMessage("hello", ["world $2", "!"]) // "Hello world $2"
browser.i18n.getMessage("hello", "$1") // "Hello $1"
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20231229/0121c306/attachment.htm>
More information about the webkit-unassigned
mailing list