From d51be71ca740bea54d796bfa8cfc6ebd13bae29e Mon Sep 17 00:00:00 2001 From: Jonathan Wilkes <jon.w.wilkes@gmail.com> Date: Thu, 24 Mar 2016 11:50:00 -0400 Subject: [PATCH] use locale strings for find bar placeholder text --- pd/nw/index.js | 2 +- pd/nw/locales/en/translation.json | 8 ++++++++ pd/nw/pd_canvas.js | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pd/nw/index.js b/pd/nw/index.js index ef0ff523a..8ceebe5d0 100644 --- a/pd/nw/index.js +++ b/pd/nw/index.js @@ -221,7 +221,7 @@ function console_find_keydown(evt) { function add_events() { // Find bar var find_bar = document.getElementById("console_find_text"); - find_bar.placeholder = "Search in Console"; + find_bar.placeholder = l("pd_window.find.placeholder"); find_bar.addEventListener("keydown", function(e) { return console_find_keydown(e); diff --git a/pd/nw/locales/en/translation.json b/pd/nw/locales/en/translation.json index e75742fa5..cd70507b0 100644 --- a/pd/nw/locales/en/translation.json +++ b/pd/nw/locales/en/translation.json @@ -244,6 +244,11 @@ "devtools": "Show DevTools", "devtools_tt": "Show the DevTools window (for debugging)" }, + "pd_window": { + "find": { + "placeholder": "Search in Console" + } + }, "canvas": { "paste_clipboard_prompt": "Warning: you are about to paste Pd code that came from somewhere outside of Pd. Do you want to continue?", "save_dialog": { @@ -254,6 +259,9 @@ "cancel": "Cancel", "cancel_tt": "Don't save any changes, and don't close the patch" }, + "find": { + "placeholder": "Search in Canvas" + }, "prop": { "heading": { "gop": "appearance", diff --git a/pd/nw/pd_canvas.js b/pd/nw/pd_canvas.js index 6b3285e65..9ec61c055 100644 --- a/pd/nw/pd_canvas.js +++ b/pd/nw/pd_canvas.js @@ -704,7 +704,8 @@ var canvas_events = (function() { // Add placeholder text... this all needs to be collected into an // add_events function similiar to the one in index.js - document.querySelector("#canvas_find_text").placeholder = "Search in Patch"; + document.querySelector("#canvas_find_text").placeholder = + l("canvas.find.placeholder"); document.querySelector("#canvas_find_text").addEventListener("blur", canvas_find_blur, false ); -- GitLab