Jonas Kress (WMDE) has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/373031 )
Change subject: Make base URL configurable and use i18n in embed for edit link
......................................................................
Make base URL configurable and use i18n in embed for edit link
Bug:T173778
Change-Id: I0740ae2cb3a37ec8c448e87dbdd333413c9dedaa
---
M embed.html
M i18n/en.json
M i18n/qqq.json
M wikibase/config.js
4 files changed, 15 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui
refs/changes/31/373031/1
diff --git a/embed.html b/embed.html
index 059083e..b266481 100644
--- a/embed.html
+++ b/embed.html
@@ -156,7 +156,7 @@
<div class="panel-body">
</div>
</div>
- <a class="link edit-link" target="_blank" title="Wikidata Query Service
SPARQL"><small>Edit on query.Wikidata.org</small></a>
+ <a class="link edit-link" target="_blank"
data-i18n="[title]wdqs-embed-button-edit-query-title"><small
data-i18n="wdqs-embed-button-edit-query"></small></a>
<a href="#" class="edit edit-link" data-toggle="popover"><span
class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
<!-- JS files -->
@@ -273,10 +273,10 @@
renderEdit( query, function( q ){
resultView.draw( q );
window.location.hash = '#' +
encodeURIComponent( q )
- $( '.edit-link' ).attr( 'href',
'https://query.wikidata.org/' + window.location.hash )
+ $( '.edit-link' ).attr( 'href',
config.location.index + window.location.hash )
} );
- $( '.edit-link' ).attr( 'href',
'https://query.wikidata.org/' + window.location.hash )
+ $( '.edit-link' ).attr( 'href',
config.location.index + window.location.hash )
} );
} );
diff --git a/i18n/en.json b/i18n/en.json
index cfd81c0..549fb83 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -78,5 +78,7 @@
"wdqs-action-server-error": "Server error",
"wdqs-action-unknow-error": "Unknown error",
"wdqs-action-preview": "Result preview",
- "wdqs-result-map-layers-all": "All layers"
+ "wdqs-result-map-layers-all": "All layers",
+ "wdqs-embed-button-edit-query": "Edit this query",
+ "wdqs-embed-button-edit-query-title": "Edit this query with the SPARQL
editor"
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 6c5d889..85ccf29 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -80,5 +80,7 @@
"wdqs-action-server-error": "Label for progressbar displaying server
error",
"wdqs-action-unknow-error": "Label for progressbar displaying unknown
error",
"wdqs-action-preview": "Label for progressbar displaying preview",
- "wdqs-result-map-layers-all": "Label for all layers in layer control on
map view"
+ "wdqs-result-map-layers-all": "Label for all layers in layer control on
map view",
+ "wdqs-embed-button-edit-query": "Label for button in embed",
+ "wdqs-embed-button-edit-query-title": "Title for button in embed"
}
diff --git a/wikibase/config.js b/wikibase/config.js
index 27d769b..572af15 100644
--- a/wikibase/config.js
+++ b/wikibase/config.js
@@ -38,6 +38,9 @@
brand: {
logo: 'logo.svg',
title: 'Wikidata Query'
+ },
+ location: {
+ index: 'https://query.wikidata.org/'
}
};
@@ -55,6 +58,9 @@
},
brand: {
title: 'Localhost'
+ },
+ location: {
+ index: './'
}
} );
--
To view, visit https://gerrit.wikimedia.org/r/373031
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0740ae2cb3a37ec8c448e87dbdd333413c9dedaa
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits