From aa10a9d899c694fb8652d190039c386534516d0c Mon Sep 17 00:00:00 2001 From: Allan Nordhøy Date: Fri, 19 Apr 2019 18:14:11 +0200 Subject: Language fixes (#366) * Language fixes --- src/invidious.cr | 10 +++++----- src/invidious/comments.cr | 2 +- src/invidious/helpers/tokens.cr | 4 ++-- src/invidious/playlists.cr | 4 ++-- src/invidious/videos.cr | 2 +- src/invidious/views/login.ecr | 10 +++++----- src/invidious/views/preferences.ecr | 2 +- src/invidious/views/subscription_manager.ecr | 2 +- src/invidious/views/template.ecr | 4 ++-- src/invidious/views/watch.ecr | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/invidious.cr b/src/invidious.cr index 57db7e28..878f9d4c 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -944,7 +944,7 @@ post "/login" do |env| # Voice or text message tfa_req = %(["#{user_hash}",null,2,null,[9,null,null,null,null,null,null,null,[null,"#{tfa_code}",false,2]]]) else - error_message = "Unable to login, make sure two-factor authentication (Authenticator or SMS) is enabled." + error_message = translate(locale, "Unable to log in, make sure two-factor authentication (Authenticator or SMS) is turned on.") next templated "error" end @@ -1010,7 +1010,7 @@ post "/login" do |env| env.redirect referer rescue ex - error_message = translate(locale, "Login failed. This may be because two-factor authentication is not enabled on your account.") + error_message = translate(locale, "Login failed. This may be because two-factor authentication is not turned on for your account.") next templated "error" end when "invidious" @@ -1028,7 +1028,7 @@ post "/login" do |env| if user if !user.password - error_message = translate(locale, "Please sign in using 'Sign in with Google'") + error_message = translate(locale, "Please sign in using 'Log in with Google'") next templated "error" end @@ -1050,7 +1050,7 @@ post "/login" do |env| secure: secure, http_only: true) end else - error_message = translate(locale, "Invalid username or password") + error_message = translate(locale, "Wrong username or password") next templated "error" end @@ -1111,7 +1111,7 @@ post "/login" do |env| found_valid_captcha = false - error_message = translate(locale, "Invalid CAPTCHA") + error_message = translate(locale, "Erroneous CAPTCHA") tokens.each_with_index do |token, i| begin validate_request(token, answer, env.request, HMAC_KEY, PG_DB, locale) diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 645ca2a8..e1d8604d 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -319,7 +319,7 @@ def template_youtube_comments(comments, locale, thin_mode)

#{child["contentHtml"]}

#{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64), locale))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""} | - [YT] + [YT] | #{number_with_separator(child["likeCount"])} END_HTML diff --git a/src/invidious/helpers/tokens.cr b/src/invidious/helpers/tokens.cr index 6841127a..ba41cba3 100644 --- a/src/invidious/helpers/tokens.cr +++ b/src/invidious/helpers/tokens.cr @@ -81,14 +81,14 @@ def validate_request(token, session, request, key, db, locale = nil) end if token["session"] != session - raise translate(locale, "Invalid token") + raise translate(locale, "Erroneous token") end if token["nonce"]? && (nonce = db.query_one?("SELECT * FROM nonces WHERE nonce = $1", token["nonce"], as: {String, Time})) if nonce[1] > Time.now db.exec("UPDATE nonces SET expire = $1 WHERE nonce = $2", Time.new(1990, 1, 1), nonce[0]) else - raise translate(locale, "Invalid token") + raise translate(locale, "Erroneous token") end end diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr index 73c9ac69..1279486e 100644 --- a/src/invidious/playlists.cr +++ b/src/invidious/playlists.cr @@ -49,7 +49,7 @@ def fetch_playlist_videos(plid, page, video_count, continuation = nil, locale = response = client.get(url) response = JSON.parse(response.body) if !response["content_html"]? || response["content_html"].as_s.empty? - raise translate(locale, "Playlist is empty") + raise translate(locale, "Empty playlist") end document = XML.parse_html(response["content_html"].as_s) @@ -174,7 +174,7 @@ def fetch_playlist(plid, locale) response = client.get("/playlist?list=#{plid}&hl=en&disable_polymer=1") if response.status_code != 200 - raise translate(locale, "Invalid playlist.") + raise translate(locale, "Not a playlist.") end body = response.body.gsub(/]+>]+>\s*less\s*]+>\n<\/span><\/button>/, "") diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 2ad6cdaa..3bd30af5 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -67,7 +67,7 @@ CAPTION_LANGUAGES = { "Marathi", "Mongolian", "Nepali", - "Norwegian", + "Norwegian Bokmål", "Nyanja", "Pashto", "Persian", diff --git a/src/invidious/views/login.ecr b/src/invidious/views/login.ecr index f6a131f9..3acb2501 100644 --- a/src/invidious/views/login.ecr +++ b/src/invidious/views/login.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= translate(locale, "Login") %> - Invidious +<%= translate(locale, "Log in") %> - Invidious <% end %>
@@ -9,12 +9,12 @@ @@ -88,8 +88,8 @@ <% if email %> <% else %> - - "> + + "> <% end %> <% if password %> diff --git a/src/invidious/views/preferences.ecr b/src/invidious/views/preferences.ecr index 3984a4ab..1af53488 100644 --- a/src/invidious/views/preferences.ecr +++ b/src/invidious/views/preferences.ecr @@ -214,7 +214,7 @@ function update_value(element) {
diff --git a/src/invidious/views/subscription_manager.ecr b/src/invidious/views/subscription_manager.ecr index 54fbb70e..ad572968 100644 --- a/src/invidious/views/subscription_manager.ecr +++ b/src/invidious/views/subscription_manager.ecr @@ -15,7 +15,7 @@
diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 89780ef7..1b8fc292 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -72,7 +72,7 @@
" method="post"> "> - "> + ">
@@ -94,7 +94,7 @@ <% if config.login_enabled %> <% end %> diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index accbca52..fb5186c5 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -55,7 +55,7 @@