[Libreoffice-commits] .: l10ntools/scripts
Miklos Vajna
vmiklos at kemper.freedesktop.org
Thu Oct 6 07:36:23 PDT 2011
l10ntools/scripts/po2lo | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 551a13f54e3e0f69d243b50db4f1b442ecce059a
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Thu Oct 6 16:31:41 2011 +0200
Give better error message on invalid sdf input
diff --git a/l10ntools/scripts/po2lo b/l10ntools/scripts/po2lo
index 969f3ea..a815739 100755
--- a/l10ntools/scripts/po2lo
+++ b/l10ntools/scripts/po2lo
@@ -52,9 +52,14 @@ class Entry:
self.keys = []
# 10..13 are translation types
for idx in range(10, 14):
- if len(self.items[idx]):
- t = {10:'text', 12:'quickhelptext', 13:'title'}[idx]
- self.keys.append((idx, self.sdf2po("%s#%s.%s%s" % (path[-1], self.items[4], prefix, t))))
+ try:
+ if len(self.items[idx]):
+ t = {10:'text', 12:'quickhelptext', 13:'title'}[idx]
+ self.keys.append((idx, self.sdf2po("%s#%s.%s%s" % (path[-1], self.items[4], prefix, t))))
+ except IndexError:
+ print("Tried to access field #%d in sdf file, but no such column! Broken sdf file?" % idx)
+ print("Fields: %s" % self.items)
+ sys.exit(1)
def translate(self, translations):
"""Translates text in the entry based on translations."""
More information about the Libreoffice-commits
mailing list