diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-12-20 16:59:46 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-12-20 16:59:46 -0600 |
| commit | 7596baf03b7101ef8d0b92e3da5ec571d1f2b69f (patch) | |
| tree | 3bbd68cef175b1e4b74bcc560a6a90f356fbd91e | |
| parent | 0feb414a1df50a60cadbb7795761b4c55545cf1c (diff) | |
| download | invidious-7596baf03b7101ef8d0b92e3da5ec571d1f2b69f.tar.gz invidious-7596baf03b7101ef8d0b92e3da5ec571d1f2b69f.tar.bz2 invidious-7596baf03b7101ef8d0b92e3da5ec571d1f2b69f.zip | |
Fix translation with non-existent locales
| -rw-r--r-- | src/invidious/helpers/i18n.cr | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/invidious/helpers/i18n.cr b/src/invidious/helpers/i18n.cr index e79004d9..ec44604f 100644 --- a/src/invidious/helpers/i18n.cr +++ b/src/invidious/helpers/i18n.cr @@ -3,15 +3,11 @@ def load_locale(name) end def 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_s end |
