From 11aadc005deb55197ba8c61aa0a9e4633b654f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Tue, 9 Oct 2012 08:53:47 +0000 Subject: [PATCH] 6086: minor improvements on translation strings (part1) svn: r20546 --- gramps/gui/filters/sidebar/_personsidebarfilter.py | 4 ++-- gramps/gui/grampsgui.py | 11 ++++++----- gramps/plugins/gramplet/editexifmetadata.py | 2 +- gramps/plugins/gramplet/notes.py | 4 ++-- gramps/plugins/import/importxml.py | 6 +++--- gramps/plugins/lib/libgedcom.py | 10 +++++----- gramps/plugins/textreport/detdescendantreport.py | 4 ++-- gramps/plugins/textreport/placereport.py | 12 ++++++------ gramps/plugins/view/geofamclose.py | 6 +++--- gramps/plugins/view/geofamily.py | 8 ++++---- gramps/plugins/view/relview.py | 4 ++-- gramps/plugins/webreport/narrativeweb.py | 8 ++++---- 12 files changed, 40 insertions(+), 39 deletions(-) diff --git a/gramps/gui/filters/sidebar/_personsidebarfilter.py b/gramps/gui/filters/sidebar/_personsidebarfilter.py index 87329278a..be02bccc8 100644 --- a/gramps/gui/filters/sidebar/_personsidebarfilter.py +++ b/gramps/gui/filters/sidebar/_personsidebarfilter.py @@ -129,9 +129,9 @@ class PersonSidebarFilter(SidebarFilter): self.add_text_entry(_('ID'), self.filter_id) self.add_entry(_('Gender'), self.filter_gender) self.add_text_entry(_('Birth date'), self.filter_birth, - _('example: "%s" or "%s"') % (msg1, msg2)) + _('example: "%(msg1)s" or "%(msg2)s"') % {'msg1':msg1, 'msg2':msg2}) self.add_text_entry(_('Death date'), self.filter_death, - _('example: "%s" or "%s"') % (msg1, msg2)) + _('example: "%(msg1)s" or "%(msg2)s"') % {'msg1':msg1, 'msg2':msg2}) self.add_entry(_('Event'), self.etype) self.add_text_entry(_('Note'), self.filter_note) self.add_entry(_('Tag'), self.tag) diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py index 9f3f6c81b..55834f045 100644 --- a/gramps/gui/grampsgui.py +++ b/gramps/gui/grampsgui.py @@ -60,12 +60,13 @@ from gi.repository import GObject MIN_PYGOBJECT_VERSION = (3, 3, 2) if not GObject.pygobject_version >= MIN_PYGOBJECT_VERSION : print (_("Your pygobject version does not meet the " - "requirements. At least pygobject %d.%d.%d is needed to" + "requirements. At least pygobject " + "%(major)d.%(bug)d.%(minor)d is needed to" " start Gramps with a GUI.\n\n" - "Gramps will terminate now.") % ( - MIN_PYGOBJECT_VERSION[0], - MIN_PYGOBJECT_VERSION[1], - MIN_PYGOBJECT_VERSION[2])) + "Gramps will terminate now.") % + {'major':MIN_PYGOBJECT_VERSION[0], + 'bug':MIN_PYGOBJECT_VERSION[1], + 'minor':MIN_PYGOBJECT_VERSION[2]}) sys.exit(0) #------------------------------------------------------------------------- diff --git a/gramps/plugins/gramplet/editexifmetadata.py b/gramps/plugins/gramplet/editexifmetadata.py index 72445f657..987944c28 100644 --- a/gramps/plugins/gramplet/editexifmetadata.py +++ b/gramps/plugins/gramplet/editexifmetadata.py @@ -466,7 +466,7 @@ class EditExifMetadata(Gramplet): self.exif_widgets["ImageSize"].show() width, height = self.plugin_image.dimensions self.exif_widgets["ImageSize"].set_text(_("Image " - "Size : %04d x %04d pixels") % (width, height) ) + "Size : %04(width)d x %04(height)d pixels") % {'width':width, 'height':height}) # check for thumbnails has_thumb = self.__check4thumbnails() diff --git a/gramps/plugins/gramplet/notes.py b/gramps/plugins/gramplet/notes.py index 3b147c0ff..6ece6d83a 100644 --- a/gramps/plugins/gramplet/notes.py +++ b/gramps/plugins/gramplet/notes.py @@ -97,8 +97,8 @@ class Notes(Gramplet): note_handle = self.note_list[self.current] note = self.dbstate.db.get_note_from_handle(note_handle) self.texteditor.set_text(note.get_styledtext()) - self.page.set_text(_('%d of %d') % (self.current + 1, - len(self.note_list))) + self.page.set_text(_('%(current)d of %(total)d') % {'current': self.current + 1, + 'total': len(self.note_list)}) def left_clicked(self, button): """ diff --git a/gramps/plugins/import/importxml.py b/gramps/plugins/import/importxml.py index 0a6ce347e..d81b9ae48 100644 --- a/gramps/plugins/import/importxml.py +++ b/gramps/plugins/import/importxml.py @@ -316,12 +316,12 @@ class ImportInfo(object): txt += key2string[key] % self.data_newobject[self.key2data[key]] if any(self.data_unknownobject): txt += _("\n The imported file was not self-contained.\n" - "To correct for that, %d objects were created and\n" + "To correct for that, %(new)d objects were created and\n" "their typifying attribute was set to 'Unknown'.\n" "The breakdown per category is depicted by the\n" "number in parentheses. Where possible these\n" - "'Unkown' objects are referenced by note %s.\n" - ) % (sum(self.data_unknownobject), self.expl_note) + "'Unkown' objects are referenced by note %(unknown)s.\n" + ) % {'new': sum(self.data_unknownobject), 'unknown': self.expl_note} if self.data_relpath: txt += _("\nMedia objects with relative paths have been\n" "imported. These paths are considered relative to\n" diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index b811e7f83..9e3f4a18c 100644 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -3056,11 +3056,11 @@ class GedcomParser(UpdateCallback): if self.missing_references: self.dbase.commit_note(self.explanation, self.trans, time.time()) txt = _("\nThe imported file was not self-contained.\n" - "To correct for that, %d objects were created and\n" + "To correct for that, %(new)d objects were created and\n" "their typifying attribute was set to 'Unknown'.\n" "Where possible these 'Unknown' objects are \n" - "referenced by note %s.\n" - ) % (self.missing_references, self.explanation.gramps_id) + "referenced by note %(unknown)s.\n" + ) % {'new': self.missing_references, 'unknown': self.explanation.gramps_id} self.__add_msg(txt) self.number_of_errors -= 1 @@ -6743,9 +6743,9 @@ class GedcomParser(UpdateCallback): if self.genby.upper() == "LEGACY": fname = os.path.basename(self.filename) WarningDialog( - _("Import of GEDCOM file %s with DEST=%s, " + _("Import of GEDCOM file %(filename)s with DEST=%(by)s, " "could cause errors in the resulting database!") - % (fname, self.genby), + % {'filename': fname, 'by': self.genby), _("Look for nameless events.") ) diff --git a/gramps/plugins/textreport/detdescendantreport.py b/gramps/plugins/textreport/detdescendantreport.py index 817d3ea86..24b6d3fe6 100644 --- a/gramps/plugins/textreport/detdescendantreport.py +++ b/gramps/plugins/textreport/detdescendantreport.py @@ -570,8 +570,8 @@ class DetDescendantReport(Report): if mate_handle in self.dnumber: self.doc.start_paragraph('DDR-MoreDetails') self.doc.write_text_citation( - self._("Ref: %s. %s") % - (self.dnumber[mate_handle], name)) + self._("Ref: %(number)s. %(name)s") % + {'number': self.dnumber[mate_handle], 'name': name}) self.doc.end_paragraph() else: self.dmates[mate_handle] = person.get_handle() diff --git a/gramps/plugins/textreport/placereport.py b/gramps/plugins/textreport/placereport.py index 4fee8ddee..ac0bf7ed7 100644 --- a/gramps/plugins/textreport/placereport.py +++ b/gramps/plugins/textreport/placereport.py @@ -218,13 +218,13 @@ class PlaceReport(Report): person = self.database.get_person_from_handle(p_handle) if person: if people == "": - people = "%s (%s)" \ - % (_nd.display(person), - person.get_gramps_id()) + people = "%(name)s (%(id)s)" \ + % {'name': _nd.display(person), + 'id': person.get_gramps_id()} else: - people = _("%s and %s (%s)") \ - % (people, _nd.display(person), - person.get_gramps_id()) + people = _("%(persons)s and %(name)s (%(id)s)") \ + % {'persons': people, 'name': _nd.display(person), + 'id': person.get_gramps_id()} event_details = [date, event_type, people, descr] self.doc.start_row() diff --git a/gramps/plugins/view/geofamclose.py b/gramps/plugins/view/geofamclose.py index 74d7de90f..1a21d024c 100644 --- a/gramps/plugins/view/geofamclose.py +++ b/gramps/plugins/view/geofamclose.py @@ -542,13 +542,13 @@ class GeoFamClose(GeoGraphyView): handle = fam.get_father_handle() father = dbstate.db.get_person_from_handle(handle) if father: - comment = _("Father : %s : %s") % ( father.gramps_id, - _nd.display(father) ) + comment = _("Father : %(id)s : %(name)s") % {'id': father.gramps_id, + 'name': _nd.display(father)} self._createmap_for_one_person(father, color, place_list, reference) handle = fam.get_mother_handle() mother = dbstate.db.get_person_from_handle(handle) if mother: - comment = _("Mother : %s : %s") % ( mother.gramps_id, + comment = _("Mother : %(id)s : %(name)s") % ( mother.gramps_id, _nd.display(mother) ) self._createmap_for_one_person(mother, color, place_list, reference) index = 0 diff --git a/gramps/plugins/view/geofamily.py b/gramps/plugins/view/geofamily.py index 1a8f85962..cbd72e6fd 100644 --- a/gramps/plugins/view/geofamily.py +++ b/gramps/plugins/view/geofamily.py @@ -323,15 +323,15 @@ class GeoFamily(GeoGraphyView): handle = fam.get_father_handle() father = dbstate.db.get_person_from_handle(handle) if father: - comment = _("Father : %s : %s") % ( father.gramps_id, - _nd.display(father) ) + comment = _("Father : %(id)s : %(name)s") % {'id': father.gramps_id, + 'name': _nd.display(father) } self._createpersonmarkers(dbstate, father, comment, family_id) handle = fam.get_mother_handle() mother = dbstate.db.get_person_from_handle(handle) if mother: - comment = _("Mother : %s : %s") % ( mother.gramps_id, - _nd.display(mother) ) + comment = _("Mother : %(id)s : %(name)s") % {'id': mother.gramps_id, + 'name': _nd.display(mother) } self._createpersonmarkers(dbstate, mother, comment, family_id) index = 0 diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index 5b8c71684..50da15e64 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -1201,9 +1201,9 @@ class RelationshipView(NavigationView): 'deathdate' : ddate } elif bdate: - value = _("%s %s") % (birth.type.get_abbreviation(), bdate) + value = _("%(event)s %(date)s") % {'event': birth.type.get_abbreviation(), 'date': bdate} elif ddate: - value = _("%s %s") % (death.type.get_abbreviation(), ddate) + value = _("%(event)s %(date)s") % {'event': death.type.get_abbreviation(), 'date': ddate} else: value = "" return value diff --git a/gramps/plugins/webreport/narrativeweb.py b/gramps/plugins/webreport/narrativeweb.py index fbde87f50..d8bf78ce0 100644 --- a/gramps/plugins/webreport/narrativeweb.py +++ b/gramps/plugins/webreport/narrativeweb.py @@ -1517,8 +1517,8 @@ class BasePage(object): center_person.handle, "ppl", self.up) person_name = self.get_name(center_person) - msg += _('
Created for %s') % ( - center_person_url, person_name) + msg += _('
Created for %(name)s') % { + 'url': center_person_url, 'name': person_name} # creation author footer += Html("p", msg, id = 'createdate') @@ -6983,8 +6983,8 @@ class NavWebReport(Report): elif not os.path.isdir(dir_name): parent_dir = os.path.dirname(dir_name) if not os.path.isdir(parent_dir): - msg = _("Neither %s nor %s are directories") % \ - (dir_name, parent_dir) + msg = _("Neither %(current)s nor %(parent)s are directories") % \ + {'current': dir_name, 'parent': parent_dir} self.user.notify_error(msg) return else: