Spotter-VM/_extra/frontlinesms-lang-js.py
Disassembler ce325cf3d0
Squashed commit of the following:
- Bump basic OS to Alpine 3.9
 - Restructure repo and add layer versioning
 - Use JSON for all metadata
 - Merge abuild branch (but without abuild)
2019-02-26 20:24:02 +01:00

16 lines
551 B
Python

#!/usr/bin/env python3
import gzip
import json
d = {}
with open('messages_cs.txt', 'r') as input, open('messages_cs.properties', 'w') as output:
for line in input.read().splitlines():
print(json.dumps(line)[1:-1], end='\n', file=output)
if line and not line.startswith('#'):
key,value = line.split('=', 1)
d[key] = value
with open('frontlinesms-core_messages_cs.js', 'wb') as f:
f.write('var i18nStrings = i18nStrings || {{}}; i18nStrings["frontlinesms-core"] = {};'.format(json.dumps(d)).encode())