Open marselmustafin opened 1 month ago
I do not think there is any such behaviour available today. It will only translate the missing keys. Do you think any translation API supports something like this? E.g. returning all the needed pluralisation keys based on one key?
@davidwessman no, I never faced with such ready-made API. We have been using Lokalise for a long time and they provided us with these keys, but afaik they use real people for that.
In i18n-tasks
project there's a plural
mode exists for missing
task which shows all missed plural keys for non-en locales like ar
, ru
, etc. But translate-missing
provides only 1-to-1 keys translation. Even adding of few
/many
keys to en didn't help because the translation engine google
/openai
is not aware of context of the number and it gives wrong translation.
I think it would be awesome to upgrade translate-missing
task to add translations for plurals as well. As an idea we could pass some number related to the key like few
: 2, many
: 5 to the translation request and then replace it with %{count}
again.
Yes, that would be interesting to try out. Send translate for multiple plural-keys and see if they are different
Seems like it would be pretty complex rules to set this up: https://guides.rubyonrails.org/i18n.html#locale-specific-rules https://cldr.unicode.org/index/cldr-spec/plural-rules https://www.unicode.org/cldr/charts/45/supplemental/language_plural_rules.html
I have such keys in my base
en
locale:When I translate it to other languages with
translate-missing
I have the same keys everywhere. E.g. in Russian:But I would like to have more values included in locales that require more pluralization keys, expected result for Russian:
Is it possible to achieve this result currently? Or it requires additional feature implementation?