-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some i18n (localization) issues with Web Extensions.
https://webkit.org/b/264211 rdar://problem/117948039 Reviewed by Brian Weinstein. * Remove a FIXME for <https://webkit.org/b/261047> Handle multiple unique identifiers for localization. This wasn't needed after all since the @@extension_id message can't be used in the manifest. * Supply the @@extension_id key with the extension's base URL host in the WebProcess. * Suppress errors for file not found when attempting to discover localization message files. * Don't attempt to read the same file twice if the default_locale matches the language or regional name. * Don't support locale predefined messages when there is no default_locale. * Bail early in more places if there are no localized strings. * Removed some unused NSCoding key strings. * Added more tests to cover these changes. * Source/WebKit/Shared/Extensions/_WKWebExtensionLocalization.h: * Source/WebKit/Shared/Extensions/_WKWebExtensionLocalization.mm: (-[_WKWebExtensionLocalization initWithWebExtension:]): (-[_WKWebExtensionLocalization initWithLocalizedDictionary:uniqueIdentifier:]): Added. (-[_WKWebExtensionLocalization initWithRegionalLocalization:languageLocalization:defaultLocalization:withBestLocale:uniqueIdentifier:]): (-[_WKWebExtensionLocalization localizedDictionaryForDictionary:]): (-[_WKWebExtensionLocalization localizedStringForKey:withPlaceholders:]): (-[_WKWebExtensionLocalization _localizedArrayForArray:]): (-[_WKWebExtensionLocalization _localizationDictionaryForWebExtension:withLocale:]): (-[_WKWebExtensionLocalization _predefinedMessages]): (-[_WKWebExtensionLocalization _predefinedMessagesForLocale:]): Deleted. * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm: (WebKit::WebExtension::resourceStringForPath): (WebKit::WebExtension::resourceDataForPath): * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionURLSchemeHandlerCocoa.mm: (WebKit::WebExtensionURLSchemeHandler::platformStartTask): * Source/WebKit/UIProcess/Extensions/WebExtension.h: * Source/WebKit/WebProcess/Extensions/Cocoa/WebExtensionContextProxyCocoa.mm: (WebKit::WebExtensionContextProxy::getOrCreate): (WebKit::WebExtensionContextProxy::parseLocalization): * Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.h: * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPILocalization.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/270279@main
- Loading branch information
Showing
8 changed files
with
267 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.