Summary: | WebKit2 needs to be made localizable | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Sam Weinig <sam> | ||||
Component: | New Bugs | Assignee: | Sam Weinig <sam> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | aroben, darin, timothy | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Other | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Sam Weinig
2011-03-01 10:48:58 PST
Created attachment 84256 [details]
Patch
Comment on attachment 84256 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=84256&action=review > Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm:70 > + RetainPtr<CFStringRef> cfLocalization(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(localization.characters()), localization.length())); Can't you just use String::createCFString here? Comment on attachment 84256 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=84256&action=review > Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:767 > + return formatLocalizedString(UI_STRING("<filename> %dÃ%d pixels", "window title suffix for a standalone image (uses multiplication symbol, not x)"), size.width(), size.height()).replace("<filename>", filename); > } Why "<filename>" and not %s or %@? (In reply to comment #2) > (From update of attachment 84256 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=84256&action=review > > > Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm:70 > > + RetainPtr<CFStringRef> cfLocalization(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(localization.characters()), localization.length())); > > Can't you just use String::createCFString here? No. That function only works on the main thread, and at this point, we have not even established a main thread. (In reply to comment #3) > (From update of attachment 84256 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=84256&action=review > > > Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:767 > > + return formatLocalizedString(UI_STRING("<filename> %dÃ%d pixels", "window title suffix for a standalone image (uses multiplication symbol, not x)"), size.width(), size.height()).replace("<filename>", filename); > > } > > Why "<filename>" and not %s or %@? Since this is in cross platform code we cannot use %@ and since the formatter won't necessarily interpret the incoming string as utf8 we can't use %s. (In reply to comment #5) > the formatter won't necessarily interpret the incoming string as utf8 To be clear: The CFString formatter will *never* interpret the string as UTF-8. There is a downside to "<filename> %dx%d". Localizers can't flip the order like they could with "%@ %dx%d". They use to be able to do "%2$dx%3$d %1$@". Though I'm not sure it is the end of the world or if any localizations need it. (In reply to comment #7) > There is a downside to "<filename> %dx%d". Localizers can't flip the order like they could with "%@ %dx%d". They can flip the order. And it’s easier than it is with the format string: "%dx%d <filename>". (In reply to comment #9) > (In reply to comment #7) > > There is a downside to "<filename> %dx%d". Localizers can't flip the order like they could with "%@ %dx%d". > > They can flip the order. And it’s easier than it is with the format string: "%dx%d <filename>". Duh! :) Seems like you need to fix update-webkit-localizable-strings, too. |