Encapsulate translation constants and functions inside it's own module (#5637)

It encapsulates all related code from translation into it's own module.

Required for the migration to the crystal stdlib logger: https://github.com/iv-org/invidious/pull/5426
This commit is contained in:
Fijxu
2026-04-25 16:55:55 -04:00
committed by GitHub
parent 54365c0e2a
commit bc64cd9b67
54 changed files with 562 additions and 558 deletions

View File

@@ -37,7 +37,7 @@ module Invidious::Routes::Feeds
if CONFIG.popular_enabled
templated "feeds/popular"
else
message = translate(locale, "The Popular feed has been disabled by the administrator.")
message = I18n.translate(locale, "The Popular feed has been disabled by the administrator.")
templated "message"
end
end
@@ -259,7 +259,7 @@ module Invidious::Routes::Feeds
xml.element("link", "type": "text/html", rel: "alternate", href: "#{HOST_URL}/feed/subscriptions")
xml.element("link", "type": "application/atom+xml", rel: "self",
href: "#{HOST_URL}#{env.request.resource}")
xml.element("title") { xml.text translate(locale, "Invidious Private Feed for `x`", user.email) }
xml.element("title") { xml.text I18n.translate(locale, "Invidious Private Feed for `x`", user.email) }
(notifications + videos).each do |video|
video.to_xml(locale, params, xml)