Add FrontlineSMS Czech translation, closes #280

This commit is contained in:
Disassembler 2018-12-07 16:51:48 +01:00
parent e58fc05a7d
commit bbf8219504
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
4 changed files with 2522 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -28,6 +28,16 @@ EOF
COPY lxc COPY lxc
RUN EOF
# Install Czech translation
cd /srv/frontlinesms/frontlinesms2/web-app/assets/i18n
gzip < frontlinesms-core_messages_cs.js > frontlinesms-core_messages_cs.js.gz
MD5=$(md5sum frontlinesms-core_messages_cs.js | cut -d' ' -f1)
cp frontlinesms-core_messages_cs.js frontlinesms-core_messages_cs-${MD5}.js
cp frontlinesms-core_messages_cs.js.gz frontlinesms-core_messages_cs-${MD5}.js.gz
chown 8018:8018 frontlinesms-core_messages_cs*
EOF
MOUNT DIR /srv/frontlinesms/data srv/frontlinesms/.frontlinesms2 MOUNT DIR /srv/frontlinesms/data srv/frontlinesms/.frontlinesms2
CMD s6-svscan /etc/services.d CMD s6-svscan /etc/services.d

View File

@ -0,0 +1,15 @@
#!/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())