blob: 397d5be5f97b8dfc9f08e489b2845705134358be (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#!/bin/bash
LODIR=/home/timar/cp-5.1
LEAFLETDIR=/home/timar/online
for lang in `ls -1 $LODIR/translations/source`; do
echo -ne "{" > $lang.json
for unocommand in `grep -Pzo "(?s)^(\s*)\N*whitelist: .*?{.*?^\1}" $LEAFLETDIR/loleaflet/src/control/Control.ContextMenu.js | grep -Po "'.*?'" | tr -d "'" | sed -e "s/^/.uno:/"`;do grep -A4 $unocommand $LODIR/translations/source/$lang/officecfg/registry/data/org/openoffice/Office/UI.po | grep -P "msgid|msgstr" | tr -d "~" | sed -e "s/msgid //" -e "s/msgstr //";done | paste -d" " - - | sort | uniq | sed -e 's/" "/": "/' -e 's/$/, /' | grep -v '""' | tr -d "\n" | sed -e "s/, $//" >> $lang.json
echo -ne "}" >> $lang.json
done
|