mirror of
https://gh.llkk.cc/https://github.com/WeblateOrg/language-data.git
synced 2025-10-04 15:12:29 +08:00
20 lines
491 B
Python
Executable file
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"])
|
|
)
|