Bug 53224 - Web Inspector: WebSocket-related console messages are not localized
Summary: Web Inspector: WebSocket-related console messages are not localized
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-01-26 23:11 PST by Joseph Pecoraro
Modified: 2016-12-26 14:55 PST (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2011-01-26 23:11:44 PST
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
Comment 1 Yuta Kitamura 2011-01-31 04:47:20 PST
I'm not familiar with localization in WebKit. How do we localize texts like these? Any pointers?
Comment 2 Kent Tamura 2011-01-31 05:08:25 PST
(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
...
Comment 3 Alexey Proskuryakov 2016-09-08 14:00:53 PDT
<rdar://problem/28213695>
Comment 4 BJ Burg 2016-09-09 10:07:45 PDT
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.