summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-06-12 20:51:44 +0200
committerCarl Hetherington <cth@carlh.net>2021-06-12 20:51:44 +0200
commit50346ba0cc0ae68d3093256dcf66fce6d4ec587f (patch)
treefcacd9050d702ae09caa272125c3c67caf8c596c /scripts
parenta5bd2e9eeecccb1a64aa7f3ae936698fce78bea5 (diff)
Fix update-language-subtags to include all descriptions for a particular code.
This avoids, e.g. "nl" being labelled as only Flemish and not also Dutch.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-language-subtags7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/update-language-subtags b/scripts/update-language-subtags
index 874a6dc7..3ea53572 100755
--- a/scripts/update-language-subtags
+++ b/scripts/update-language-subtags
@@ -25,7 +25,12 @@ with urllib.request.urlopen('https://www.iana.org/assignments/language-subtag-re
else:
p = l.strip().decode('utf-8').split(':')
if len(p) > 1:
- block[p[0]] = p[1][1:]
+ key = p[0]
+ value = p[1][1:]
+ if key == 'Description' and key in block:
+ block[key] = '/'.join([block[key], value])
+ else:
+ block[key] = value
for k, v in lists.items():
with open(os.path.join('tags', k), 'w') as f: