Language fixes (#366)

* Language fixes
This commit is contained in:
Allan Nordhøy
2019-04-19 18:14:11 +02:00
committed by Omar Roth
parent a5b8feca93
commit aa10a9d899
23 changed files with 337 additions and 339 deletions

View File

@ -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)

View File

@ -319,7 +319,7 @@ def template_youtube_comments(comments, locale, thin_mode)
<p style="white-space:pre-wrap">#{child["contentHtml"]}</p>
<span title="#{Time.unix(child["published"].as_i64).to_s(translate(locale, "%A %B %-d, %Y"))}">#{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64), locale))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""}</span>
|
<a href="https://www.youtube.com/watch?v=#{comments["videoId"]}&lc=#{child["commentId"]}" title="#{translate(locale, "Youtube permalink of the comment")}">[YT]</a>
<a href="https://www.youtube.com/watch?v=#{comments["videoId"]}&lc=#{child["commentId"]}" title="#{translate(locale, "YouTube comment permalink")}">[YT]</a>
|
<i class="icon ion-ios-thumbs-up"></i> #{number_with_separator(child["likeCount"])}
END_HTML

View File

@ -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

View File

@ -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(/<button[^>]+><span[^>]+>\s*less\s*<img[^>]+>\n<\/span><\/button>/, "")

View File

@ -67,7 +67,7 @@ CAPTION_LANGUAGES = {
"Marathi",
"Mongolian",
"Nepali",
"Norwegian",
"Norwegian Bokmål",
"Nyanja",
"Pashto",
"Persian",

View File

@ -1,5 +1,5 @@
<% content_for "header" do %>
<title><%= translate(locale, "Login") %> - Invidious</title>
<title><%= translate(locale, "Log in") %> - Invidious</title>
<% end %>
<div class="pure-g">
@ -9,12 +9,12 @@
<div class="pure-g">
<div class="pure-u-1-2">
<a class="pure-button <% if account_type == "invidious" %>pure-button-disabled<% end %>" href="/login?type=invidious">
<%= translate(locale, "Login/Register") %>
<%= translate(locale, "Log in/register") %>
</a>
</div>
<div class="pure-u-1-2">
<a class="pure-button <% if account_type == "google" %>pure-button-disabled<% end %>" href="/login?type=google">
<%= translate(locale, "Login to Google") %>
<%= translate(locale, "Log in with Google") %>
</a>
</div>
</div>
@ -88,8 +88,8 @@
<% if email %>
<input name="email" type="hidden" value="<%= email %>">
<% else %>
<label for="email"><%= translate(locale, "Email") %> :</label>
<input required class="pure-input-1" name="email" type="email" placeholder="<%= translate(locale, "Email") %>">
<label for="email"><%= translate(locale, "E-mail") %> :</label>
<input required class="pure-input-1" name="email" type="email" placeholder="<%= translate(locale, "E-mail") %>">
<% end %>
<% if password %>

View File

@ -214,7 +214,7 @@ function update_value(element) {
</div>
<div class="pure-control-group">
<a href="/data_control?referer=<%= URI.escape(referer) %>"><%= translate(locale, "Import/Export data") %></a>
<a href="/data_control?referer=<%= URI.escape(referer) %>"><%= translate(locale, "Import/export data") %></a>
</div>
<div class="pure-control-group">

View File

@ -15,7 +15,7 @@
</div>
<div class="pure-u-1-3" style="text-align:right">
<h3>
<a href="/data_control?referer=<%= referer %>"><%= translate(locale, "Import/Export") %></a>
<a href="/data_control?referer=<%= referer %>"><%= translate(locale, "Import/export") %></a>
</h3>
</div>
</div>

View File

@ -72,7 +72,7 @@
<form action="/signout?referer=<%= env.get?("current_page") %>" method="post">
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
<a class="pure-menu-heading" href="#">
<input style="all:unset" type="submit" value="<%= translate(locale, "Sign out") %>">
<input style="all:unset" type="submit" value="<%= translate(locale, "Log out") %>">
</a>
</form>
</div>
@ -94,7 +94,7 @@
<% if config.login_enabled %>
<div class="pure-u-1-3">
<a href="/login?referer=<%= env.get?("current_page") %>" class="pure-menu-heading">
<%= translate(locale, "Login") %>
<%= translate(locale, "Log in") %>
</a>
</div>
<% end %>

View File

@ -55,7 +55,7 @@
<div class="pure-g">
<div class="pure-u-1 pure-u-lg-1-5">
<div class="h-box">
<p><a href="https://www.youtube.com/watch?v=<%= video.id %>"><%= translate(locale, "Watch video on Youtube") %></a></p>
<p><a href="https://www.youtube.com/watch?v=<%= video.id %>"><%= translate(locale, "Watch on YouTube") %></a></p>
<% if CONFIG.dmca_content.includes? video.id %>
<p>Download is disabled.</p>
@ -146,7 +146,7 @@
<% else %>
<noscript>
<a href="/watch?<%= env.params.query %>&nojs=1">
<%= translate(locale, "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.") %>
<%= translate(locale, "Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.") %>
</a>
</noscript>
<% end %>