|
|
@ -131,15 +131,14 @@ def translate_count(locale : String, key : String, count : Int, format = NumberF
|
|
|
|
|
|
|
|
|
|
|
|
if LOCALES[locale].has_key?(key + singular_suffix)
|
|
|
|
if LOCALES[locale].has_key?(key + singular_suffix)
|
|
|
|
translation = LOCALES[locale][key + singular_suffix].as_s
|
|
|
|
translation = LOCALES[locale][key + singular_suffix].as_s
|
|
|
|
|
|
|
|
elsif locale != "en-US"
|
|
|
|
|
|
|
|
# Try #2: Fallback to english
|
|
|
|
|
|
|
|
translation = translate_count("en-US", key, count)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
# Try #2: Fallback to english (or return key we're already in english)
|
|
|
|
# Return key if we're already in english, as the tranlation is missing
|
|
|
|
if locale == "en-US"
|
|
|
|
|
|
|
|
LOGGER.warn("i18n: Missing translation key \"#{key}\"")
|
|
|
|
LOGGER.warn("i18n: Missing translation key \"#{key}\"")
|
|
|
|
return key
|
|
|
|
return key
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
translation = translate_count("en-US", key, count)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
case format
|
|
|
|
case format
|
|
|
|