Reviewed by Mark Rowe.
Bug 13470: i18n: The Web Inspector is not localizable
http://bugs.webkit.org/show_bug.cgi?id=13470
Add support for localization to the Web Inspector. Clients need to
implement localizedStringsURL() to return the URL of the
InspectorLocalizedStrings.js that best matches the user's language.
* English.lproj: Added.
* English.lproj/InspectorLocalizedStrings.js: Added.
* WebCore.xcodeproj/project.pbxproj: Add InspectorLocalizedStrings.js.
* page/InspectorClient.h: Add localizedStringsURL.
* page/InspectorController.cpp: Add localizedStringsURL that calls
the client. Also added a version exposed to JavaScript.
* page/InspectorController.h: Add localizedStringsURL.
* page/inspector/ConsolePanel.js: Call WebInspector.UIString
for user visible strings.
* page/inspector/DatabasePanel.js: Ditto.
* page/inspector/DocumentPanel.js: Ditto.
* page/inspector/ImagePanel.js: Ditto.
* page/inspector/MetricsSidebarPane.js: Ditto.
* page/inspector/NetworkPanel.js: Ditto.
* page/inspector/Panel.js: Ditto.
* page/inspector/PropertiesSidebarPane.js: Ditto.
* page/inspector/Resource.js: Ditto.
* page/inspector/ResourceCategory.js: Ditto.
* page/inspector/SourcePanel.js: Ditto.
* page/inspector/StylesSidebarPane.js: Ditto.
* page/inspector/inspector.css: Use pre-wrap so database errors can use \n.
* page/inspector/inspector.html: Remove some user visible strings.
* page/inspector/inspector.js: Added WebInspector.UIString and call
WebInspector.UIString for user visible strings. Some code needed to be
moved to WebInspector.loaded to use UIString after the localized strings
get loaded.
* platform/graphics/svg/SVGImageEmptyClients.h:
(WebCore::SVGEmptyFrameLoaderClient::redirectDataToPlugin): Remove WebCore:: prefix.
(WebCore::SVGEmptyInspectorClient::createPage): Ditto.
(WebCore::SVGEmptyInspectorClient::localizedStringsURL): Add empty stub.
(WebCore::SVGEmptyInspectorClient::highlight): Remove WebCore:: prefix.
(WebCore::SVGEmptyInspectorClient::inspectedURLChanged): Ditto.
WebKit:
Reviewed by Mark Rowe.
Bug 13470: i18n: The Web Inspector is not localizable
http://bugs.webkit.org/show_bug.cgi?id=13470
Update the localized strings and the file encoding of WebInspectorClient.mm.
* English.lproj/Localizable.strings:
* StringsNotToBeLocalized.txt:
* WebKit.xcodeproj/project.pbxproj:
WebKit/gtk:
Reviewed by Mark Rowe.
Bug 13470: i18n: The Web Inspector is not localizable
http://bugs.webkit.org/show_bug.cgi?id=13470
* WebCoreSupport/InspectorClientGtk.cpp:
(WebKit::InspectorClient::localizedStringsURL): Empty stub.
* WebCoreSupport/InspectorClientGtk.h: Add localizedStringsURL.
WebKit/mac:
Reviewed by Mark Rowe.
Bug 13470: i18n: The Web Inspector is not localizable
http://bugs.webkit.org/show_bug.cgi?id=13470
Implement the localizedStringsURL() client method to return the
localized URL of InspectorLocalizedStrings.js in WebCore.
* WebCoreSupport/WebInspectorClient.h: Added localizedStringsURL.
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::localizedStringsURL): Added.
(WebInspectorClient::updateWindowTitle): Localized the window title.
(-[WebInspectorWindowController init]): Remove a FIXME that dosen't make sense anymore.
(-[WebInspectorWindowController initWithInspectedWebView:]): Code style cleanup.
WebKit/qt:
Reviewed by Mark Rowe.
Bug 13470: i18n: The Web Inspector is not localizable
http://bugs.webkit.org/show_bug.cgi?id=13470
* WebCoreSupport/InspectorClientQt.cpp:
(WebCore::InspectorClientQt::localizedStringsURL): Empty stub.
* WebCoreSupport/InspectorClientQt.h: Added localizedStringsURL.
WebKit/win:
Reviewed by Mark Rowe.
Bug 13470: i18n: The Web Inspector is not localizable
http://bugs.webkit.org/show_bug.cgi?id=13470
* English.lproj/Localizable.strings: Updated.
* WebInspectorClient.cpp:
(WebInspectorClient::localizedStringsURL): Empty stub.
* WebInspectorClient.h: Added localizedStringsURL.
WebKit/wx:
Reviewed by Mark Rowe.
Bug 13470: i18n: The Web Inspector is not localizable
http://bugs.webkit.org/show_bug.cgi?id=13470
* WebKitSupport/InspectorClientWx.cpp:
(WebCore::InspectorClientWx::localizedStringsURL): Empty stub.
* WebKitSupport/InspectorClientWx.h: Added localizedStringsURL.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27883
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-11-17 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 13470: i18n: The Web Inspector is not localizable
+ http://bugs.webkit.org/show_bug.cgi?id=13470
+
+ Add support for localization to the Web Inspector. Clients need to
+ implement localizedStringsURL() to return the URL of the
+ InspectorLocalizedStrings.js that best matches the user's language.
+
+ * English.lproj: Added.
+ * English.lproj/InspectorLocalizedStrings.js: Added.
+ * WebCore.xcodeproj/project.pbxproj: Add InspectorLocalizedStrings.js.
+ * page/InspectorClient.h: Add localizedStringsURL.
+ * page/InspectorController.cpp: Add localizedStringsURL that calls
+ the client. Also added a version exposed to JavaScript.
+ * page/InspectorController.h: Add localizedStringsURL.
+ * page/inspector/ConsolePanel.js: Call WebInspector.UIString
+ for user visible strings.
+ * page/inspector/DatabasePanel.js: Ditto.
+ * page/inspector/DocumentPanel.js: Ditto.
+ * page/inspector/ImagePanel.js: Ditto.
+ * page/inspector/MetricsSidebarPane.js: Ditto.
+ * page/inspector/NetworkPanel.js: Ditto.
+ * page/inspector/Panel.js: Ditto.
+ * page/inspector/PropertiesSidebarPane.js: Ditto.
+ * page/inspector/Resource.js: Ditto.
+ * page/inspector/ResourceCategory.js: Ditto.
+ * page/inspector/SourcePanel.js: Ditto.
+ * page/inspector/StylesSidebarPane.js: Ditto.
+ * page/inspector/inspector.css: Use pre-wrap so database errors can use \n.
+ * page/inspector/inspector.html: Remove some user visible strings.
+ * page/inspector/inspector.js: Added WebInspector.UIString and call
+ WebInspector.UIString for user visible strings. Some code needed to be
+ moved to WebInspector.loaded to use UIString after the localized strings
+ get loaded.
+ * platform/graphics/svg/SVGImageEmptyClients.h:
+ (WebCore::SVGEmptyFrameLoaderClient::redirectDataToPlugin): Remove WebCore:: prefix.
+ (WebCore::SVGEmptyInspectorClient::createPage): Ditto.
+ (WebCore::SVGEmptyInspectorClient::localizedStringsURL): Add empty stub.
+ (WebCore::SVGEmptyInspectorClient::highlight): Remove WebCore:: prefix.
+ (WebCore::SVGEmptyInspectorClient::inspectedURLChanged): Ditto.
+
2007-11-17 Timothy Hatcher <timothy@apple.com>
Reviewed by Adam.
1C14E76C0AD8C81C00B6158B /* deleteButton.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 1C14E76A0AD8C81C00B6158B /* deleteButton.tiff */; };
1C4C8F020AD85D87009475CE /* DeleteButtonController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4C8F000AD85D87009475CE /* DeleteButtonController.h */; };
1C4C8F660AD8655D009475CE /* DeleteButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4C8F640AD8655D009475CE /* DeleteButton.h */; };
+ 1C6B7C9A0CEFC9D00076DE61 /* InspectorLocalizedStrings.js in Resources */ = {isa = PBXBuildFile; fileRef = 1C6B7C980CEFC9BE0076DE61 /* InspectorLocalizedStrings.js */; };
1CAF34810A6C405200ABE06E /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF347E0A6C405200ABE06E /* WebScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
1CAF34820A6C405200ABE06E /* WebScriptObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CAF347F0A6C405200ABE06E /* WebScriptObject.mm */; };
1CAF34830A6C405200ABE06E /* WebScriptObjectPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF34800A6C405200ABE06E /* WebScriptObjectPrivate.h */; settings = {ATTRIBUTES = (); }; };
1C4C8F000AD85D87009475CE /* DeleteButtonController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeleteButtonController.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
1C4C8F630AD8655D009475CE /* DeleteButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeleteButton.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
1C4C8F640AD8655D009475CE /* DeleteButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeleteButton.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 1C6B7C990CEFC9BE0076DE61 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = sourcecode.javascript; name = English; path = English.lproj/InspectorLocalizedStrings.js; sourceTree = SOURCE_ROOT; };
1C904DF90BA9D2C80081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
1CAF347E0A6C405200ABE06E /* WebScriptObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptObject.h; sourceTree = "<group>"; };
1CAF347F0A6C405200ABE06E /* WebScriptObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebScriptObject.mm; sourceTree = "<group>"; };
089C1665FE841158C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
+ 1C6B7C980CEFC9BE0076DE61 /* InspectorLocalizedStrings.js */,
1AB1AE780C051FDE00139F4F /* zoomInCursor.png */,
1AB1AE790C051FDE00139F4F /* zoomOutCursor.png */,
464EA2710B8A350B00A8E6E3 /* crossHairCursor.png */,
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 1C6B7C9A0CEFC9D00076DE61 /* InspectorLocalizedStrings.js in Resources */,
B2E27C4E0B0F2AE600F17C7B /* WKArithmeticFilter.cikernel in Resources */,
B2E27C510B0F2AE600F17C7B /* WKComponentMergeFilter.cikernel in Resources */,
B2E27C540B0F2AE600F17C7B /* WKDiffuseLightingFilter.cikernel in Resources */,
};
/* End PBXTargetDependency section */
+/* Begin PBXVariantGroup section */
+ 1C6B7C980CEFC9BE0076DE61 /* InspectorLocalizedStrings.js */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1C6B7C990CEFC9BE0076DE61 /* English */,
+ );
+ name = InspectorLocalizedStrings.js;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
/* Begin XCBuildConfiguration section */
149C283A08902B11008A9EFC /* Debug */ = {
isa = XCBuildConfiguration;
virtual Page* createPage() = 0;
+ virtual String localizedStringsURL() = 0;
+
virtual void showWindow() = 0;
virtual void closeWindow() = 0;
return toRef(KJS::Window::retrieve(controller->inspectedPage()->mainFrame()));
}
+static JSValueRef localizedStrings(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]*/, JSValueRef* /*exception*/)
+{
+ InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+ if (!controller)
+ return JSValueMakeUndefined(ctx);
+
+ String url = controller->localizedStringsURL();
+ if (url.isNull())
+ return JSValueMakeNull(ctx);
+
+ JSStringRef urlString = JSStringCreateWithCharacters(url.characters(), url.length());
+ JSValueRef urlValue = JSValueMakeString(ctx, urlString);
+ JSStringRelease(urlString);
+
+ return urlValue;
+}
+
InspectorController::InspectorController(Page* page, InspectorClient* client)
: m_inspectedPage(page)
, m_client(client)
return m_inspectedPage->settings()->developerExtrasEnabled();
}
+String InspectorController::localizedStringsURL()
+{
+ if (!enabled())
+ return String();
+ return m_client->localizedStringsURL();
+}
+
void InspectorController::inspect(Node* node)
{
if (!node || !enabled())
{ "databaseTableNames", databaseTableNames, kJSPropertyAttributeNone },
#endif
{ "inspectedWindow", inspectedWindow, kJSPropertyAttributeNone },
+ { "localizedStringsURL", localizedStrings, kJSPropertyAttributeNone },
{ 0, 0, 0 }
};
Page* inspectedPage() const { return m_inspectedPage; }
+ String localizedStringsURL();
+
void inspect(Node*);
void highlight(Node*);
void hideHighlight();
show: function()
{
WebInspector.Panel.prototype.show.call(this);
- WebInspector.consoleListItem.item.select();
+ WebInspector.consoleListItem.select();
},
hide: function()
{
WebInspector.Panel.prototype.hide.call(this);
- WebInspector.consoleListItem.item.deselect();
+ WebInspector.consoleListItem.deselect();
},
addMessage: function(msg)
var messageDiv = document.createElement("div");
messageDiv.className = "console-message-message";
- messageDiv.innerText = this.message;
+ messageDiv.textContent = this.message;
item.appendChild(messageDiv);
var urlDiv = document.createElement("div");
urlDiv.className = "console-message-url";
- urlDiv.innerText = this.url;
+ urlDiv.textContent = this.url;
item.appendChild(urlDiv);
if (this.line) {
var lineDiv = document.createElement("div");
lineDiv.className = "console-message-line";
- lineDiv.innerText = this.line;
+ lineDiv.textContent = this.line;
item.appendChild(lineDiv);
}
var inputDiv = document.createElement("div");
inputDiv.className = "console-command-input";
- inputDiv.innerText = this.input;
+ inputDiv.textContent = this.input;
item.appendChild(inputDiv);
var outputDiv = document.createElement("div");
WebInspector.DatabasePanel = function(database, views)
{
- var allViews = [{ title: "Query" }, { title: "Browse" }];
+ var allViews = [{ title: WebInspector.UIString("Query"), name: "query" }, { title: WebInspector.UIString("Browse"), name: "browse" }];
if (views)
allViews = allViews.concat(views);
browseView.reloadTableElement = document.createElement("button");
browseView.reloadTableElement.appendChild(document.createElement("img"));
browseView.reloadTableElement.className = "database-table-reload";
- browseView.reloadTableElement.title = "Reload";
+ browseView.reloadTableElement.title = WebInspector.UIString("Reload");
browseView.reloadTableElement.addEventListener("click", function() { panel.updateTableList(); panel.updateTableBrowser() }, false);
browseView.show = function()
if (!result.errorCode) {
var emptyMsgElement = document.createElement("div");
emptyMsgElement.className = "database-table-empty";
- emptyMsgElement.innerHTML = "The <q>" + this.currentTable + "</q><br>table is empty.";
+ emptyMsgElement.textContent = WebInspector.UIString("The “%@”\ntable is empty.", this.currentTable);
this.views.browse.contentElement.appendChild(emptyMsgElement);
} else {
var errorMsgElement = document.createElement("div");
errorMsgElement.className = "database-table-error";
- errorMsgElement.innerHTML = "An error occurred trying to<br>read the <q>" + this.currentTable + "</q> table.";
+ errorMsgElement.textContent = WebInspector.UIString("An error occurred trying to\nread the “%@” table.", this.currentTable);
this.views.browse.contentElement.appendChild(errorMsgElement);
}
}
resultDiv.textContent = result.error;
} else if (result.errorCode == 2) {
resultDiv.className += " error";
- resultDiv.textContent = "Database no longer has expected version.";
+ resultDiv.textContent = WebInspector.UIString("Database no longer has expected version.");
} else {
resultDiv.className += " error";
- resultDiv.textContent = "An unexpected error " + result.errorCode + " occured.";
+ resultDiv.textContent = WebInspector.UIString("An unexpected error %@ occured.", result.errorCode);
}
}
WebInspector.DocumentPanel = function(resource, views)
{
- var allViews = [{ title: "DOM" }];
+ var allViews = [{ title: WebInspector.UIString("DOM"), name: "dom" }];
if (views)
allViews = allViews.concat(views);
case Node.TEXT_NODE:
if (isNodeWhitespace.call(current))
- crumbTitle = "(whitespace)";
+ crumbTitle = WebInspector.UIString("(whitespace)");
else
- crumbTitle = "(text)";
+ crumbTitle = WebInspector.UIString("(text)");
break
case Node.COMMENT_NODE:
infoListElement.className = "infoList";
var imageProperties = [
- { name: "Dimensions", value: this.imagePreviewElement.naturalWidth + " \u00D7 " + this.imagePreviewElement.height },
- { name: "File size", value: (this.resource.contentLength / 1024).toPrecision(2) + "KB" },
- { name: "MIME type", value: this.resource.mimeType }
+ { name: WebInspector.UIString("Dimensions"), value: WebInspector.UIString("%d × %d", this.imagePreviewElement.naturalWidth, this.imagePreviewElement.height) },
+ { name: WebInspector.UIString("File size"), value: WebInspector.UIString("%.2fKB", (this.resource.contentLength / 1024)) },
+ { name: WebInspector.UIString("MIME type"), value: this.resource.mimeType }
];
var listHTML = '';
WebInspector.MetricsSidebarPane = function()
{
- WebInspector.SidebarPane.call(this, "Metrics");
+ WebInspector.SidebarPane.call(this, WebInspector.UIString("Metrics"));
}
WebInspector.MetricsSidebarPane.prototype = {
};
var boxes = ["content", "padding", "border", "margin"];
+ var boxLabels = [WebInspector.UIString("content"), WebInspector.UIString("padding"), WebInspector.UIString("border"), WebInspector.UIString("margin")];
var previousBox;
for (var i = 0; i < boxes.length; ++i) {
var name = boxes[i];
var labelElement = document.createElement("div");
labelElement.className = "label";
- labelElement.textContent = name;
+ labelElement.textContent = boxLabels[i];
boxElement.appendChild(labelElement);
var topElement = document.createElement("div");
this.graphLabelElement.appendChild(document.createElement("br"));
var sizeOptionElement = document.createElement("option");
- sizeOptionElement.textContent = "Transfer Size";
sizeOptionElement.calculator = new WebInspector.TransferSizeCalculator();
+ sizeOptionElement.textContent = sizeOptionElement.calculator.title;
this.graphModeSelectElement.appendChild(sizeOptionElement);
var timeOptionElement = document.createElement("option");
- timeOptionElement.textContent = "Transfer Time";
timeOptionElement.calculator = new WebInspector.TransferTimeCalculator();
+ timeOptionElement.textContent = timeOptionElement.calculator.title;
this.graphModeSelectElement.appendChild(timeOptionElement);
var graphSideElement = document.createElement("div");
var graphInfo = this.calculator.computeValues(this.timelineEntries);
- var categoryOrder = ["documents", "stylesheets", "images", "scripts", "other"];
- var categoryColors = {documents: {r: 47, g: 102, b: 236}, stylesheets: {r: 157, g: 231, b: 119}, images: {r: 164, g: 60, b: 255}, scripts: {r: 255, g: 121, b: 0}, other: {r: 186, g: 186, b: 186}};
+ var categoryOrder = ["documents", "stylesheets", "images", "fonts", "scripts", "other"];
+ var categoryColors = {documents: {r: 47, g: 102, b: 236}, stylesheets: {r: 157, g: 231, b: 119}, images: {r: 164, g: 60, b: 255}, fonts: {r: 255, g: 10, b: 10}, scripts: {r: 255, g: 121, b: 0}, other: {r: 186, g: 186, b: 186}};
var fillSegments = [];
this.legendElement.removeChildren();
if (this.totalLegendLabel)
this.totalLegendLabel.parentNode.removeChild(this.totalLegendLabel);
- this.totalLegendLabel = this.makeLegendElement(this.calculator.title, this.calculator.formatValue(graphInfo.total));
+ this.totalLegendLabel = this.makeLegendElement(this.calculator.totalTitle, this.calculator.formatValue(graphInfo.total));
this.totalLegendLabel.addStyleClass("network-graph-legend-total");
this.graphLabelElement.appendChild(this.totalLegendLabel);
var fillSegment = {color: colorString, value: size};
fillSegments.push(fillSegment);
- var legendLabel = this.makeLegendElement(category, this.calculator.formatValue(size), colorString);
+ var legendLabel = this.makeLegendElement(WebInspector.resourceCategories[category].title, this.calculator.formatValue(size), colorString);
this.legendElement.appendChild(legendLabel);
}
this.barElement.style.right = "0px";
}
- this.barElement.className = "network-bar network-category-" + this.resource.category.title;
+ this.barElement.className = "network-bar network-category-" + this.resource.category.name;
if (this.infoNeedsRefresh)
this.refreshInfo();
this.infoElement.removeChildren();
var sections = [
- {title: "Request", info: this.resource.sortedRequestHeaders},
- {title: "Response", info: this.resource.sortedResponseHeaders}
+ {title: WebInspector.UIString("Request"), info: this.resource.sortedRequestHeaders},
+ {title: WebInspector.UIString("Response"), info: this.resource.sortedResponseHeaders}
];
function createSectionTable(section) {
this.infoElement.appendChild(table);
var heading = document.createElement("th");
- heading.innerText = section.title;
+ heading.textContent = section.title;
+
var row = table.createTHead().insertRow(-1).appendChild(heading);
var body = document.createElement("tbody");
table.appendChild(body);
section.info.forEach(function(header) {
var row = body.insertRow(-1);
var th = document.createElement("th");
- th.innerText = header.header;
+ th.textContent = header.header;
row.appendChild(th);
- row.insertCell(-1).innerText = header.value;
+ row.insertCell(-1).textContent = header.value;
});
}
sections.forEach(createSectionTable, this);
if (value === undefined)
return;
- if (!(entry.resource.category in categoryValues))
- categoryValues[entry.resource.category] = 0;
- categoryValues[entry.resource.category] += value;
+ if (!(entry.resource.category.name in categoryValues))
+ categoryValues[entry.resource.category.name] = 0;
+ categoryValues[entry.resource.category.name] += value;
total += value;
}
entries.forEach(compute, this);
{
var entriesByCategory = {};
entries.forEach(function(entry) {
- if (!(entry.resource.category in entriesByCategory))
- entriesByCategory[entry.resource.category] = [];
- entriesByCategory[entry.resource.category].push(entry);
+ if (!(entry.resource.category.name in entriesByCategory))
+ entriesByCategory[entry.resource.category.name] = [];
+ entriesByCategory[entry.resource.category.name].push(entry);
});
var earliestStart;
get title()
{
- return "Transfer Time";
+ return WebInspector.UIString("Transfer Time");
+ },
+
+ get totalTitle()
+ {
+ return WebInspector.UIString("Total Time");
},
formatValue: function(value)
get title()
{
- return "Transfer Size";
+ return WebInspector.UIString("Transfer Size");
+ },
+
+ get totalTitle()
+ {
+ return WebInspector.UIString("Total Size");
},
formatValue: function(value)
view.panel = this;
view.buttonElement = document.createElement("button");
- view.buttonElement.setAttribute("title", view.title);
+ view.buttonElement.title = view.title;
view.buttonElement.addEventListener("click", selectViewFunction, false);
view.buttonElement.appendChild(document.createElement("img"));
view.buttonElement.view = view;
view.contentElement = document.createElement("div");
- view.contentElement.className = "content " + view.title.toLowerCase();
+ view.contentElement.className = "content " + view.name;
- this.views[view.title.toLowerCase()] = view;
+ this.views[view.name] = view;
this.viewButtons.push(view.buttonElement);
this.element.appendChild(view.contentElement);
}
WebInspector.PropertiesSidebarPane = function()
{
- WebInspector.SidebarPane.call(this, "Properties");
+ WebInspector.SidebarPane.call(this, WebInspector.UIString("Properties"));
}
WebInspector.PropertiesSidebarPane.prototype = {
var subtitle;
if (title.match(/Prototype$/)) {
title = title.replace(/Prototype$/, "");
- subtitle = "Prototype";
+ subtitle = WebInspector.UIString("Prototype");
}
this.object = object;
{
switch (type) {
case this.Document:
- return "document";
+ return WebInspector.UIString("document");
case this.Stylesheet:
- return "stylesheet";
+ return WebInspector.UIString("stylesheet");
case this.Image:
- return "image";
+ return WebInspector.UIString("image");
case this.Font:
- return "font";
+ return WebInspector.UIString("font");
case this.Script:
- return "script";
+ return WebInspector.UIString("script");
case this.Other:
default:
- return "other";
+ return WebInspector.UIString("other");
}
- },
+ }
}
WebInspector.Resource.prototype = {
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.ResourceCategory = function(title)
+WebInspector.ResourceCategory = function(title, name)
{
+ this.name = name;
this.title = title;
this.resources = [];
this.listItem = new WebInspector.ResourceCategoryTreeElement(this);
WebInspector.SourcePanel = function(resource, views)
{
- var allViews = [{ title: "Source" }];
+ var allViews = [{ title: WebInspector.UIString("Source"), name: "source" }];
if (views)
allViews = allViews.concat(views);
WebInspector.StylesSidebarPane = function()
{
- WebInspector.SidebarPane.call(this, "Styles");
+ WebInspector.SidebarPane.call(this, WebInspector.UIString("Styles"));
}
WebInspector.StylesSidebarPane.prototype = {
}
} else {
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
- styleRules.push({ computedStyle: true, selectorText: "Computed Style", style: computedStyle, editable: false });
+ styleRules.push({ computedStyle: true, selectorText: WebInspector.UIString("Computed Style"), style: computedStyle, editable: false });
var nodeName = node.nodeName.toLowerCase();
for (var i = 0; i < node.attributes.length; ++i) {
var attr = node.attributes[i];
if (attr.style) {
var attrStyle = { style: attr.style, editable: false };
- attrStyle.subtitle = "element\u2019s \u201C" + attr.name + "\u201D attribute";
+ attrStyle.subtitle = WebInspector.UIString("element’s “%@” attribute", attr.name);
attrStyle.selectorText = nodeName + "[" + attr.name;
if (attr.value.length)
attrStyle.selectorText += "=" + attr.value;
}
if (node.style && node.style.length) {
- var inlineStyle = { selectorText: "Inline Style Attribute", style: node.style };
- inlineStyle.subtitle = "element\u2019s \u201Cstyle\u201D attribute";
+ var inlineStyle = { selectorText: WebInspector.UIString("Inline Style Attribute"), style: node.style };
+ inlineStyle.subtitle = WebInspector.UIString("element’s “%@” attribute", "style");
styleRules.push(inlineStyle);
}
showInheritedLabel.addEventListener("click", showInheritedToggleFunction, false);
showInheritedLabel.appendChild(showInheritedInput);
- showInheritedLabel.appendChild(document.createTextNode("Show inherited properties"));
+ showInheritedLabel.appendChild(document.createTextNode(WebInspector.UIString("Show inherited properties")));
this.subtitleElement.appendChild(showInheritedLabel);
} else {
if (!subtitle) {
subtitle = WebInspector.linkifyURL(url, url.trimURL(WebInspector.mainResource.domain).escapeHTML());
this.subtitleElement.addStyleClass("file");
} else if (this.styleRule.parentStyleSheet && !this.styleRule.parentStyleSheet.ownerNode)
- subtitle = "user agent stylesheet";
+ subtitle = WebInspector.UIString("user agent stylesheet");
else
- subtitle = "inline stylesheet";
+ subtitle = WebInspector.UIString("inline stylesheet");
}
this.subtitle = subtitle;
border: none;
}
-.browse.content .database-table-empty {
+.browse.content .database-table-empty, .browse.content .database-table-error {
position: absolute;
top: 0;
bottom: 25%;
text-align: center;
font-weight: bold;
padding: 10px;
+ white-space: pre-wrap;
}
.browse.content .database-table-error {
- position: absolute;
- top: 0;
- bottom: 25%;
- left: 0;
- right: 0;
- font-size: 24px;
color: rgb(66%, 33%, 33%);
- margin-top: auto;
- margin-bottom: auto;
- height: 50px;
- line-height: 26px;
- text-align: center;
- padding: 10px;
}
.database-browse-table {
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title>Web Inspector</title>
<script type="text/javascript" src="utilities.js"></script>
<script type="text/javascript" src="treeoutline.js"></script>
<script type="text/javascript" src="inspector.js"></script>
<div id="toolbar">
<button id="back" class="split-button first"><img></button><img class="split-button-divider"><button id="forward" class="split-button last"><img></button>
<span id="toolbarButtons"></span>
- <input id="search" type="search" autosave="inspectorSearch" results="20" placeholder="Search" incremental="incremental" onsearch="WebInspector.performSearch(this.value)">
+ <input id="search" type="search" autosave="inspectorSearch" results="20" incremental="incremental" onsearch="WebInspector.performSearch(this.value)">
</div>
<div id="sidebar" class="focusable focused">
<ol id="list"></ol>
maxInlineTextChildLength: 80,
maxTextSearchResultLength: 80,
showInheritedComputedStyleProperties: false,
+ showMissingLocalizedStrings: false,
toolbarHeight: 28
}
resourceURLMap: {},
backForwardList: [],
searchResultsHeight: 100,
+ localizedStrings: {},
+ missingLocalizedStrings: {},
get consolePanel()
{
}
}
-WebInspector.loaded = function(event)
+WebInspector.setupLocalizedString = function(event)
+{
+ var localizedStringsURL = InspectorController.localizedStringsURL();
+ if (localizedStringsURL) {
+ var localizedStringsScriptElement = document.createElement("script");
+ localizedStringsScriptElement.type = "text/javascript";
+ localizedStringsScriptElement.src = localizedStringsURL;
+ document.getElementsByTagName("head").item(0).appendChild(localizedStringsScriptElement);
+ }
+}
+
+WebInspector.loaded = function()
{
this.fileOutline = new TreeOutline(document.getElementById("list"));
this.fileOutline.expandTreeElementsWhenArrowing = true;
this.statusOutline.expandTreeElementsWhenArrowing = true;
this.resourceCategories = {
- documents: new WebInspector.ResourceCategory("documents"),
- stylesheets: new WebInspector.ResourceCategory("stylesheets"),
- images: new WebInspector.ResourceCategory("images"),
- scripts: new WebInspector.ResourceCategory("scripts"),
- fonts: new WebInspector.ResourceCategory("fonts"),
- databases: new WebInspector.ResourceCategory("databases"),
- other: new WebInspector.ResourceCategory("other")
+ documents: new WebInspector.ResourceCategory(WebInspector.UIString("documents"), "documents"),
+ stylesheets: new WebInspector.ResourceCategory(WebInspector.UIString("stylesheets"), "stylesheets"),
+ images: new WebInspector.ResourceCategory(WebInspector.UIString("images"), "images"),
+ scripts: new WebInspector.ResourceCategory(WebInspector.UIString("scripts"), "scripts"),
+ fonts: new WebInspector.ResourceCategory(WebInspector.UIString("fonts"), "fonts"),
+ databases: new WebInspector.ResourceCategory(WebInspector.UIString("databases"), "databases"),
+ other: new WebInspector.ResourceCategory(WebInspector.UIString("other"), "other")
+ };
+
+ this.Tips = {
+ ResourceNotCompressed: {id: 0, message: WebInspector.UIString("You could save bandwidth by having your web server compress this transfer with gzip or zlib.")}
+ };
+
+ this.Warnings = {
+ IncorrectMIMEType: {id: 0, message: WebInspector.UIString("Resource interpreted as %@ but transferred with MIME type %@.")}
};
- this.consoleListItem = new WebInspector.ConsoleStatusTreeElement();
- this.consoleListItem.item.onselect = function(element) { WebInspector.StatusTreeElement.selected(element); WebInspector.navigateToPanel(WebInspector.consolePanel) };
- this.consoleListItem.item.ondeselect = function(element) { WebInspector.consolePanel.hide() };
- this.statusOutline.appendChild(this.consoleListItem.item);
+ this.consoleListItem = new WebInspector.ConsoleStatusTreeElement(WebInspector.consolePanel);
+ this.statusOutline.appendChild(this.consoleListItem);
- this.networkListItem = new WebInspector.StatusTreeElement("Network");
- this.networkListItem.onselect = function(element) { WebInspector.StatusTreeElement.selected(element); WebInspector.navigateToPanel(WebInspector.networkPanel); };
- this.networkListItem.ondeselect = function(element) { WebInspector.networkPanel.hide() };
+ this.networkListItem = new WebInspector.StatusTreeElement(WebInspector.UIString("Network"), "network", WebInspector.networkPanel);
this.statusOutline.appendChild(this.networkListItem);
this.resourceCategories.documents.listItem.expand();
document.addEventListener("beforecopy", function(event) { WebInspector.documentCanCopy(event) }, true);
document.addEventListener("copy", function(event) { WebInspector.documentCopy(event) }, true);
- document.getElementById("back").title = "Show previous panel.";
- document.getElementById("forward").title = "Show next panel.";
+ document.getElementById("back").title = WebInspector.UIString("Show previous panel.");
+ document.getElementById("forward").title = WebInspector.UIString("Show next panel.");
+
+ document.getElementById("search").setAttribute("placeholder", WebInspector.UIString("Search"));
document.getElementById("back").addEventListener("click", function(event) { WebInspector.back() }, true);
document.getElementById("forward").addEventListener("click", function(event) { WebInspector.forward() }, true);
document.body.addStyleClass("detached");
- window.removeEventListener("load", this.loaded, false);
- delete this.loaded;
-
InspectorController.loaded();
}
-window.addEventListener("load", function(event) { WebInspector.loaded(event) }, false);
+var windowLoaded = function()
+{
+ WebInspector.setupLocalizedString(event);
+
+ // Delay calling loaded to give time for the localized strings file to load.
+ // Calling it too early will cause localized string lookups to fail.
+ setTimeout(function() { WebInspector.loaded() }, 0);
+
+ delete windowLoaded;
+ window.removeEventListener("load", windowLoaded, false);
+};
+
+window.addEventListener("load", windowLoaded, false);
WebInspector.windowUnload = function(event)
{
WebInspector.back = function()
{
if (this.currentBackForwardIndex <= 0) {
- alert("Can't go back from index " + this.currentBackForwardIndex);
+ console.error("Can't go back from index " + this.currentBackForwardIndex);
return;
}
WebInspector.forward = function()
{
if (this.currentBackForwardIndex >= this.backForwardList.length - 1) {
- alert("Can't go forward from index " + this.currentBackForwardIndex);
+ console.error("Can't go forward from index " + this.currentBackForwardIndex);
return;
}
var title = "<div class=\"selection selected\"></div>";
if (j == 0)
- title += "<div class=\"search-results-section\">Source</div>";
+ title += "<div class=\"search-results-section\">" + WebInspector.UIString("Source") + "</div>";
title += beforeText.escapeHTML() + "<span class=\"search-matched-string\">" + text.escapeHTML() + "</span>" + afterText.escapeHTML();
var item = new TreeElement(title, {panel: file.resource.panel, line: line, range: range}, false);
item.onselect = sourceResultSelected;
var node = file.domResults[j];
var title = "<div class=\"selection selected\"></div>";
if (j == 0)
- title += "<div class=\"search-results-section\">DOM</div>";
+ title += "<div class=\"search-results-section\">" + WebInspector.UIString("DOM") + "</div>";
title += nodeTitleInfo.call(node).title;
var item = new TreeElement(title, {panel: file.resource.panel, node: node}, false);
item.onselect = domResultSelected;
panel.currentView = view;
}
-WebInspector.StatusTreeElement = function(title)
+WebInspector.UIString = function(string)
{
- var item = new TreeElement("<span class=\"title only\">" + title + "</span><span class=\"icon " + title.toLowerCase() + "\"></span>", {}, false);
- item.onselect = WebInspector.StatusTreeElement.selected;
- return item;
+ if (string in this.localizedStrings)
+ string = this.localizedStrings[string];
+ else {
+ if (!(string in this.missingLocalizedStrings)) {
+ console.error("Localized string \"" + string + "\" not found.");
+ this.missingLocalizedStrings[string] = true;
+ }
+
+ if (Preferences.showMissingLocalizedStrings)
+ string += " (not localized)";
+ }
+
+ return String.vsprintf(string, Array.prototype.slice.call(arguments, 1));
}
-WebInspector.StatusTreeElement.selected = function(element)
+WebInspector.StatusTreeElement = function(title, iconClass, panel)
{
- var selectedElement = WebInspector.fileOutline.selectedTreeElement;
- if (selectedElement)
- selectedElement.deselect();
+ TreeElement.call(this, "<span class=\"title only\">" + title + "</span><span class=\"icon " + iconClass + "\"></span>", null, false);
+ this.panel = panel;
}
-WebInspector.ConsoleStatusTreeElement = function()
+WebInspector.StatusTreeElement.prototype = {
+ onselect: function()
+ {
+ var selectedElement = WebInspector.fileOutline.selectedTreeElement;
+ if (selectedElement)
+ selectedElement.deselect();
+ if (this.panel)
+ WebInspector.navigateToPanel(this.panel);
+ },
+
+ ondeselect: function()
+ {
+ if (this.panel)
+ this.panel.hide();
+ }
+}
+
+WebInspector.StatusTreeElement.prototype.__proto__ = TreeElement.prototype;
+
+WebInspector.ConsoleStatusTreeElement = function(panel)
{
- this.item = WebInspector.StatusTreeElement.call(this, "Console");
+ WebInspector.StatusTreeElement.call(this, WebInspector.UIString("Console"), "console", panel);
}
WebInspector.ConsoleStatusTreeElement.prototype = {
var title = "<span class=\"title";
if (!this.warnings && !this.errors)
title += " only";
- title += "\">Console</span><span class=\"icon console\"></span>";
+ title += "\">" + WebInspector.UIString("Console") + "</span><span class=\"icon console\"></span>";
if (this.warnings || this.errors) {
title += "<span class=\"info\">";
title += "</span>";
}
- this.item.title = title;
+ this.title = title;
}
}
WebInspector.ConsoleStatusTreeElement.prototype.__proto__ = WebInspector.StatusTreeElement.prototype;
-WebInspector.Tips = {
- ResourceNotCompressed: {id: 0, message: "You could save bandwidth by having your web server compress this transfer with gzip or zlib."}
-}
-
-WebInspector.Warnings = {
- IncorrectMIMEType: {id: 0, message: "Resource interpreted as %s but transferred with MIME type %s."}
-}
-
// This table maps MIME types to the Resource.Types which are valid for them.
// The following line:
// "text/html": {0: 1},
virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType) { return ObjectContentType(); }
virtual String overrideMediaType() const { return String(); }
- virtual void redirectDataToPlugin(WebCore::Widget*) {}
+ virtual void redirectDataToPlugin(Widget*) {}
virtual void windowObjectCleared() {}
virtual void didPerformFirstNavigation() const {}
virtual void inspectorDestroyed() {};
- virtual WebCore::Page* createPage() { return 0; };
+ virtual Page* createPage() { return 0; };
+
+ virtual String localizedStringsURL() { return String(); };
virtual void showWindow() {};
virtual void closeWindow() {};
virtual void attachWindow() {};
virtual void detachWindow() {};
- virtual void highlight(WebCore::Node*) {};
+ virtual void highlight(Node*) {};
virtual void hideHighlight() {};
- virtual void inspectedURLChanged(const WebCore::String& newURL) {};
+ virtual void inspectedURLChanged(const String& newURL) {};
};
}
+2007-11-17 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 13470: i18n: The Web Inspector is not localizable
+ http://bugs.webkit.org/show_bug.cgi?id=13470
+
+ Update the localized strings and the file encoding of WebInspectorClient.mm.
+
+ * English.lproj/Localizable.strings:
+ * StringsNotToBeLocalized.txt:
+ * WebKit.xcodeproj/project.pbxproj:
+
2007-11-16 Mark Rowe <mrowe@apple.com>
Reviewed by Tim Hatcher.
"Times"
"ToggleBold"
"ToggleItalic"
-"U+000009"
-"U+00001B"
+"U+0009"
+"U+001B"
"UTF-8"
"UseBackForwardList"
"User-Agent"
"WebAuthenticationPanel"
"WebBackForwardList:\n"
"WebDataRequest"
+"WebDatabaseDidModifyDatabaseNotification"
+"WebDatabaseDidModifyOriginNotification"
"WebDatabaseDirectory"
-"WebDatabaseNameKey"
-"WebDatabaseSizeKey"
+"WebDatabaseDisplayNameKey"
+"WebDatabaseExpectedSizeKey"
+"WebDatabaseUsageKey"
"WebElementDOMNode"
"WebElementFrame"
"WebElementImage"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"height"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"menuBarVisible"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"message"
-WebKit/mac/WebCoreSupport/WebChromeClient.mm:"preferredType"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"resizable"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"scrollbarsVisible"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"statusBarVisible"
-WebKit/mac/WebCoreSupport/WebChromeClient.mm:"tab"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"toolBarVisible"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"width"
-WebKit/mac/WebCoreSupport/WebChromeClient.mm:"window"
WebKit/mac/WebCoreSupport/WebChromeClient.mm:"y"
WebKit/mac/WebCoreSupport/WebEditorClient.mm:"Down"
WebKit/mac/WebCoreSupport/WebEditorClient.mm:"Enter"
WebKit/mac/WebCoreSupport/WebEditorClient.mm:"Up"
WebKit/mac/WebCoreSupport/WebFrameBridge.mm:"height"
WebKit/mac/WebCoreSupport/WebFrameBridge.mm:"width"
-WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"Web Inspector %C %@"
+WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"InspectorLocalizedStrings"
WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"Web Inspector 2"
WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"inspector"
WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"inspector/Images"
+WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"js"
WebKit/mac/WebInspector/WebNodeHighlightView.m:"display"
WebKit/mac/WebInspector/WebNodeHighlightView.m:"inline"
WebKit/mac/WebView/WebHTMLView.mm:"'%@'"
065AD5A10B0C32C7005A2B1D /* WebContextMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebContextMenuClient.h; sourceTree = "<group>"; };
065AD5A20B0C32C7005A2B1D /* WebContextMenuClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuClient.mm; sourceTree = "<group>"; };
06693DDA0BFBA85200216072 /* WebInspectorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspectorClient.h; sourceTree = "<group>"; };
- 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorClient.mm; sourceTree = "<group>"; };
+ 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorClient.mm; sourceTree = "<group>"; };
14D8252D0AF955090004F057 /* WebChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebChromeClient.h; sourceTree = "<group>"; };
14D8252E0AF955090004F057 /* WebChromeClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebChromeClient.mm; sourceTree = "<group>"; };
1C0706620A431E01001078F6 /* WebScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptDebugServer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+2007-11-17 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 13470: i18n: The Web Inspector is not localizable
+ http://bugs.webkit.org/show_bug.cgi?id=13470
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::InspectorClient::localizedStringsURL): Empty stub.
+ * WebCoreSupport/InspectorClientGtk.h: Add localizedStringsURL.
+
2007-11-13 Mark Rowe <mrowe@apple.com>
Gtk build fix. Replace incorrect use of the LOG macro with g_print.
return 0;
}
+String InspectorClient::localizedStringsURL()
+{
+ notImplemented();
+ return String();
+}
+
void InspectorClient::showWindow()
{
notImplemented();
virtual WebCore::Page* createPage();
+ virtual WebCore::String localizedStringsURL();
+
virtual void showWindow();
virtual void closeWindow();
+2007-11-17 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 13470: i18n: The Web Inspector is not localizable
+ http://bugs.webkit.org/show_bug.cgi?id=13470
+
+ Implement the localizedStringsURL() client method to return the
+ localized URL of InspectorLocalizedStrings.js in WebCore.
+
+ * WebCoreSupport/WebInspectorClient.h: Added localizedStringsURL.
+ * WebCoreSupport/WebInspectorClient.mm:
+ (WebInspectorClient::localizedStringsURL): Added.
+ (WebInspectorClient::updateWindowTitle): Localized the window title.
+ (-[WebInspectorWindowController init]): Remove a FIXME that dosen't make sense anymore.
+ (-[WebInspectorWindowController initWithInspectedWebView:]): Code style cleanup.
+
2007-11-17 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
virtual void inspectorDestroyed();
virtual WebCore::Page* createPage();
+ virtual WebCore::String localizedStringsURL();
virtual void showWindow();
virtual void closeWindow();
#import "WebFrameInternal.h"
#import "WebFrameView.h"
+#import "WebLocalizableStrings.h"
#import "WebNodeHighlight.h"
#import "WebPreferences.h"
#import "WebView.h"
#import "WebViewInternal.h"
#import "WebViewPrivate.h"
+
#import <AppKit/NSWindowController.h>
+
#import <WebCore/InspectorController.h>
#import <WebCore/Page.h>
+
#import <WebKit/DOMCore.h>
#import <WebKit/DOMExtensions.h>
return core([m_windowController.get() webView]);
}
+String WebInspectorClient::localizedStringsURL()
+{
+ NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"InspectorLocalizedStrings" ofType:@"js"];
+ if (path)
+ return [[NSURL fileURLWithPath:path] absoluteString];
+ return String();
+}
+
void WebInspectorClient::showWindow()
{
updateWindowTitle();
void WebInspectorClient::updateWindowTitle() const
{
- [[m_windowController.get() window] setTitle:[NSString stringWithFormat:@"Web Inspector %C %@", 0x2014, (NSString *)m_inspectedURL]];
+ NSString *title = [NSString stringWithFormat:UI_STRING("Web Inspector — %@", "Web Inspector window title"), (NSString *)m_inspectedURL];
+ [[m_windowController.get() window] setTitle:title];
}
#pragma mark -
[preferences release];
- // FIXME: The InspectorController should give us the URL to inspector.html
NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"inspector" ofType:@"html" inDirectory:@"inspector"];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL fileURLWithPath:path]];
[[_webView mainFrame] loadRequest:request];
return self;
}
--(id)initWithInspectedWebView:(WebView *)webView
+- (id)initWithInspectedWebView:(WebView *)webView
{
if (![self init])
return nil;
+2007-11-17 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 13470: i18n: The Web Inspector is not localizable
+ http://bugs.webkit.org/show_bug.cgi?id=13470
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::localizedStringsURL): Empty stub.
+ * WebCoreSupport/InspectorClientQt.h: Added localizedStringsURL.
+
2007-11-13 Geoffrey Garen <ggaren@apple.com>
Build fix: changed Shared to RefCounted.
return 0;
}
+String InspectorClientQt::localizedStringsURL()
+{
+ notImplemented();
+ return String();
+}
+
void InspectorClientQt::showWindow()
{
notImplemented();
virtual Page* createPage();
+ virtual String localizedStringsURL();
+
virtual void showWindow();
virtual void closeWindow();
+2007-11-17 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 13470: i18n: The Web Inspector is not localizable
+ http://bugs.webkit.org/show_bug.cgi?id=13470
+
+ * English.lproj/Localizable.strings: Updated.
+ * WebInspectorClient.cpp:
+ (WebInspectorClient::localizedStringsURL): Empty stub.
+ * WebInspectorClient.h: Added localizedStringsURL.
+
2007-11-17 Alexey Proskuryakov <ap@webkit.org>
Windows build fix.
#include <WebCore/FloatRect.h>
#include <WebCore/FrameView.h>
#include <WebCore/InspectorController.h>
+#include <WebCore/NotImplemented.h>
#include <WebCore/Page.h>
#include <WebCore/RenderObject.h>
#pragma warning(pop)
return core(m_webView.get());
}
+
+String WebInspectorClient::localizedStringsURL()
+{
+ notImplemented();
+ return String();
+}
+
void WebInspectorClient::showWindow()
{
if (!m_hwnd)
virtual void inspectorDestroyed();
virtual WebCore::Page* createPage();
+
+ virtual WebCore::String localizedStringsURL();
+
virtual void showWindow();
virtual void closeWindow();
virtual bool windowVisible();
+2007-11-17 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 13470: i18n: The Web Inspector is not localizable
+ http://bugs.webkit.org/show_bug.cgi?id=13470
+
+ * WebKitSupport/InspectorClientWx.cpp:
+ (WebCore::InspectorClientWx::localizedStringsURL): Empty stub.
+ * WebKitSupport/InspectorClientWx.h: Added localizedStringsURL.
+
2007-11-08 Kevin Ollivier <kevino@theolliviers.com>
Initial commit of wx implementation of WebKit. This includes
return 0;
}
+String InspectorClientWx::localizedStringsURL()
+{
+ notImplemented();
+ return String();
+}
+
void InspectorClientWx::showWindow()
{
notImplemented();
virtual Page* createPage();
+ virtual String localizedStringsURL();
+
virtual void showWindow();
virtual void closeWindow();