Invidious is an alternative front-end to YouTube
Fix translation with non-existent locales
Omar Roth7596baf03b71
diff --git a/src/invidious/helpers/i18n.cr b/src/invidious/helpers/i18n.crindex e79004d9..ec44604f 100644--- a/src/invidious/helpers/i18n.cr+++ b/src/invidious/helpers/i18n.cr@@ -3,15 +3,11 @@ def load_locale(name)enddef translate(locale : Hash(String, JSON::Any) | Nil, translation : String, text : String | Nil = nil)- if !locale- return translation- end-# if !locale[translation]?# puts "Could not find translation for #{translation}"# end- if locale[translation]? && !locale[translation].as_s.empty?+ if locale && locale[translation]? && !locale[translation].as_s.empty?translation = locale[translation].as_send