diff --git a/extensions/wikidata/module/langs/translation-en.json b/extensions/wikidata/module/langs/translation-en.json new file mode 100644 index 000000000..66cf8f014 --- /dev/null +++ b/extensions/wikidata/module/langs/translation-en.json @@ -0,0 +1,42 @@ +{ + "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.", + "schema-tab-header": "Schema", + "warnings-tab-header": "Issues", + "qs-preview-tab-header": "QuickStatements preview", + "draggable-columns-header": "Columns:", + "add-item-button": "add item", + "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" + }, + "warnings-messages": { + "new-item-created": { + "title": "This batch will create new Wikidata items.", + "body": "Please make sure that these items do not exist yet and are suitable for inclusion in Wikidata." + }, + "new-item-without-labels-or-aliases": { + "title": "Some new items will be created without any label or alias.", + "body": "You should at least provide one label, so that others can understand what the item is about." + }, + "new-item-without-descriptions": { + "title": "Some new items will be created without any description.", + "body": "Adding descriptions will make it easier to disambiguate them from namesakes." + }, + "new-item-with-deleted-statements": { + "title": "You are trying to delete statements on new items.", + "body": "There is probably something wrong in your schema or project." + }, + "new-item-without-P31-or-P279": { + "title": "Some new items will be created without any type.", + "body": "You should provide an \"instance of\" (P31) or \"subclass of\" (P279) statement for each item that you create." + }, + "statement-without-reference": { + "title": "Some statements are not referenced.", + "body": "Please provide references for the statements that you add." + } + } +} diff --git a/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.html b/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.html index 23060ee33..695f8bfbc 100644 --- a/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.html +++ b/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.html @@ -1,51 +1,47 @@
-
Align to Wikibase
+
-

- 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. -

+

-

Columns:

+

- +
diff --git a/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js b/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js index edb52a696..2e28a89e7 100644 --- a/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js +++ b/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js @@ -153,6 +153,19 @@ SchemaAlignmentDialog._createDialog = function() { var frame = $(DOM.loadHTML("wikidata", "scripts/dialogs/schema-alignment-dialog.html")); var elmts = this._elmts = DOM.bind(frame); + this._elmts.dialogHeader.text($.i18n._('wikidata-schema')["dialog-header"]); + this._elmts.dialogExplanation.text($.i18n._('wikidata-schema')["dialog-explanation"]); + this._elmts.schemaTabHeader.text($.i18n._('wikidata-schema')["schema-tab-header"]); + this._elmts.warningsTabHeader.text($.i18n._('wikidata-schema')["warnings-tab-header"]); + this._elmts.qsPreviewTabHeader.text($.i18n._('wikidata-schema')["qs-preview-tab-header"]); + this._elmts.draggableColumnsHeader.text($.i18n._('wikidata-schema')["draggable-columns-header"]); + this._elmts.addItemButton.text($.i18n._('wikidata-schema')["add-item-button"]); + this._elmts.invalidSchemaWarningIssues.text($.i18n._('wikidata-schema')["invalid-schema-warning-issues"]); + this._elmts.invalidSchemaWarningQs.text($.i18n._('wikidata-schema')["invalid-schema-warning-qs"]); + this._elmts.resetButton.text($.i18n._('wikidata-schema')["reset-button"]); + this._elmts.saveButton.text($.i18n._('wikidata-schema')["save-button"]); + this._elmts.closeButton.text($.i18n._('wikidata-schema')["close-button"]); + this._level = DialogSystem.showDialog(frame); this._wikibasePrefix = "http://www.wikidata.org/entity/"; // hardcoded for now @@ -850,6 +863,13 @@ SchemaAlignmentDialog.preview = function(initial) { *************************/ SchemaAlignmentDialog._renderWarning = function(warning) { + var localized = $.i18n._('warnings-messages')[warning.type]; + var title = warning.type; + var body = ""; + if (localized) { + title = localized.title; + body = localized.body; + } var tr = $('').addClass('wb-warning'); var severityTd = $('') .addClass('wb-warning-severity') @@ -859,10 +879,10 @@ SchemaAlignmentDialog._renderWarning = function(warning) { .addClass('wb-warning-body') .appendTo(tr); var h1 = $('

') - .text(warning.type) + .text(title) .appendTo(bodyTd); var p = $('

') - .text('Lorem ipsum') + .text(body) .appendTo(bodyTd); var countTd = $('') .addClass('wb-warning-count') diff --git a/extensions/wikidata/module/scripts/menu-bar-extension.js b/extensions/wikidata/module/scripts/menu-bar-extension.js index e88160b1e..b95f8f484 100644 --- a/extensions/wikidata/module/scripts/menu-bar-extension.js +++ b/extensions/wikidata/module/scripts/menu-bar-extension.js @@ -1,3 +1,21 @@ +// Load the localization file +var dictionary = {}; +$.ajax({ + url : "command/core/load-language?", + type : "POST", + async : false, + data : { + module : "wikidata", +// lang : lang + }, + success : function(data) { + dictionary = data; + } +}); +$.i18n.setDictionary(dictionary); + + + ExporterManager.MenuItems.push({}); ExporterManager.MenuItems.push( {