Bug 53224
Summary: | Web Inspector: WebSocket-related console messages are not localized | ||
---|---|---|---|
Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> |
Component: | Web Inspector | Assignee: | Blaze Burg <bburg> |
Status: | NEW | ||
Severity: | Normal | CC: | ap, bburg, dbates, graouts, inspector-bugzilla-changes, tkent, ukai, webkit-bug-importer, wilander, yutak |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Joseph Pecoraro
There are numerous strings that can be added to the console that aren't localized.
There may be others than the ones mentioned here.
In WebSocketHandshake::readStatusLine:
http://trac.webkit.org/browser/trunk/Source/WebCore/websockets/WebSocketHandshake.cpp#L430
"Status line contains embedded null"
"Status line is too long"
"No response code found: ..."
"Status line does not end with CRLF"
"Invalid status code: ..."
In WebSocketHandshake::readHTTPHeaders:
http://trac.webkit.org/browser/trunk/Source/WebCore/websockets/WebSocketHandshake.cpp#L497
"CR doesn't follow LF at ..."
"Unexpected CR in name at ..."
"Unexpected LF in name at ..."
"Unexpected LF in value at ..."
"CR doesn't follow LF after value at ..."
"invalid UTF-8 sequence in header name"
"invalid UTF-8 sequence in header value"
And WebSocketHandshake::checkResponseHeaders:
http://trac.webkit.org/browser/trunk/Source/WebCore/websockets/WebSocketHandshake.cpp#L582
"Error during WebSocket handshake: 'sec-websocket-origin' header is missing"
"Error during WebSocket handshake: 'sec-websocket-location' header is missing"
"Error during WebSocket handshake: origin mismatch: " + clientOrigin() + " != " + m_wsOrigin
"Error during WebSocket handshake: location mismatch: " + clientLocation() + " != " + m_wsLocation
"Error during WebSocket handshake: protocol mismatch: " + m_clientProtocol + " != " + m_wsProtocol
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Yuta Kitamura
I'm not familiar with localization in WebKit. How do we localize texts like these? Any pointers?
Kent Tamura
(In reply to comment #1)
> I'm not familiar with localization in WebKit. How do we localize texts like these? Any pointers?
Please look at WebCore/platform/LocalizedStrings.h. Each of platforms has implementations of these functions.
Mac: WebKit/mac/Misc/WebLocalizedStrings.mm
WebKit2 platforms: WebCore/platform/LocalizedStrings.cpp
Chromium: WebKit/chromium/src/LocalizedStrings.cpp
...
Alexey Proskuryakov
<rdar://problem/28213695>
Blaze Burg
It's debatable whether we want to localize error messages, as this makes it harder for users to search the web and figure out their problem. In Web Inspector, we purposefully don't localize CSS properties or values. So, if we localize such strings, we need to be very careful to avoid translating things that have a very specific meaning, such as sec-websocket-origin, CSP policy strings, etc.