diff --git a/extensions/wikidata/module/langs/translation-en.json b/extensions/wikidata/module/langs/translation-en.json index 6fdc10531..2366502e1 100644 --- a/extensions/wikidata/module/langs/translation-en.json +++ b/extensions/wikidata/module/langs/translation-en.json @@ -1,4 +1,12 @@ { + "wikidata-extension": { + "menu-label": "Wikidata", + "edit-wikidata-schema": "Edit Wikidata schema", + "manage-wikidata-account": "Manage Wikidata account", + "perform-edits-on-wikidata": "Perform edits on Wikidata", + "export-to-qs": "Export to QuickStatements", + "quickstatements-export-name": "QuickStatements" + }, "wikidata-schema": { "dialog-header": "Align to Wikidata", "dialog-explanation": "The schema alignment skeleton below specifies how your tabular data will be transformed into Wikibase statements. You can drag and drop columns in statements: they will be replaced by their values once you export the statements.", @@ -7,15 +15,45 @@ "qs-preview-tab-header": "QuickStatements preview", "draggable-columns-header": "Columns:", "add-item-button": "add item", + "add-term": "add term", + "remove-term": "remove term", + "add-statement": "add statement", + "remove-statement": "remove statement", + "add-value": "add value", + "add-qualifier": "add qualifier", + "add-reference": "add reference", + "add-reference-snak": "add", + "remove-reference": "remove reference", + "nb-references": " references", + "remove-column": "remove column", + "label": "Label", + "description": "Description", + "alias": "Alias", + "item-or-reconciled-column": "item or reconciled column", + "datatype-not-supported-yet": "This datatype is not supported yet, sorry.", "invalid-schema-warning-issues": "Your schema is incomplete, fix it to see the issues.", "invalid-schema-warning-qs": "Your schema is incomplete, fix it to see the preview.", "reset-button": "Reset", "save-button": "Save", - "close-button": "Close" + "close-button": "Close", + "unsaved-changes": "There are unsaved changes. Close anyway?" }, "wikidata-preview": { "new-id": "new item" }, + "wikidata-account": { + "dialog-header": "Wikidata account", + "explain-log-in": "Logging in to Wikidata will allow you to perform edits directly from OpenRefine.", + "username-label": "Username:", + "username-placeholder": "Enter your username", + "password-label": "Password:", + "password-placeholder": "Enter your password", + "remember-credentials-label": "Remember credentials (stored unencrypted in OpenRefine's preferences)", + "close": "Close", + "log-in": "Log in", + "logged-in-as": "You are logged in as:", + "log-out": "Log out" + }, "perform-wikidata-edits": { "dialog-header": "Perform edits on Wikidata", "review-your-edits": "Please review your edits before pushing them to Wikidata. Consider requesting feedback at the Data Import Hub for large datasets.", @@ -42,6 +80,7 @@ "body": "There is probably something wrong in your schema or project." }, "new-item-without-P31-or-P279": { + "title": "New items created without any type.", "body": "You should provide an \"instance of\" (P31) or \"subclass of\" (P279) statement for each item that you create, such as {example_entity}." }, diff --git a/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.html b/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.html index 95e0742da..cb9356eed 100644 --- a/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.html +++ b/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.html @@ -1,8 +1,7 @@
-
Wikidata account
+
-

- Logging in to Wikidata will allow you to perform edits directly from OpenRefine. +

-

You are logged in as: +

diff --git a/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.js b/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.js index 5d2cddb63..915e86536 100644 --- a/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.js +++ b/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.js @@ -25,6 +25,20 @@ ManageAccountDialog.display = function(logged_in_username, saved_credentials, ca var elmts = this._elmts = DOM.bind(frame); console.log(saved_credentials); + this._elmts.dialogHeader.text($.i18n._('wikidata-account')["dialog-header"]); + this._elmts.explainLogIn.text($.i18n._('wikidata-account')["explain-log-in"]); + this._elmts.usernameLabel.text($.i18n._('wikidata-account')["username-label"]); + this._elmts.usernameInput.attr("placeholder", $.i18n._('wikidata-account')["username-placeholder"]); + this._elmts.passwordLabel.text($.i18n._('wikidata-account')["password-label"]); + this._elmts.passwordInput.attr("placeholder", $.i18n._('wikidata-account')["password-placeholder"]); + this._elmts.rememberCredentialsLabel.text($.i18n._('wikidata-account')["remember-credentials-label"]); + this._elmts.dialogHeader.text($.i18n._('wikidata-account')["dialog-header"]); + this._elmts.cancelButton1.text($.i18n._('wikidata-account')["close"]); + this._elmts.cancelButton2.text($.i18n._('wikidata-account')["close"]); + this._elmts.loggedInAs.text($.i18n._('wikidata-account')["logged-in-as"]); + this._elmts.logoutButton.text($.i18n._('wikidata-account')["log-out"]); + this._elmts.loginButton.text($.i18n._('wikidata-account')["log-in"]); + this._level = DialogSystem.showDialog(frame); var dismiss = function() { diff --git a/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js b/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js index 1b8bce5fe..287482315 100644 --- a/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js +++ b/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js @@ -156,7 +156,7 @@ SchemaAlignmentDialog._createDialog = function() { self._reset(null); }); elmts.closeButton.click(function() { - if (!self._hasUnsavedChanges || window.confirm("There are unsaved changes. Close anyway?")) { + if (!self._hasUnsavedChanges || window.confirm($.i18n._('wikidata-schema')["unsaved-changes"])) { dismiss(); } }); @@ -198,12 +198,12 @@ SchemaAlignmentDialog._addItem = function(json) { var right = $('
').addClass('wbs-right').appendTo(item); $('
').addClass('wbs-namedesc-container').appendTo(right); var toolbar = $('
').addClass('wbs-toolbar').appendTo(right); - $('').addClass('wbs-add-namedesc').text('add name/description').click(function() { + $('').addClass('wbs-add-namedesc').text($.i18n._('wikidata-schema')["add-term"]).click(function() { SchemaAlignmentDialog._addNameDesc(item, null); }).appendTo(toolbar); $('
').addClass('wbs-statement-group-container').appendTo(right); var toolbar = $('
').addClass('wbs-toolbar').appendTo(right); - $('').addClass('wbs-add-statement-group').text('add statement').click(function() { + $('').addClass('wbs-add-statement-group').text($.i18n._('wikidata-schema')["add-statement"]).click(function() { SchemaAlignmentDialog._addStatementGroup(item, null); }).appendTo(toolbar); @@ -255,20 +255,20 @@ SchemaAlignmentDialog._addNameDesc = function(item, json) { var type_input = $('').appendTo(type_container); $('') .attr('value', 'LABEL') - .text('Label') + .text($.i18n._('wikidata-schema')["label"]) .appendTo(type_input); $('') .attr('value', 'DESCRIPTION') - .text('Description') + .text($.i18n._('wikidata-schema')["description"]) .appendTo(type_input); $('') .attr('value', 'ALIAS') - .text('Alias') + .text($.i18n._('wikidata-schema')["alias"]) .appendTo(type_input); type_input.val(type); var toolbar = $('
').addClass('wbs-toolbar').appendTo(namedesc); - $('').attr('alt', 'remove name/description').click(function() { + $('').attr('alt', $.i18n._('wikidata-schema')["remove-term"]).click(function() { namedesc.remove(); }).appendTo(toolbar); @@ -308,7 +308,7 @@ SchemaAlignmentDialog._addStatementGroup = function(item, json) { var statementContainer = $('
').addClass('wbs-statement-container').appendTo(right); SchemaAlignmentDialog._initPropertyField(inputContainer, statementContainer, property); var toolbar = $('
').addClass('wbs-toolbar').appendTo(right); - var addValueButton = $('').addClass('wbs-add-statement').text('add value').click(function() { + var addValueButton = $('').addClass('wbs-add-statement').text($.i18n._('wikidata-schema')["add-value"]).click(function() { var datatype = inputContainer.data("jsonValue").datatype; SchemaAlignmentDialog._addStatement(statementContainer, datatype, null); }).appendTo(toolbar).hide(); @@ -350,7 +350,7 @@ SchemaAlignmentDialog._addStatement = function(container, datatype, json) { var statement = $('
').addClass('wbs-statement'); var toolbar1 = $('
').addClass('wbs-toolbar').appendTo(statement); - $('').attr('alt', 'remove statement').click(function() { + $('').attr('alt', $.i18n._('wikidata-schema')["remove-statement"]).click(function() { SchemaAlignmentDialog._removeStatement(statement); }).appendTo(toolbar1); var inputContainer = $('
').addClass('wbs-target-input').appendTo(statement); @@ -364,7 +364,7 @@ SchemaAlignmentDialog._addStatement = function(container, datatype, json) { var right = $('
').addClass('wbs-right').appendTo(statement); var qualifierContainer = $('
').addClass('wbs-qualifier-container').appendTo(right); var toolbar2 = $('
').addClass('wbs-toolbar').appendTo(right); - $('').addClass('wbs-add-qualifier').text('add qualifier').click(function() { + $('').addClass('wbs-add-qualifier').text($.i18n._('wikidata-schema')["add-qualifier"]).click(function() { SchemaAlignmentDialog._addQualifier(qualifierContainer, null); }).appendTo(toolbar2); if (qualifiers) { @@ -384,7 +384,7 @@ SchemaAlignmentDialog._addStatement = function(container, datatype, json) { referenceContainer.hide(); var right2 = $('
').addClass('wbs-right').appendTo(right); var toolbar3 = $('
').addClass('wbs-toolbar').appendTo(right2); - $('').addClass('wbs-add-reference').text('add reference').click(function() { + $('').addClass('wbs-add-reference').text($.i18n._('wikidata-schema')["add-reference"]).click(function() { referenceContainer.show(); SchemaAlignmentDialog._addReference(referenceContainer, null); SchemaAlignmentDialog._updateReferencesNumber(referenceContainer); @@ -465,7 +465,7 @@ SchemaAlignmentDialog._addReference = function(container, json) { var reference = $('
').addClass('wbs-reference').appendTo(container); var referenceHeader = $('
').addClass('wbs-reference-header').appendTo(reference); var toolbarRef = $('
').addClass('wbs-toolbar').appendTo(referenceHeader); - $('').attr('alt', 'remove reference').click(function() { + $('').attr('alt', $.i18n._('wikidata-schema')["remove-reference"]).click(function() { reference.remove(); SchemaAlignmentDialog._updateReferencesNumber(container); SchemaAlignmentDialog._hasChanged(); @@ -473,7 +473,7 @@ SchemaAlignmentDialog._addReference = function(container, json) { var right = $('
').addClass('wbs-right').appendTo(reference); var qualifierContainer = $('
').addClass('wbs-qualifier-container').appendTo(right); var toolbar2 = $('
').addClass('wbs-toolbar').appendTo(right); - $('').addClass('wbs-add-qualifier').text('add').click(function() { + $('').addClass('wbs-add-qualifier').text($.i18n._('wikidata-schema')['add-reference-snak']).click(function() { SchemaAlignmentDialog._addQualifier(qualifierContainer, null); }).appendTo(toolbar2); @@ -499,7 +499,7 @@ SchemaAlignmentDialog._updateReferencesNumber = function(container) { var childrenCount = container.children().length; var statement = container.parents('.wbs-statement'); var a = statement.find('.wbs-references-toggle a').first(); - a.html(childrenCount+' references'); + a.html(childrenCount+$.i18n._('wikidata-schema')["nb-references"]); } /************************ @@ -572,7 +572,7 @@ SchemaAlignmentDialog._initField = function(inputContainer, mode, initialValue, } if (this._reconService !== null && mode === "wikibase-item") { - input.attr("placeholder", "item or reconciled column"); + input.attr("placeholder", $.i18n._('wikidata-schema')["item-or-reconciled-column"]); var endpoint = null; endpoint = this._reconService.suggest.entity; var suggestConfig = $.extend({}, endpoint); @@ -616,7 +616,7 @@ SchemaAlignmentDialog._initField = function(inputContainer, mode, initialValue, changedCallback(); }); } else if (mode === "quantity") { - alert("not supported yet!"); + alert($.i18n._('wikidata-schema')["datatype-not-supported-yet"]); } else if (mode === "language") { var initial_language_width = "20%"; var expanded_width = "90px"; @@ -682,7 +682,7 @@ SchemaAlignmentDialog._initField = function(inputContainer, mode, initialValue, var columnDiv = $('
').appendTo(inputContainer); column.appendTo(columnDiv); var deleteButton = $(' ').addClass('wbs-delete-column-button').appendTo(column); - deleteButton.attr('alt', 'remove column'); + deleteButton.attr('alt', $.i18n._('wikidata-schema')["remove-column"]); deleteButton.click(function () { columnDiv.remove(); input.show(); diff --git a/extensions/wikidata/module/scripts/menu-bar-extension.js b/extensions/wikidata/module/scripts/menu-bar-extension.js index b95f8f484..7a23826c3 100644 --- a/extensions/wikidata/module/scripts/menu-bar-extension.js +++ b/extensions/wikidata/module/scripts/menu-bar-extension.js @@ -20,7 +20,7 @@ ExporterManager.MenuItems.push({}); ExporterManager.MenuItems.push( { "id" : "exportQuickStatements", - "label":"QuickStatements", + "label": $.i18n._('wikidata-extions')["quickstatements-export-name"], "click": function() { WikibaseExporterMenuBar.exportTo("quickstatements"); } } ); @@ -60,26 +60,26 @@ $(function(){ ExtensionBar.MenuItems.push( { "id":"reconcile", - "label": "Wikidata", + "label": $.i18n._('wikidata-extension')["menu-label"], "submenu" : [ { id: "wikidata/edit-schema", - label: "Edit Wikibase schema...", + label: $.i18n._('wikidata-extension')["edit-wikidata-schema"], click: function() { SchemaAlignmentDialog.launch(false); } }, { id:"wikidata/manage-account", - label: "Manage account", + label: $.i18n._('wikidata-extension')["manage-wikidata-account"], click: function() { ManageAccountDialog.checkAndLaunch(); } }, { id:"wikidata/perform-edits", - label: "Push to Wikidata...", + label: $.i18n._('wikidata-extension')["perform-edits-on-wikidata"], click: function() { PerformEditsDialog.checkAndLaunch(); } }, { id:"wikidata/export-qs", - label: "Export to QuickStatements", + label: $.i18n._('wikidata-extension')["export-to-qs"], click: function() { WikibaseExporterMenuBar.exportTo("quickstatements"); } },