I'm using the Lingo package for my Vapor solution see : https://github.com/vapor-community/Lingo-Vapor and this has been working perfect for 3 languages
Now I need plurals for a popup I'm creating :
for i in stride(from: 1, to: 12, by: 1) {
if let description = lingo?.localize("lbl_hour_s", locale: language, interpolations: ["count" : i]) {
option = FormFieldStringOption(key:String(i), label: description)
} else {
option = FormFieldStringOption(key:String(i), label: String(i))
}
duration.options.append(option)
}
My Json files are configured like this :
for en_US
"lbl_hour_s" : {"one" : "1 hour", "other" : "%{count} hours"},
for nl_BE
"lbl_hour_s" : {"one" : "%{count} uur", "many" : "%{count} uren", "other" : "%{count} uren"},
(I tried with the extra 'many' in nl, but still getting the same error in both cases :
Missing pluralization rule for locale: en_US. Will default to other
rule.
Is there something wrong with this ? It looks the same as the example from the docs :
"unread.messages": {
"one": "You have one unread message.",
"other": "You have %{count} unread messages."
or do I need some extra configuration to Lingo ? (found nothing in the docs for it)
I found my problem. I was using 'en_US' as I wanted to provide more translations in the future. Apparently for USA English I should use 'en'.
Had the same problem with 'nl_BE' the Dutch (Nederlands) spoken language in Belgium. I wanted this as I'm also adding 'nl_NL', the dutch spoken language in Holland. Both are 95% the same but some words or sentences are different.