aboutsummaryrefslogtreecommitdiff
path: root/contrib/qt_translations.py
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-11-10 13:01:40 -0500
committerGavin Andresen <gavinandresen@gmail.com>2011-11-10 13:01:40 -0500
commit6be6be2ed9d5d4b9dc1657d434a7fed3b3935f6f (patch)
tree4b303e5c69ceb5e4f5f39b15d36622fc76752c60 /contrib/qt_translations.py
parentba1fce94b5c11a8b91919c3d9d873bcf74e5f93a (diff)
Tool/process for including correct qt translations in mac .App
Diffstat (limited to 'contrib/qt_translations.py')
-rwxr-xr-xcontrib/qt_translations.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/contrib/qt_translations.py b/contrib/qt_translations.py
new file mode 100755
index 0000000000..fd8a8b7129
--- /dev/null
+++ b/contrib/qt_translations.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+# Helpful little script that spits out a comma-separated list of
+# language codes for Qt icons that should be included
+# in binary bitcoin distributions
+
+import glob
+import os
+import re
+import sys
+
+if len(sys.argv) != 3:
+ sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.argv[0])
+
+d1 = sys.argv[1]
+d2 = sys.argv[2]
+
+l1 = set([ re.search(r'qt_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d1, 'qt_*.qm')) ])
+l2 = set([ re.search(r'bitcoin_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d2, 'bitcoin_*.qm')) ])
+
+print ",".join(sorted(l1.intersection(l2)))
+