-
Notifications
You must be signed in to change notification settings - Fork 42
/
update.sh
executable file
·52 lines (38 loc) · 1.39 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
DIST="https://raw.githubusercontent.com/openstreetmap/id-tagging-schema/main/dist"
# Download presets
presets=(preset_categories
preset_defaults
fields
presets)
for preset in ${presets[*]}; do
echo $preset
curl -fLsS $DIST/$preset.min.json > $preset.json
done
# Download NSI presets
curl -fLsS --output nsi_presets.json https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/presets/nsi-id-presets.min.json
# Download NSI geojsons for features
curl -fLsS --output nsi_geojson.json https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/featureCollection.min.json
# Download address formats
curl -fLsS https://raw.githubusercontent.com/openstreetmap/iD/develop/data/address_formats.json > address_formats.json
# Download country borders
curl -fLsS https://raw.githubusercontent.com/rapideditor/country-coder/main/src/data/borders.json > borders.json
git add *.json
# Download translation files
# python script to extract languages that are at least 30% translated
GET_LANGS=$(cat <<EOF
import sys, json
dict=json.load(sys.stdin)
for index,(k,v) in enumerate(dict.items()):
pct=v['pct']
if pct >= 0.3:
print(k)
EOF
)
languages=$(curl -fLsS $DIST/translations/index.json |
python3 -c "$GET_LANGS")
for lang in ${languages[*]}; do
echo $lang
curl -fLsS $DIST/translations/$lang.min.json > translations/$lang.json
done
git add translations/*.json