mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Fix translation with non-existent locales
This commit is contained in:
parent
0feb414a1d
commit
7596baf03b
1 changed files with 1 additions and 5 deletions
|
@ -3,15 +3,11 @@ def load_locale(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def translate(locale : Hash(String, JSON::Any) | Nil, translation : String, text : String | Nil = nil)
|
def translate(locale : Hash(String, JSON::Any) | Nil, translation : String, text : String | Nil = nil)
|
||||||
if !locale
|
|
||||||
return translation
|
|
||||||
end
|
|
||||||
|
|
||||||
# if !locale[translation]?
|
# if !locale[translation]?
|
||||||
# puts "Could not find translation for #{translation}"
|
# puts "Could not find translation for #{translation}"
|
||||||
# end
|
# end
|
||||||
|
|
||||||
if locale[translation]? && !locale[translation].as_s.empty?
|
if locale && locale[translation]? && !locale[translation].as_s.empty?
|
||||||
translation = locale[translation].as_s
|
translation = locale[translation].as_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue