From a1d64c63a7623c1b866c867a09681317031bb066 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 1 Sep 2005 22:24:39 +0000 Subject: [PATCH] * src/PeopleView.py: replace unique string with one already translated * src/gramps_main.py: replace unique string with one already translated * src/plugins/Ancestors.py: replace unique string with one already translated * src/plugins/Eval.py: replace unique string with one already translated * src/plugins/WriteCD.py: replace unique string with one already translated * src/po/check_po: produce a sorted list of used text strings, split strings better svn: r5165 --- gramps2/ChangeLog | 7 +++++++ gramps2/src/PeopleView.py | 2 +- gramps2/src/gramps_main.py | 8 ++++---- gramps2/src/plugins/Ancestors.py | 4 ++-- gramps2/src/plugins/Eval.py | 4 ++-- gramps2/src/plugins/WriteCD.py | 9 ++++++--- gramps2/src/po/check_po | 25 ++++++++++++++++++++----- 7 files changed, 42 insertions(+), 17 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 5fa538458..873dad643 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,11 @@ 2005-09-01 Don Allingham + * src/PeopleView.py: replace unique string with one already translated + * src/gramps_main.py: replace unique string with one already translated + * src/plugins/Ancestors.py: replace unique string with one already translated + * src/plugins/Eval.py: replace unique string with one already translated + * src/plugins/WriteCD.py: replace unique string with one already translated + * src/po/check_po: produce a sorted list of used text strings, + split strings better * src/ImageSelect.py: Local edit of a media Note type now brings up the Note editor instead of the media editor. * src/plugins/Verify.py: don't complain about difference in diff --git a/gramps2/src/PeopleView.py b/gramps2/src/PeopleView.py index 50a6422fb..dc2e9fba3 100644 --- a/gramps2/src/PeopleView.py +++ b/gramps2/src/PeopleView.py @@ -65,7 +65,7 @@ column_names = [ _('Death Place'), _('Spouse'), _('Last Change'), - _('Cause of Death'), + _('Cause of death'), ] #------------------------------------------------------------------------- diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 9139b9209..d66cc2803 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -1084,7 +1084,7 @@ class Gramps(GrampsDBCallback.GrampsDBCallback): mlist = self.people_view.get_selected_objects() if len(mlist) != 2: - msg = _("Cannot merge people.") + msg = _("Cannot merge people") msg2 = _("Exactly two people must be selected to perform a merge. " "A second person can be selected by holding down the " "control key while clicking on the desired person.") @@ -1096,7 +1096,7 @@ class Gramps(GrampsDBCallback.GrampsDBCallback): if p1 and p2: merger = MergePeople.MergePeopleUI(self.db,p1,p2,self.merge_update) else: - msg = _("Cannot merge people.") + msg = _("Cannot merge people") msg2 = _("Exactly two people must be selected to perform a merge. " "A second person can be selected by holding down the " "control key while clicking on the desired person.") @@ -1114,7 +1114,7 @@ class Gramps(GrampsDBCallback.GrampsDBCallback): mlist = self.people_view.get_selected_objects() if len(mlist) != 2: - msg = _("Cannot merge people.") + msg = _("Cannot merge people") msg2 = _("Exactly two people must be selected to perform a merge. " "A second person can be selected by holding down the " "control key while clicking on the desired person.") @@ -1126,7 +1126,7 @@ class Gramps(GrampsDBCallback.GrampsDBCallback): if p1 and p2: merger = MergePeople.Compare(self.db,p1,p2,self.merge_update) else: - msg = _("Cannot merge people.") + msg = _("Cannot merge people") msg2 = _("Exactly two people must be selected to perform a merge. " "A second person can be selected by holding down the " "control key while clicking on the desired person.") diff --git a/gramps2/src/plugins/Ancestors.py b/gramps2/src/plugins/Ancestors.py index 8d8b5dc6e..45bb41a81 100644 --- a/gramps2/src/plugins/Ancestors.py +++ b/gramps2/src/plugins/Ancestors.py @@ -810,8 +810,8 @@ class ComprehensiveAncestorsReport (Report.Report): if (len (event_handles) + len (addresses) + len (names)) > 0: paras.append ((self.doc.start_paragraph, ['AR-SubEntry'])) paras.append ((self.doc.write_text, - [_("More about %(name)s:") % - {'name': self.first_name_or_nick (person)}])) + [_("More about %(person_name)s:") % + {'person_name': self.first_name_or_nick (person)}])) paras.append ((self.doc.end_paragraph, [])) for name in names: diff --git a/gramps2/src/plugins/Eval.py b/gramps2/src/plugins/Eval.py index d64757876..58dbb6975 100644 --- a/gramps2/src/plugins/Eval.py +++ b/gramps2/src/plugins/Eval.py @@ -79,7 +79,7 @@ class EvalWindow: }) Utils.set_titles(self.top,self.glade.get_widget('title'), - _("Python Evaluation Window")) + _("Python evaluation window")) self.add_itself_to_menu() self.top.show() @@ -93,7 +93,7 @@ class EvalWindow: def add_itself_to_menu(self): self.parent.child_windows[self.win_key] = self - self.parent_menu_item = gtk.MenuItem(_('Python Evaluation Window')) + self.parent_menu_item = gtk.MenuItem(_('Python evaluation window')) self.parent_menu_item.connect("activate",self.present) self.parent_menu_item.show() self.parent.winsmenu.append(self.parent_menu_item) diff --git a/gramps2/src/plugins/WriteCD.py b/gramps2/src/plugins/WriteCD.py index a849f6928..477fca88b 100644 --- a/gramps2/src/plugins/WriteCD.py +++ b/gramps2/src/plugins/WriteCD.py @@ -103,8 +103,9 @@ class PackageWriter: "1 %s " % str(msg)) return except: + uri_name = "burn:///" + base QuestionDialog.ErrorDialog("CD export preparation failed", - 'Could not create burn:///%s' % base) + 'Could not create %s' % uri_name) return try: @@ -148,8 +149,9 @@ class PackageWriter: "File already exists") return except: + uri_name = "burn:///" + base QuestionDialog.ErrorDialog(_("CD export preparation failed"), - _('Could not create burn:///%s') % base) + _('Could not create %s') % uri_name) return try: @@ -160,8 +162,9 @@ class PackageWriter: "4 %s " % str(msg)) return except: + uri_name = "burn:///" + base + "/.thumb" QuestionDialog.ErrorDialog(_("CD export preparation failed"), - _('Could not create burn:///%s/.thumb') % base) + _('Could not create %s') % uri_name) return #-------------------------------------------------------- diff --git a/gramps2/src/po/check_po b/gramps2/src/po/check_po index 4116e992e..5a4fa5b5d 100755 --- a/gramps2/src/po/check_po +++ b/gramps2/src/po/check_po @@ -14,6 +14,13 @@ all_named_s = {} all_bnamed_s = {} all_coverage = {} + +def strip_quotes(st): + if len(st.strip()) > 2: + return st.strip()[1:-1] + else: + return "" + args = sys.argv while len(args) > 1: args = args[1:] @@ -31,20 +38,21 @@ while len(args) > 1: if mode == NONE: if len(data) > 0 and data[0] == "msgid": mode = MSGID - - current_msgid = data[1].split('"')[1] + if len(data) > 1: + current_msgid = strip_quotes(data[1]) elif mode == MSGID: if data[0][0] == '"': - current_msgid += line.split('"')[1] + current_msgid += strip_quotes(line) elif data[0] == "msgstr": mode = MSGSTR - current_msgstr = data[1].split('"')[1] + if len(data) > 1: + current_msgstr = strip_quotes(data[1]) elif mode == MSGSTR: if line == "" or line[0] == "#": mode = NONE string_map[current_msgid] = current_msgstr elif len(data) > 0 and data[0][0] == '"': - current_msgstr += line.split('"')[1] + current_msgstr += strip_quotes(line) f.close() @@ -133,3 +141,10 @@ if len(sys.argv) > 2: all_named_s[pofile], all_bnamed_s[pofile], all_coverage[pofile]) + +f = open("used_strings.txt","w") +keys = string_map.keys() +keys.sort() +for i in keys: + f.write(i + "\n") +f.close()