mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-02-16 05:26:27 +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:
@@ -275,7 +275,7 @@ struct Video
|
||||
end
|
||||
end
|
||||
|
||||
def to_json(locale : Hash(String, JSON::Any) | Nil, json : JSON::Builder)
|
||||
def to_json(locale : String?, json : JSON::Builder)
|
||||
json.object do
|
||||
json.field "type", "video"
|
||||
|
||||
@@ -475,7 +475,7 @@ struct Video
|
||||
end
|
||||
|
||||
# TODO: remove the locale and follow the crystal convention
|
||||
def to_json(locale : Hash(String, JSON::Any) | Nil, _json : Nil)
|
||||
def to_json(locale : String?, _json : Nil)
|
||||
JSON.build { |json| to_json(locale, json) }
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user