summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/i18n.cr4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/invidious/helpers/i18n.cr b/src/invidious/helpers/i18n.cr
index ab959c13..6e29b498 100644
--- a/src/invidious/helpers/i18n.cr
+++ b/src/invidious/helpers/i18n.cr
@@ -65,9 +65,11 @@ def load_all_locales
end
def translate(locale : String?, key : String, text : String | Nil = nil) : String
- # Log a warning if "key" doesn't exist in en-US locale
+ # Log a warning if "key" doesn't exist in en-US locale and return
+ # that key as the text, so this is more or less transparent to the user.
if !LOCALES["en-US"].has_key?(key)
LOGGER.warn("i18n: Missing translation key \"#{key}\"")
+ return key
end
# Default to english, whenever the locale doesn't exist,