mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-19 03:18:50 +00:00
i18n: pass only the ISO code string to 'translate()'
Don't use the whole Hash everywhere. Also fall back nicely to english string if no translation exists.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
module Invidious::Routes::Misc
|
||||
def self.home(env)
|
||||
preferences = env.get("preferences").as(Preferences)
|
||||
locale = LOCALES[preferences.locale]?
|
||||
locale = preferences.locale
|
||||
user = env.get? "user"
|
||||
|
||||
case preferences.default_home
|
||||
@@ -29,12 +29,12 @@ module Invidious::Routes::Misc
|
||||
end
|
||||
|
||||
def self.privacy(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
locale = env.get("preferences").as(Preferences).locale
|
||||
templated "privacy"
|
||||
end
|
||||
|
||||
def self.licenses(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
locale = env.get("preferences").as(Preferences).locale
|
||||
rendered "licenses"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user