fix: qualify translate/LOCALES references after I18n module refactor

Upstream commit bc64cd9b moved translate / LOCALES into module I18n
(with extend self). The oidc-support branch added new call sites in
login.cr / login.ecr that used the old top-level names; the merge
auto-resolved textually but left the compiler with three undefined
references.

Wrap the new call sites the same way the rest of the codebase already
does: 'I18n.translate(...)' for views and 'I18n::LOCALES' for the
constant.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Alexandru Macocian
2026-05-22 15:09:45 +02:00
parent 8c92c73f1a
commit 62aec292c3
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -298,7 +298,7 @@ module Invidious::Routes::Login
end
if language_header = env.request.headers["Accept-Language"]?
if language = ANG.language_negotiator.best(language_header, LOCALES.keys)
if language = ANG.language_negotiator.best(language_header, I18n::LOCALES.keys)
user.preferences.locale = language.header
end
end
+2 -2
View File
@@ -7,7 +7,7 @@
<div class="pure-u-1 pure-u-lg-3-5">
<div class="h-box">
<% if CONFIG.auth_type.size > 1 && account_type.empty? %>
<h3><%= translate(locale, "Log in") %></h3>
<h3><%= I18n.translate(locale, "Log in") %></h3>
<p>Choose authentication method:</p>
<% if CONFIG.auth_internal_enabled? %>
<a href="/login?type=invidious&referer=<%= URI.encode_www_form(referer) %>" class="pure-button pure-button-primary" style="width: 100%; margin-bottom: 10px; display: block; text-align: center; text-decoration: none;">
@@ -22,7 +22,7 @@
<% else %>
<% case account_type when %>
<% when "oidc" %>
<h3><%= translate(locale, "Log in") %></h3>
<h3><%= I18n.translate(locale, "Log in") %></h3>
<p>Select an OIDC provider to log in:</p>
<% CONFIG.oidc.each do |provider_key, provider| %>
<form class="pure-form" action="/login?referer=<%= URI.encode_www_form(referer) %>&type=oidc" method="post">