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_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)

View File

@ -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)
#-------------------------------------------------------------------------

View File

@ -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()

View File

@ -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):
"""

View File

@ -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"

View File

@ -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.")
)

View File

@ -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()

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1517,8 +1517,8 @@ class BasePage(object):
center_person.handle, "ppl", self.up)
person_name = self.get_name(center_person)
msg += _('<br />Created for <a href = "%s">%s</a>') % (
center_person_url, person_name)
msg += _('<br />Created for <a href = "%(url)s">%(name)s</a>') % {
'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: