Hi, El día 17 de marzo de 2012 15:04, <callka...@gmail.com> escribió: > From: Pootle daemon <poo...@pootle.sugarlabs.org> > > expenses with no category specified are displayed as "Unknown" > fix to SL#3097 > --- > budgetscreen.py | 6 +++++- > chartscreen.py | 6 +++++- > po/da.po | 8 ++++---- > 3 files changed, 14 insertions(+), 6 deletions(-) > > diff --git a/budgetscreen.py b/budgetscreen.py > index 0e2cd98..045a002 100644 > --- a/budgetscreen.py > +++ b/budgetscreen.py > @@ -96,7 +96,11 @@ class BudgetScreen(gtk.VBox): > > # Build categories. > for c in self.sorted_categories: > - catbox = gtk.Label(c) > + # If there is no category, display as Unknown > + if c is '': > + catbox = gtk.Label('Unknown') > + else: > + catbox = gtk.Label(c) > catbox.set_padding(10, 0)
You can use gettext to make the "Unknown" label translatable. See in the imports at the top of the file you have: from gettext import gettext as _ The you can do: catbox = gtk.Label(_('Unknown')) > > color = finance.get_category_color_str(c) > diff --git a/chartscreen.py b/chartscreen.py > index 129be9b..fec333c 100644 > --- a/chartscreen.py > +++ b/chartscreen.py > @@ -90,7 +90,11 @@ class ChartScreen(gtk.HBox): > hbox = gtk.HBox() > > catlabel = gtk.Label() > - catlabel.set_markup(c) > + # If there is no category, display as Unknown > + if c is '': > + catlabel.set_markup('Unknown') > + else: > + catlabel.set_markup(c) > catgroup.add_widget(catlabel) Same here. Also I see some trailing whitespacen in both files, would be great to remove them to satisfy PEP8, in a separate patch. Great to see you revisiting the trac. Cheers, > > color = finance.get_category_color_str(c) > diff --git a/po/da.po b/po/da.po > index 12a7c34..a325b80 100644 > --- a/po/da.po > +++ b/po/da.po > @@ -7,15 +7,15 @@ msgstr "" > "Project-Id-Version: PACKAGE VERSION\n" > "Report-Msgid-Bugs-To: \n" > "POT-Creation-Date: 2011-08-08 08:54-0300\n" > -"PO-Revision-Date: 2011-04-08 03:26+0200\n" > -"Last-Translator: Aputsiaq <a...@isit.gl>\n" > +"PO-Revision-Date: 2012-03-09 11:45+0200\n" > +"Last-Translator: Aputsiaq Niels <a...@isit.gl>\n" > "Language-Team: LANGUAGE <l...@li.org>\n" > -"Language: \n" > +"Language: da\n" > "MIME-Version: 1.0\n" > "Content-Type: text/plain; charset=UTF-8\n" > "Content-Transfer-Encoding: 8bit\n" > "Plural-Forms: nplurals=2; plural=(n != 1);\n" > -"X-Generator: Pootle 2.0.1\n" > +"X-Generator: Pootle 2.0.5\n" > > #: activity/activity.info:2 finance.py:100 > msgid "Finance" > -- > 1.7.7.6 > > _______________________________________________ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel -- .. manuq .. _______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel