From f8467fcda64485293b2d94133fe90f751127e146 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 16 Feb 2019 14:24:15 -0600 Subject: [PATCH] Fix locale text for "Show replies" --- assets/js/watch.js | 12 ++++++------ src/invidious/views/watch.ecr | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/js/watch.js b/assets/js/watch.js index 0126c586..37ca4e43 100644 --- a/assets/js/watch.js +++ b/assets/js/watch.js @@ -35,20 +35,20 @@ String.prototype.supplant = function(o) { }); }; -function show_youtube_replies(target) { +function show_youtube_replies(target, inner_text, sub_text) { body = target.parentNode.parentNode.children[1]; body.style.display = ""; - target.innerHTML = "Hide replies"; - target.setAttribute("onclick", "hide_youtube_replies(this)"); + target.innerHTML = inner_text; + target.setAttribute("onclick", "hide_youtube_replies(this, \'" + inner_text + "\', \'" + sub_text + "\')"); } -function hide_youtube_replies(target) { +function hide_youtube_replies(target, inner_text, sub_text) { body = target.parentNode.parentNode.children[1]; body.style.display = "none"; - target.innerHTML = "Show replies"; - target.setAttribute("onclick", "show_youtube_replies(this)"); + target.innerHTML = sub_text; + target.setAttribute("onclick", "show_youtube_replies(this, \'" + inner_text + "\', \'" + sub_text + "\')"); } function download_video(target) { diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 7ba5ae7f..e6457e69 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -460,7 +460,7 @@ function get_youtube_replies(target, load_more) { } else { body.innerHTML = ' \

<%= translate(locale, "Hide replies") %> \ + onclick="hide_youtube_replies(this, \'<%= translate(locale, "Hide replies") %>\', \'<%= translate(locale, "Show replies") %>\')"><%= translate(locale, "Hide replies") %> \

\
{contentHtml}
'.supplant({ contentHtml: xhr.response.contentHtml,