mirror of
https://gh.llkk.cc/https://github.com/WeblateOrg/language-data.git
synced 2025-10-04 15:12:29 +08:00
20 lines
526 B
Python
Executable file
20 lines
526 B
Python
Executable file
#! /usr/bin/env python3
|
|
#
|
|
# Copyright © 2018 Michal Čihař <michal@cihar.com>
|
|
#
|
|
# This file is part of Weblate <https://weblate.org/>
|
|
#
|
|
|
|
from xml.etree import ElementTree
|
|
import pprint
|
|
|
|
result = {}
|
|
|
|
tree = ElementTree.parse("cldr-core/common/supplemental/plurals.xml")
|
|
for item in tree.iter("pluralRules"):
|
|
locales = item.get("locales").split()
|
|
rules = [x.get("count") for x in item.iter("pluralRule") if "@integer" in x.text]
|
|
for locale in locales:
|
|
result[locale] = rules
|
|
|
|
print(pprint.pformat(result))
|