From 9efac32b85e456bafe96abc6d18c06174dcbb148 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 28 Mar 2015 11:18:54 +0300 Subject: [PATCH] Localize search prompts in editor --- _locales/en/messages.json | 8 ++++++++ edit.js | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 24d3985e..bf57d82a 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -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" diff --git a/edit.js b/edit.js index 55aa4b8b..469213f6 100644 --- a/edit.js +++ b/edit.js @@ -47,6 +47,9 @@ var sectionTemplate = tHTML('\ \ '); +var findTemplate = t("search") + ':  ' + + '(' + t("searchRegexp") + ')'; + // 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;