summaryrefslogtreecommitdiff
path: root/hacks
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-05-27 23:50:37 +0100
committerCarl Hetherington <cth@carlh.net>2019-05-28 00:49:22 +0100
commit0a36c87b86695758b661cbef4ae9cc89ef948820 (patch)
tree1bd7ee5f80448fbe4c4e4563e3b31651cc8cd3fd /hacks
parent6980066a05f020e3b8c6d0db06ccbb18e01391e3 (diff)
Fix several bits of bad i18n markup and add start of checking script.
Forward-ported from ec9cb6719c72930243afc534120da12323e29568 in master.
Diffstat (limited to 'hacks')
-rw-r--r--hacks/check_i18n17
1 files changed, 17 insertions, 0 deletions
diff --git a/hacks/check_i18n b/hacks/check_i18n
new file mode 100644
index 000000000..b07c0ad17
--- /dev/null
+++ b/hacks/check_i18n
@@ -0,0 +1,17 @@
+#!/usr/bin/python3
+
+import os
+
+for (dirpath, dirs, files) in os.walk('.'):
+ for filename in files:
+ if filename.endswith('.po'):
+ with open(os.path.join(dirpath, filename), 'r') as f:
+ for l in f.readlines():
+ # Pango markup with corrupted quotation marks
+ if l.find('span') != -1 and (l.find('«') != -1 or l.find('“') != -1):
+ print(os.path.join(dirpath, filename))
+ print(l)
+ # Badly-spaced placeholders
+ if not l.find('%%') and (l.find('% 1') != -1 or l.find('% 2') != -1 or l.find('% s') != -1 or l.find('% d') != -1 or l.find('% f') != -1):
+ print(os.path.join(dirpath, filename))
+ print(l)