Localize search prompts in editor

This commit is contained in:
tophf 2015-03-28 11:18:54 +03:00
parent 0e6f63951a
commit 9efac32b85
2 changed files with 12 additions and 1 deletions

View File

@ -205,6 +205,14 @@
"message": "Show number of styles active for the current site on the toolbar button",
"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": {
"message": "Add another section",
"description": "Label for the button to add a section"

View File

@ -47,6 +47,9 @@ var sectionTemplate = tHTML('\
</div>\
');
var findTemplate = t("search") + ': <input type="text" style="width: 10em" class="CodeMirror-search-field"/>&nbsp;' +
'<span style="color: #888" class="CodeMirror-search-hint">(' + t("searchRegexp") + ')</span>';
// make querySelectorAll enumeration code readable
["forEach", "some", "indexOf"].forEach(function(method) {
NodeList.prototype[method]= Array.prototype[method];
@ -441,7 +444,7 @@ function setupGlobalSearch() {
function find(activeCM) {
var originalOpenDialog = activeCM.openDialog;
activeCM.openDialog = function(template, callback, options) {
originalOpenDialog.call(activeCM, template, function(query) {
originalOpenDialog.call(activeCM, findTemplate, function(query) {
activeCM.openDialog = originalOpenDialog;
callback(query);
var state = activeCM.state.search;