summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2016-05-20 18:13:44 +0200
committerAndras Timar <andras.timar@collabora.com>2016-05-20 18:13:44 +0200
commitbd6ee3a8b6c91ead3f8545ed63dc13b4bd99dbd5 (patch)
treec03ae394445ffbaf10cb0db079dc0a31ae9739a4 /scripts
parent625de77dd38c3f89a3520b6b0f3c71e06e615306 (diff)
loleaflet: initial l10n support of context menus
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/unocommandsl10n.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/unocommandsl10n.sh b/scripts/unocommandsl10n.sh
new file mode 100755
index 000000000..945cf56ee
--- /dev/null
+++ b/scripts/unocommandsl10n.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+LODIR=/home/timar/cp-5.0
+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
+
+