mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-16 09:58: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:
@@ -1,7 +1,7 @@
|
||||
module Invidious::Routes::API::V1::Misc
|
||||
# Stats API endpoint for Invidious
|
||||
def self.stats(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
locale = env.get("preferences").as(Preferences).locale
|
||||
env.response.content_type = "application/json"
|
||||
|
||||
if !CONFIG.statistics_enabled
|
||||
@@ -15,7 +15,7 @@ module Invidious::Routes::API::V1::Misc
|
||||
# user playlists and Invidious playlists. This means that we can't
|
||||
# reasonably split them yet. This should be addressed in APIv2
|
||||
def self.get_playlist(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
locale = env.get("preferences").as(Preferences).locale
|
||||
|
||||
env.response.content_type = "application/json"
|
||||
plid = env.params.url["plid"]
|
||||
@@ -84,7 +84,7 @@ module Invidious::Routes::API::V1::Misc
|
||||
end
|
||||
|
||||
def self.mixes(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
locale = env.get("preferences").as(Preferences).locale
|
||||
|
||||
env.response.content_type = "application/json"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user