let get_translated_value failsafe translation plural_number =
match (translation, plural_number) with
((Singular (_,str)), 0) ->
str
| ((Singular (_,str)), x) ->
fail_or_continue failsafe
(MoInvalidTranslationSingular(str,x))
str
| ((Plural (str,str_plural,[])),x) ->
if x = 0 then
str
else
str_plural
| ((Plural (_,_,lst)), x) when x < List.length lst ->
List.nth lst x
| ((Plural (_,_,lst)), x) ->
fail_or_continue failsafe
(MoInvalidTranslationPlural(lst,x))
List.nth lst 0