Sort plurals forms in CLDR order

Instead of alphabetical, sort these in the expect CLDR order
zero...other

Only sort when retreiving the values for formatter consumption, this
should leave Twine files in their default order.

Signed-off-by: Dwayne Bailey <dwayne@translatehouse.co.uk>
This commit is contained in:
Dwayne Bailey 2024-08-13 14:05:47 +01:00 committed by Alexander Borsuk
parent a9a97d19c5
commit 860c79f3a6

View file

@ -58,7 +58,7 @@ module Twine
def plural_translation_for_lang(lang)
if @plural_translations.has_key? lang
@plural_translations[lang].dup
@plural_translations[lang].dup.sort_by { |key,_| TwineDefinition::PLURAL_KEYS.index(key) }.to_h
end
end