File size: 675 Bytes
9b0a8c5
 
 
 
 
 
 
 
 
 
 
1cfc9e8
 
 
9b0a8c5
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import json

meta = json.load(open("metadata.json", "r", encoding="utf-8"))
concepts = json.load(open("concepts.json", "r", encoding="utf-8"))

for country in concepts:
    if not country in meta:
        meta[country] = dict()
    for language in concepts[country]:
        if language not in meta[country]:
            meta[country][language] = meta["USA"]["English"]
        # FIXME: Remove this after we ask language leads to translate
        if not meta[country][language]["Description"].endswith(language):
            meta[country][language]["Description"] += f"in {language}"

with open("metadata.json", "w", encoding="utf-8") as f:
    json.dump(meta, f, indent=2)