Added internationalization for some missing labels

This commit is contained in:
Blakko 2013-07-11 15:01:45 +02:00
parent d9ccaf53ad
commit 9f9e75400e
11 changed files with 62 additions and 25 deletions

View File

@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<body> <body>
<div id="header"> <div id="header">
<img alt="OpenRefine" src="images/logo-openrefine-30.png" width="129" height="29" /> <img alt="OpenRefine" src="images/logo-openrefine-30.png" width="129" height="29" />
<span id="slogan">A power tool for working with messy data.</span> <span id="slogan"></span>
</div> </div>
<div id="left-panel" class="main-layout-panel"><div id="left-panel-body"> <div id="left-panel" class="main-layout-panel"><div id="left-panel-body">
@ -58,8 +58,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<div id="openrefine-version"></div> <div id="openrefine-version"></div>
</div> </div>
<ul> <ul>
<li><a href="http://code.google.com/p/google-refine/wiki/DocumentationForUsers">Help</a></li> <li><a href="http://code.google.com/p/google-refine/wiki/DocumentationForUsers" id="or-index-help"></a></li>
<li><a href="about.html">About</a></li> <li><a href="about.html" id="or-index-about"></a></li>
</ul> </ul>
</div> </div>
</div></div> <!-- left-panel --> </div></div> <!-- left-panel -->
@ -68,9 +68,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div></div> <!-- right-panel --> </div></div> <!-- right-panel -->
<div id="no-project-message" class="message" style="display: none;"> <div id="no-project-message" class="message" style="display: none;">
No existing project. Select "Create Project" on the left to create a new project.<br/> <span id="or-index-noProj"></span><br/>
If you have no data to work with, try these <span id="or-index-try"></span>
<a href="http://code.google.com/p/google-refine/wiki/SampleDatasets" target="_blank">sample data sets</a>. <a href="http://code.google.com/p/google-refine/wiki/SampleDatasets" target="_blank" id="or-index-sample"></a>.
</div> </div>
</body> </body>
</html> </html>

View File

@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div> </div>
<div id="body-info"> <div id="body-info">
<div id="loading-message"><img src="images/large-spinner.gif" /> Loading...</div> <div id="loading-message"><img src="images/large-spinner.gif" /> <span id="or-proj-starting"></span></div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -47,24 +47,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<div id="header"> <div id="header">
<a id="app-home-button" href="./"><img alt="OpenRefine" src="images/logo-openrefine-30.png" width="129" height="29" /></a> <a id="app-home-button" href="./"><img alt="OpenRefine" src="images/logo-openrefine-30.png" width="129" height="29" /></a>
<div id="project-title"> <div id="project-title">
<span id="project-name-button" class="app-path-section" title="Click to rename project"></span> <span id="project-name-button" class="app-path-section"></span>
<a id="project-permalink-button" href="javascript:{}" class="secondary">Permalink</a> <a id="project-permalink-button" href="javascript:{}" class="secondary"></a>
</div> </div>
<div id="project-controls"> <div id="project-controls">
<a href="./" class="button" target="_blank">Open...</a> <a href="./" class="button" target="_blank"><span id="or-proj-open"></span></a>
<a class="button" bind="exportButton" id="export-button" href="#export"><span class="button-menu">Export</span></a> <a class="button" bind="exportButton" id="export-button" href="#export"><span class="button-menu" id="or-proj-export"></span></a>
<a href="http://code.google.com/p/google-refine/wiki/DocumentationForUsers" target="_blank" class="button">Help</a> <a href="http://code.google.com/p/google-refine/wiki/DocumentationForUsers" target="_blank" class="button"><span id="or-proj-help"></span></a>
</div> </div>
</div> </div>
<div id="loading-message"><img src="images/large-spinner.gif" /> Starting up...</div> <div id="loading-message"><img src="images/large-spinner.gif" /> <span id="or-proj-starting"></span></div>
<div id="body"> <div id="body">
<div bind="leftPanelDiv" id="left-panel"> <div bind="leftPanelDiv" id="left-panel">
<div bind="leftPanelTabs" class="refine-tabs"> <div bind="leftPanelTabs" class="refine-tabs">
<ul> <ul>
<li><a href="#refine-tabs-facets">Facet / Filter</a></li> <li><a href="#refine-tabs-facets" id="or-proj-facFil"></a></li>
<li><a href="#refine-tabs-history" bind="historyTabHeader">Undo / Redo</a></li> <li><a href="#refine-tabs-history" bind="historyTabHeader" id="or-proj-undoRedo"></a></li>
</ul> </ul>
<div id="refine-tabs-facets" bind="facetPanelDiv" id="facet-panel"></div> <div id="refine-tabs-facets" bind="facetPanelDiv" id="facet-panel"></div>
<div id="refine-tabs-history" bind="historyPanelDiv" id="history-panel"></div> <div id="refine-tabs-history" bind="historyPanelDiv" id="history-panel"></div>
@ -76,7 +76,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<!-- row/record counts --> <!-- row/record counts -->
</div> </div>
<div bind="extensionBarDiv" id="extension-bar"> <div bind="extensionBarDiv" id="extension-bar">
Extensions: <span bind="menuContainer" id="extension-bar-menu-container"></span> <span id="or-proj-ext"></span> <span bind="menuContainer" id="extension-bar-menu-container"></span>
</div> </div>
</div> </div>
<div bind="viewPanelDiv" id="view-panel"></div> <div bind="viewPanelDiv" id="view-panel"></div>

View File

@ -191,5 +191,12 @@ $(function() {
} }
Refine.selectActionArea('create-project'); Refine.selectActionArea('create-project');
$("#slogan").text($.i18n._('core-index')["slogan"]+".");
$("#or-index-help").text($.i18n._('core-index')["help"]);
$("#or-index-about").text($.i18n._('core-index')["about"]);
$("#or-index-noProj").text($.i18n._('core-index')["no-proj"]+".");
$("#or-index-try").text($.i18n._('core-index')["try-these"]);
$("#or-index-sample").text($.i18n._('core-index')["sample-data"]);
showVersion(); showVersion();
}); });

View File

@ -158,7 +158,7 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
); );
var renameLink = $('<a></a>') var renameLink = $('<a></a>')
.text("rename") .text($.i18n._('core-index-open')["rename"])
.addClass("secondary") .addClass("secondary")
.attr("href", "javascript:{}") .attr("href", "javascript:{}")
.css("visibility", "hidden") .css("visibility", "hidden")

View File

@ -94,6 +94,7 @@ function PreferenceUI(tr, key, value) {
function populatePreferences(prefs) { function populatePreferences(prefs) {
var body = $("#body-info").empty(); var body = $("#body-info").empty();
$("#or-proj-starting").text($.i18n._('core-project')["starting"]+"...");
$('<h1>').text($.i18n._('core-index')["preferences"]).appendTo(body); $('<h1>').text($.i18n._('core-index')["preferences"]).appendTo(body);
var table = $('<table>') var table = $('<table>')

View File

@ -123,6 +123,16 @@ function initializeUI(uiState) {
$("#project-controls").show(); $("#project-controls").show();
$("#body").show(); $("#body").show();
$("#or-proj-open").text($.i18n._('core-project')["open"]+"...");
$("#project-permalink-button").text($.i18n._('core-project')["permalink"]);
$("#project-name-button").attr("title",$.i18n._('core-project')["proj-name"]);
$("#or-proj-export").text($.i18n._('core-project')["export"]);
$("#or-proj-help").text($.i18n._('core-project')["help"]);
$("#or-proj-starting").text($.i18n._('core-project')["starting"]+"...");
$("#or-proj-facFil").text($.i18n._('core-project')["facet-filter"]);
$("#or-proj-undoRedo").text($.i18n._('core-project')["undo-redo"]);
$("#or-proj-ext").text($.i18n._('core-project')["extensions"]+":");
$('#project-name-button').click(Refine._renameProject); $('#project-name-button').click(Refine._renameProject);
$('#project-permalink-button').mouseenter(function() { $('#project-permalink-button').mouseenter(function() {
this.href = Refine.getPermanentLink(); this.href = Refine.getPermanentLink();

View File

@ -69,7 +69,7 @@ HistoryPanel.prototype.update = function(onDone) {
HistoryPanel.prototype._render = function() { HistoryPanel.prototype._render = function() {
var self = this; var self = this;
this._tabHeader.html('Undo / Redo <span class="count">' + this._data.past.length + '</span>'); this._tabHeader.html($.i18n._('core-project')["undo-redo"]+' <span class="count">' + this._data.past.length + '</span>');
this._div.empty().unbind().html(DOM.loadHTML("core", "scripts/project/history-panel.html")); this._div.empty().unbind().html(DOM.loadHTML("core", "scripts/project/history-panel.html"));

View File

@ -42,7 +42,7 @@ SummaryBar.prototype._initializeUI = function() {
SummaryBar.prototype.updateResultCount = function() { SummaryBar.prototype.updateResultCount = function() {
var summaryText; var summaryText;
var units = theProject.rowModel.mode == "row-based" ? "rows" : "records"; var units = theProject.rowModel.mode == "row-based" ? $.i18n._('core-views')["rows"] : $.i18n._('core-views')["records"];
if (theProject.rowModel.filtered == theProject.rowModel.total) { if (theProject.rowModel.filtered == theProject.rowModel.total) {
summaryText = (theProject.rowModel.total) + ' ' + units; summaryText = (theProject.rowModel.total) + ' ' + units;
} else { } else {

View File

@ -123,8 +123,8 @@ DataTableView.prototype.render = function() {
}); });
} }
}; };
renderBrowsingModeLink("rows", "row-based"); renderBrowsingModeLink($.i18n._('core-views')["rows"], "row-based");
renderBrowsingModeLink("records", "record-based"); renderBrowsingModeLink($.i18n._('core-views')["records"], "record-based");
this._renderPagingControls(elmts.pageSizeControls, elmts.pagingControls); this._renderPagingControls(elmts.pageSizeControls, elmts.pagingControls);
@ -181,7 +181,7 @@ DataTableView.prototype._renderPagingControls = function(pageSizeControls, pagin
lastPage.addClass("inaction"); lastPage.addClass("inaction");
} }
$('<span>Show: </span>').appendTo(pageSizeControls); $('<span>'+$.i18n._('core-views')["show"]+': </span>').appendTo(pageSizeControls);
var sizes = [ 5, 10, 25, 50 ]; var sizes = [ 5, 10, 25, 50 ];
var renderPageSize = function(index) { var renderPageSize = function(index) {
var pageSize = sizes[index]; var pageSize = sizes[index];
@ -202,7 +202,7 @@ DataTableView.prototype._renderPagingControls = function(pageSizeControls, pagin
} }
$('<span>') $('<span>')
.text(theProject.rowModel.mode == "record-based" ? ' records' : ' rows') .text(theProject.rowModel.mode == "record-based" ? ' '+$.i18n._('core-views')["records"] : ' '+$.i18n._('core-views')["rows"])
.appendTo(pageSizeControls); .appendTo(pageSizeControls);
}; };

View File

@ -1,5 +1,8 @@
{ {
"core-index": { "core-index": {
"slogan": "A power tool for working with messy data",
"help": "Help",
"about": "About",
"version": "Version", "version": "Version",
"new-version": "New version!", "new-version": "New version!",
"download": "Download", "download": "Download",
@ -14,7 +17,10 @@
"edit": "Edit", "edit": "Edit",
"delete": "Delete", "delete": "Delete",
"new-proj-name": "New project name:", "new-proj-name": "New project name:",
"error-rename": "Failed to rename project:" "error-rename": "Failed to rename project:",
"no-proj": "No existing project. Select 'Create Project' on the left to create a new project",
"try-these": "If you have no data to work with, try these",
"sample-data": "sample data sets"
}, },
"core-index-create": { "core-index-create": {
"create-proj": "Create Project", "create-proj": "Create Project",
@ -79,6 +85,7 @@
"core-index-open": { "core-index-open": {
"open-proj" : "Open Project", "open-proj" : "Open Project",
"name": "Name", "name": "Name",
"rename": "rename",
"last-mod": "Last&nbsp;modified", "last-mod": "Last&nbsp;modified",
"del-title": "Delete this project", "del-title": "Delete this project",
"del-body": "Are you sure you want to delete project \"", "del-body": "Are you sure you want to delete project \"",
@ -274,6 +281,15 @@
"numeric": "Numeric" "numeric": "Numeric"
}, },
"core-project": { "core-project": {
"open": "Open",
"permalink": "Permalink",
"export": "Export",
"help": "Help",
"starting": "Starting up",
"facet-filter": "Facet / Filter",
"undo-redo": "Undo / Redo",
"extensions": "Extensions",
"proj-name": "Click to rename project",
"use-facets": "Using facets and filters", "use-facets": "Using facets and filters",
"use-to-select": "Use facets and filters to select subsets of your data to act on. Choose facet and filter methods from the menus at the top of each data column.", "use-to-select": "Use facets and filters to select subsets of your data to act on. Choose facet and filter methods from the menus at the top of each data column.",
"not-sure": "Not sure how to get started?", "not-sure": "Not sure how to get started?",
@ -596,7 +612,10 @@
"number": "number", "number": "number",
"boolean": "boolean", "boolean": "boolean",
"date": "date", "date": "date",
"ctrl-enter": "Ctrl-Enter" "ctrl-enter": "Ctrl-Enter",
"rows": "rows",
"records": "records",
"show": "Show"
}, },
"core-buttons": { "core-buttons": {
"cancel": "Cancel", "cancel": "Cancel",