diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-05-28 00:48:06 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-05-28 00:49:31 +0100 |
| commit | 5f8250c029d342ebb670deff6007fb044dd4a38d (patch) | |
| tree | ddb907d122782f29736ba98010f2e4a1ed3fbaa8 /hacks | |
| parent | 0a36c87b86695758b661cbef4ae9cc89ef948820 (diff) | |
Use pofilter to check i18n and fix some .po file glitches.
Forward-ported from fe6de8b48ff0a40e229c06932ac5fd497322f208 in master.
Diffstat (limited to 'hacks')
| -rw-r--r-- | hacks/check_i18n | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/hacks/check_i18n b/hacks/check_i18n index b07c0ad17..d0c7edee8 100644 --- a/hacks/check_i18n +++ b/hacks/check_i18n @@ -1,17 +1,15 @@ -#!/usr/bin/python3 +#!/bin/bash -import os +mkdir -p errors -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) +pofilter -i src/lib/po -o errors/lib --nofuzzy \ + -t escapes -t nplurals -t printf -t pythonbraceformat -t variables -t xmltags \ + -t accelerators + +pofilter -i src/wx/po -o errors/wx --nofuzzy \ + -t escapes -t nplurals -t printf -t pythonbraceformat -t variables -t xmltags \ + -t accelerators + +pofilter -i src/tools/po -o errors/tools --nofuzzy \ + -t escapes -t nplurals -t printf -t pythonbraceformat -t variables -t xmltags \ + -t accelerators |
