FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Kubuntu User

 
 
LinkBack Thread Tools
 
Old 12-18-2008, 08:16 PM
David Cantrell
 
Default Catch exceptions from gettext.GNUTranslations

Report with po/*.mo file caused the exception and keep going. The
current failure is in po/tg.mo.
---
scripts/getlangnames.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/scripts/getlangnames.py b/scripts/getlangnames.py
index b81d26d..05b9805 100644
--- a/scripts/getlangnames.py
+++ b/scripts/getlangnames.py
@@ -32,7 +32,13 @@ for k in langs.localeInfo.keys():
f = open("po/%s.mo" %(l,))
except (OSError, IOError):
continue
- cat = gettext.GNUTranslations(f)
+
+ try:
+ cat = gettext.GNUTranslations(f)
+ except:
+ sys.stderr.write("*** ERROR reading po/%s.mo
" % (l,))
+ continue
+
cat.set_output_charset("utf-8")
names[langs.localeInfo[k][0]] = cat.lgettext(langs.localeInfo[k][0])
found = True
--
1.6.0.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-18-2008, 08:21 PM
Jeremy Katz
 
Default Catch exceptions from gettext.GNUTranslations

On Thu, 2008-12-18 at 11:16 -1000, David Cantrell wrote:
> Report with po/*.mo file caused the exception and keep going. The
> current failure is in po/tg.mo.

I'm pretty sure this will then lead to a runtime failure since we won't
have a native translation for the language name to show. Far better to
fail it at build time when it can be fixed.

I'll push a fixed po file (removing the plural-forms line since
apparently they don't use them for tg)

Jeremy

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-18-2008, 08:26 PM
David Cantrell
 
Default Catch exceptions from gettext.GNUTranslations

Jeremy Katz wrote:
> On Thu, 2008-12-18 at 11:16 -1000, David Cantrell wrote:
>> Report with po/*.mo file caused the exception and keep going. The
>> current failure is in po/tg.mo.
>
> I'm pretty sure this will then lead to a runtime failure since we won't
> have a native translation for the language name to show. Far better to
> fail it at build time when it can be fixed.
>
> I'll push a fixed po file (removing the plural-forms line since
> apparently they don't use them for tg)

Sounds good to me.

--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:48 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org