6086: minor improvements on translation strings (part1)

svn: r20546
This commit is contained in:
Jérôme Rapinat 2012-10-09 08:53:47 +00:00
parent 0ccc4e1b09
commit 11aadc005d
12 changed files with 40 additions and 39 deletions

View File

@ -129,9 +129,9 @@ class PersonSidebarFilter(SidebarFilter):
self.add_text_entry(_('ID'), self.filter_id) self.add_text_entry(_('ID'), self.filter_id)
self.add_entry(_('Gender'), self.filter_gender) self.add_entry(_('Gender'), self.filter_gender)
self.add_text_entry(_('Birth date'), self.filter_birth, 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, 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_entry(_('Event'), self.etype)
self.add_text_entry(_('Note'), self.filter_note) self.add_text_entry(_('Note'), self.filter_note)
self.add_entry(_('Tag'), self.tag) self.add_entry(_('Tag'), self.tag)

View File

@ -60,12 +60,13 @@ from gi.repository import GObject
MIN_PYGOBJECT_VERSION = (3, 3, 2) MIN_PYGOBJECT_VERSION = (3, 3, 2)
if not GObject.pygobject_version >= MIN_PYGOBJECT_VERSION : if not GObject.pygobject_version >= MIN_PYGOBJECT_VERSION :
print (_("Your pygobject version does not meet the " 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" " start Gramps with a GUI.\n\n"
"Gramps will terminate now.") % ( "Gramps will terminate now.") %
MIN_PYGOBJECT_VERSION[0], {'major':MIN_PYGOBJECT_VERSION[0],
MIN_PYGOBJECT_VERSION[1], 'bug':MIN_PYGOBJECT_VERSION[1],
MIN_PYGOBJECT_VERSION[2])) 'minor':MIN_PYGOBJECT_VERSION[2]})
sys.exit(0) sys.exit(0)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -466,7 +466,7 @@ class EditExifMetadata(Gramplet):
self.exif_widgets["ImageSize"].show() self.exif_widgets["ImageSize"].show()
width, height = self.plugin_image.dimensions width, height = self.plugin_image.dimensions
self.exif_widgets["ImageSize"].set_text(_("Image " 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 # check for thumbnails
has_thumb = self.__check4thumbnails() has_thumb = self.__check4thumbnails()

View File

@ -97,8 +97,8 @@ class Notes(Gramplet):
note_handle = self.note_list[self.current] note_handle = self.note_list[self.current]
note = self.dbstate.db.get_note_from_handle(note_handle) note = self.dbstate.db.get_note_from_handle(note_handle)
self.texteditor.set_text(note.get_styledtext()) self.texteditor.set_text(note.get_styledtext())
self.page.set_text(_('%d of %d') % (self.current + 1, self.page.set_text(_('%(current)d of %(total)d') % {'current': self.current + 1,
len(self.note_list))) 'total': len(self.note_list)})
def left_clicked(self, button): def left_clicked(self, button):
""" """

View File

@ -316,12 +316,12 @@ class ImportInfo(object):
txt += key2string[key] % self.data_newobject[self.key2data[key]] txt += key2string[key] % self.data_newobject[self.key2data[key]]
if any(self.data_unknownobject): if any(self.data_unknownobject):
txt += _("\n The imported file was not self-contained.\n" 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" "their typifying attribute was set to 'Unknown'.\n"
"The breakdown per category is depicted by the\n" "The breakdown per category is depicted by the\n"
"number in parentheses. Where possible these\n" "number in parentheses. Where possible these\n"
"'Unkown' objects are referenced by note %s.\n" "'Unkown' objects are referenced by note %(unknown)s.\n"
) % (sum(self.data_unknownobject), self.expl_note) ) % {'new': sum(self.data_unknownobject), 'unknown': self.expl_note}
if self.data_relpath: if self.data_relpath:
txt += _("\nMedia objects with relative paths have been\n" txt += _("\nMedia objects with relative paths have been\n"
"imported. These paths are considered relative to\n" "imported. These paths are considered relative to\n"

View File

@ -3056,11 +3056,11 @@ class GedcomParser(UpdateCallback):
if self.missing_references: if self.missing_references:
self.dbase.commit_note(self.explanation, self.trans, time.time()) self.dbase.commit_note(self.explanation, self.trans, time.time())
txt = _("\nThe imported file was not self-contained.\n" 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" "their typifying attribute was set to 'Unknown'.\n"
"Where possible these 'Unknown' objects are \n" "Where possible these 'Unknown' objects are \n"
"referenced by note %s.\n" "referenced by note %(unknown)s.\n"
) % (self.missing_references, self.explanation.gramps_id) ) % {'new': self.missing_references, 'unknown': self.explanation.gramps_id}
self.__add_msg(txt) self.__add_msg(txt)
self.number_of_errors -= 1 self.number_of_errors -= 1
@ -6743,9 +6743,9 @@ class GedcomParser(UpdateCallback):
if self.genby.upper() == "LEGACY": if self.genby.upper() == "LEGACY":
fname = os.path.basename(self.filename) fname = os.path.basename(self.filename)
WarningDialog( 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!") "could cause errors in the resulting database!")
% (fname, self.genby), % {'filename': fname, 'by': self.genby),
_("Look for nameless events.") _("Look for nameless events.")
) )

View File

@ -570,8 +570,8 @@ class DetDescendantReport(Report):
if mate_handle in self.dnumber: if mate_handle in self.dnumber:
self.doc.start_paragraph('DDR-MoreDetails') self.doc.start_paragraph('DDR-MoreDetails')
self.doc.write_text_citation( self.doc.write_text_citation(
self._("Ref: %s. %s") % self._("Ref: %(number)s. %(name)s") %
(self.dnumber[mate_handle], name)) {'number': self.dnumber[mate_handle], 'name': name})
self.doc.end_paragraph() self.doc.end_paragraph()
else: else:
self.dmates[mate_handle] = person.get_handle() self.dmates[mate_handle] = person.get_handle()

View File

@ -218,13 +218,13 @@ class PlaceReport(Report):
person = self.database.get_person_from_handle(p_handle) person = self.database.get_person_from_handle(p_handle)
if person: if person:
if people == "": if people == "":
people = "%s (%s)" \ people = "%(name)s (%(id)s)" \
% (_nd.display(person), % {'name': _nd.display(person),
person.get_gramps_id()) 'id': person.get_gramps_id()}
else: else:
people = _("%s and %s (%s)") \ people = _("%(persons)s and %(name)s (%(id)s)") \
% (people, _nd.display(person), % {'persons': people, 'name': _nd.display(person),
person.get_gramps_id()) 'id': person.get_gramps_id()}
event_details = [date, event_type, people, descr] event_details = [date, event_type, people, descr]
self.doc.start_row() self.doc.start_row()

View File

@ -542,13 +542,13 @@ class GeoFamClose(GeoGraphyView):
handle = fam.get_father_handle() handle = fam.get_father_handle()
father = dbstate.db.get_person_from_handle(handle) father = dbstate.db.get_person_from_handle(handle)
if father: if father:
comment = _("Father : %s : %s") % ( father.gramps_id, comment = _("Father : %(id)s : %(name)s") % {'id': father.gramps_id,
_nd.display(father) ) 'name': _nd.display(father)}
self._createmap_for_one_person(father, color, place_list, reference) self._createmap_for_one_person(father, color, place_list, reference)
handle = fam.get_mother_handle() handle = fam.get_mother_handle()
mother = dbstate.db.get_person_from_handle(handle) mother = dbstate.db.get_person_from_handle(handle)
if mother: if mother:
comment = _("Mother : %s : %s") % ( mother.gramps_id, comment = _("Mother : %(id)s : %(name)s") % ( mother.gramps_id,
_nd.display(mother) ) _nd.display(mother) )
self._createmap_for_one_person(mother, color, place_list, reference) self._createmap_for_one_person(mother, color, place_list, reference)
index = 0 index = 0

View File

@ -323,15 +323,15 @@ class GeoFamily(GeoGraphyView):
handle = fam.get_father_handle() handle = fam.get_father_handle()
father = dbstate.db.get_person_from_handle(handle) father = dbstate.db.get_person_from_handle(handle)
if father: if father:
comment = _("Father : %s : %s") % ( father.gramps_id, comment = _("Father : %(id)s : %(name)s") % {'id': father.gramps_id,
_nd.display(father) ) 'name': _nd.display(father) }
self._createpersonmarkers(dbstate, father, self._createpersonmarkers(dbstate, father,
comment, family_id) comment, family_id)
handle = fam.get_mother_handle() handle = fam.get_mother_handle()
mother = dbstate.db.get_person_from_handle(handle) mother = dbstate.db.get_person_from_handle(handle)
if mother: if mother:
comment = _("Mother : %s : %s") % ( mother.gramps_id, comment = _("Mother : %(id)s : %(name)s") % {'id': mother.gramps_id,
_nd.display(mother) ) 'name': _nd.display(mother) }
self._createpersonmarkers(dbstate, mother, self._createpersonmarkers(dbstate, mother,
comment, family_id) comment, family_id)
index = 0 index = 0

View File

@ -1201,9 +1201,9 @@ class RelationshipView(NavigationView):
'deathdate' : ddate 'deathdate' : ddate
} }
elif bdate: elif bdate:
value = _("%s %s") % (birth.type.get_abbreviation(), bdate) value = _("%(event)s %(date)s") % {'event': birth.type.get_abbreviation(), 'date': bdate}
elif ddate: elif ddate:
value = _("%s %s") % (death.type.get_abbreviation(), ddate) value = _("%(event)s %(date)s") % {'event': death.type.get_abbreviation(), 'date': ddate}
else: else:
value = "" value = ""
return value return value

View File

@ -1517,8 +1517,8 @@ class BasePage(object):
center_person.handle, "ppl", self.up) center_person.handle, "ppl", self.up)
person_name = self.get_name(center_person) person_name = self.get_name(center_person)
msg += _('<br />Created for <a href = "%s">%s</a>') % ( msg += _('<br />Created for <a href = "%(url)s">%(name)s</a>') % {
center_person_url, person_name) 'url': center_person_url, 'name': person_name}
# creation author # creation author
footer += Html("p", msg, id = 'createdate') footer += Html("p", msg, id = 'createdate')
@ -6983,8 +6983,8 @@ class NavWebReport(Report):
elif not os.path.isdir(dir_name): elif not os.path.isdir(dir_name):
parent_dir = os.path.dirname(dir_name) parent_dir = os.path.dirname(dir_name)
if not os.path.isdir(parent_dir): if not os.path.isdir(parent_dir):
msg = _("Neither %s nor %s are directories") % \ msg = _("Neither %(current)s nor %(parent)s are directories") % \
(dir_name, parent_dir) {'current': dir_name, 'parent': parent_dir}
self.user.notify_error(msg) self.user.notify_error(msg)
return return
else: else: