WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
55483
WebKit2 needs to be made localizable
https://bugs.webkit.org/show_bug.cgi?id=55483
Summary
WebKit2 needs to be made localizable
Sam Weinig
Reported
2011-03-01 10:48:58 PST
WebKit2 needs to be made localizable
Attachments
Patch
(81.13 KB, patch)
2011-03-01 11:17 PST
,
Sam Weinig
timothy
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2011-03-01 11:17:36 PST
Created
attachment 84256
[details]
Patch
Anders Carlsson
Comment 2
2011-03-01 11:22:39 PST
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?
Timothy Hatcher
Comment 3
2011-03-01 11:26:04 PST
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 %@?
Sam Weinig
Comment 4
2011-03-01 11:27:10 PST
(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.
Sam Weinig
Comment 5
2011-03-01 11:29:09 PST
(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.
Darin Adler
Comment 6
2011-03-01 11:38:29 PST
(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.
Timothy Hatcher
Comment 7
2011-03-01 11:39:54 PST
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.
Sam Weinig
Comment 8
2011-03-01 11:41:46 PST
Landed in
r80014
.
Darin Adler
Comment 9
2011-03-01 11:42:54 PST
(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>".
Timothy Hatcher
Comment 10
2011-03-01 11:49:22 PST
(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! :)
Adam Roben (:aroben)
Comment 11
2011-03-01 11:59:34 PST
Seems like you need to fix update-webkit-localizable-strings, too.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug