From 9665b82fb5910e37bb024ec9c4cf3de2042395c8 Mon Sep 17 00:00:00 2001 From: syeopite Date: Sun, 17 Sep 2023 11:37:27 -0700 Subject: [PATCH] Improve locale keys for comments disabled messages Co-authored-by: Samantaz Fox --- assets/js/comments.js | 4 ++-- locales/en-US.json | 6 +++--- src/invidious/views/watch.ecr | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/assets/js/comments.js b/assets/js/comments.js index f413e5aef..f6fffeea5 100644 --- a/assets/js/comments.js +++ b/assets/js/comments.js @@ -76,10 +76,10 @@ function get_youtube_comments() { if (!video_data.comments_enabled) { comments.innerHTML = `
-

${video_data.youtube_comments_disabled_text}

+

${video_data.comments_youtube_disabled_text}

- ${video_data.youtube_comments_disabled_try_reddit} + ${video_data.comments_youtube_disabled_try_reddit}

`; diff --git a/locales/en-US.json b/locales/en-US.json index 82b1b13cb..a7f7f592e 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -213,9 +213,9 @@ "View Reddit comments": "View Reddit comments", "Hide replies": "Hide replies", "Show replies": "Show replies", - "youtube_comments_disabled_text": "Comments are turned off on this video", - "youtube_comments_disabled_try_reddit": "Try reddit comments?", - "invidious_comments_disabled_text": "Comments are hidden as per configuration", + "comments_youtube_disabled_text": "Youtube comments are disabled on this video", + "comments_youtube_disabled_try_reddit": "Try reddit comments?", + "comments_invidious_disabled_text": "Comments are hidden as per user preferences", "Incorrect password": "Incorrect password", "Wrong answer": "Wrong answer", "Erroneous CAPTCHA": "Erroneous CAPTCHA", diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 2d0963610..5cd65686c 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -62,8 +62,8 @@ we're going to need to do it here in order to allow for translations. "youtube_comments_text" => HTML.escape(translate(locale, "View YouTube comments")), "reddit_comments_text" => HTML.escape(translate(locale, "View Reddit comments")), "reddit_permalink_text" => HTML.escape(translate(locale, "View more comments on Reddit")), - "youtube_comments_disabled_text" => HTML.escape(translate(locale, "youtube_comments_disabled_text")), - "youtube_comments_disabled_try_reddit" => HTML.escape(translate(locale, "youtube_comments_disabled_try_reddit")), + "comments_youtube_disabled_text" => HTML.escape(translate(locale, "comments_youtube_disabled_text")), + "comments_youtube_disabled_try_reddit" => HTML.escape(translate(locale, "comments_youtube_disabled_try_reddit")), "comments_text" => HTML.escape(translate(locale, "View `x` comments", "{commentCount}")), "hide_replies_text" => HTML.escape(translate(locale, "Hide replies")), "show_replies_text" => HTML.escape(translate(locale, "Show replies")), @@ -300,7 +300,7 @@ we're going to need to do it here in order to allow for translations.
<% if (params.comments <=> ["", ""]) == 0 %>
-

<%=HTML.escape(translate(locale, "invidious_comments_disabled_text"))%>

+

<%=HTML.escape(translate(locale, "comments_invidious_disabled_text"))%>

<% else %> <% if video.comments? %> @@ -315,12 +315,12 @@ we're going to need to do it here in order to allow for translations. <% end %> <% else %>
-

<%=HTML.escape(translate(locale, "youtube_comments_disabled_text"))%>

+

<%=HTML.escape(translate(locale, "comments_youtube_disabled_text"))%>

- <%=HTML.escape(translate(locale, "youtube_comments_disabled_try_reddit"))%> + <%=HTML.escape(translate(locale, "comments_youtube_disabled_try_reddit"))%>