language-data/export-cldr
Michal Čihař 9812558e7d Apply black code formatter
Signed-off-by: Michal Čihař <michal@cihar.com>
2019-04-17 10:56:26 +02:00

20 lines
491 B
Python
Executable file

#! /usr/bin/env python3
import json
import os
os.system(
"./modules/cldr-to-gettext-plural-rules/bin/export-plural-rules --reduce=no --output=cldr.json json"
)
with open("cldr.json", "rb") as handle:
LANGUAGES = json.load(handle)
os.unlink("cldr.json")
with open("cldr.csv", "w") as handle:
for code in sorted(LANGUAGES):
data = LANGUAGES[code]
handle.write(
"{};{};{};{}\n".format(code, data["name"], data["plurals"], data["formula"])
)