mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-02-22 16:36:49 +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:
@@ -2,7 +2,7 @@
|
||||
|
||||
module Invidious::Routes::Search
|
||||
def self.opensearch(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
locale = env.get("preferences").as(Preferences).locale
|
||||
env.response.content_type = "application/opensearchdescription+xml"
|
||||
|
||||
XML.build(indent: " ", encoding: "UTF-8") do |xml|
|
||||
@@ -18,7 +18,7 @@ module Invidious::Routes::Search
|
||||
end
|
||||
|
||||
def self.results(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
locale = env.get("preferences").as(Preferences).locale
|
||||
|
||||
query = env.params.query["search_query"]?
|
||||
query ||= env.params.query["q"]?
|
||||
@@ -37,7 +37,7 @@ module Invidious::Routes::Search
|
||||
end
|
||||
|
||||
def self.search(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
locale = env.get("preferences").as(Preferences).locale
|
||||
region = env.params.query["region"]?
|
||||
|
||||
query = env.params.query["search_query"]?
|
||||
|
||||
Reference in New Issue
Block a user