Localize search prompts in editor
This commit is contained in:
parent
0e6f63951a
commit
9efac32b85
|
@ -205,6 +205,14 @@
|
||||||
"message": "Show number of styles active for the current site on the toolbar button",
|
"message": "Show number of styles active for the current site on the toolbar button",
|
||||||
"description": "Label for the checkbox controlling toolbar badge text."
|
"description": "Label for the checkbox controlling toolbar badge text."
|
||||||
},
|
},
|
||||||
|
"search": {
|
||||||
|
"message": "Search",
|
||||||
|
"description": "Label before the search input field in the editor shown on Ctrl-F"
|
||||||
|
},
|
||||||
|
"searchRegexp": {
|
||||||
|
"message": "Use /re/ syntax for regexp search",
|
||||||
|
"description": "Label after the search input field in the editor shown on Ctrl-F"
|
||||||
|
},
|
||||||
"sectionAdd": {
|
"sectionAdd": {
|
||||||
"message": "Add another section",
|
"message": "Add another section",
|
||||||
"description": "Label for the button to add a section"
|
"description": "Label for the button to add a section"
|
||||||
|
|
5
edit.js
5
edit.js
|
@ -47,6 +47,9 @@ var sectionTemplate = tHTML('\
|
||||||
</div>\
|
</div>\
|
||||||
');
|
');
|
||||||
|
|
||||||
|
var findTemplate = t("search") + ': <input type="text" style="width: 10em" class="CodeMirror-search-field"/> ' +
|
||||||
|
'<span style="color: #888" class="CodeMirror-search-hint">(' + t("searchRegexp") + ')</span>';
|
||||||
|
|
||||||
// make querySelectorAll enumeration code readable
|
// make querySelectorAll enumeration code readable
|
||||||
["forEach", "some", "indexOf"].forEach(function(method) {
|
["forEach", "some", "indexOf"].forEach(function(method) {
|
||||||
NodeList.prototype[method]= Array.prototype[method];
|
NodeList.prototype[method]= Array.prototype[method];
|
||||||
|
@ -441,7 +444,7 @@ function setupGlobalSearch() {
|
||||||
function find(activeCM) {
|
function find(activeCM) {
|
||||||
var originalOpenDialog = activeCM.openDialog;
|
var originalOpenDialog = activeCM.openDialog;
|
||||||
activeCM.openDialog = function(template, callback, options) {
|
activeCM.openDialog = function(template, callback, options) {
|
||||||
originalOpenDialog.call(activeCM, template, function(query) {
|
originalOpenDialog.call(activeCM, findTemplate, function(query) {
|
||||||
activeCM.openDialog = originalOpenDialog;
|
activeCM.openDialog = originalOpenDialog;
|
||||||
callback(query);
|
callback(query);
|
||||||
var state = activeCM.state.search;
|
var state = activeCM.state.search;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user