diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-03-19 22:45:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-03-19 22:45:46 +0100 |
| commit | 9591b7486b0d56b7bc938f18a93e6d3a373e9d40 (patch) | |
| tree | 48a63b8adacb962dca27e28850ddf3a3d1044430 /scripts | |
| parent | 546094a102b8c59f9d801a62f7e6ecaec736370f (diff) | |
Add DCNC tags file.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/update-language-subtags | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/update-language-subtags b/scripts/update-language-subtags index 979d8168..874a6dc7 100755 --- a/scripts/update-language-subtags +++ b/scripts/update-language-subtags @@ -2,6 +2,7 @@ import os import urllib.request +import json block = {} lists = {} @@ -33,3 +34,10 @@ for k, v in lists.items(): print(e[0], file=f) print(e[1], file=f) + +with urllib.request.urlopen('https://registry.isdcf.com/languages') as f, open(os.path.join('tags', 'dcnc'), 'w') as g: + js = json.loads(f.read()) + for d in js['data']: + if 'dcncTag' in d: + print(d['rfc5646Tag'], file=g) + print(d['dcncTag'], file=g) |
