Fix to translate strings for international use

This commit is contained in:
prculley 2016-09-27 09:48:15 -05:00
parent be6e71cd04
commit 2aa0d5aac8

View File

@ -223,7 +223,7 @@ class VCardParser:
if problem != "": if problem != "":
self.number_of_errors += 1 self.number_of_errors += 1
if line: if line:
message = "Line %5d: %s\n" % (line, problem, ) message = _("Line") + " %5d: %s\n" % (line, problem, )
else: else:
message = problem + "\n" message = problem + "\n"
self.errors.append(message) self.errors.append(message)
@ -315,7 +315,7 @@ class VCardParser:
# Included cause VCards made by Gramps have this prop. # Included cause VCards made by Gramps have this prop.
pass pass
else: else:
self.__add_msg("Token >%s< unknown. line skipped: %s" % self.__add_msg(_("Token >%s< unknown. line skipped: %s") %
(fields[0], line), self.line_num-1) (fields[0], line), self.line_num-1)
def finish_person(self): def finish_person(self):
@ -329,8 +329,8 @@ class VCardParser:
"""A VCard for another person is started.""" """A VCard for another person is started."""
if self.person is not None: if self.person is not None:
self.finish_person() self.finish_person()
self.__add_msg("BEGIN property not properly closed by END " self.__add_msg(_("BEGIN property not properly closed by END "
"property, Gramps can't cope with nested VCards.", "property, Gramps can't cope with nested VCards."),
self.line_num-1) self.line_num-1)
self.person = Person() self.person = Person()
self.formatted_name = '' self.formatted_name = ''
@ -360,17 +360,17 @@ class VCardParser:
Returns True on success, False on failure. Returns True on success, False on failure.
""" """
if not self.name_parts.strip(): if not self.name_parts.strip():
self.__add_msg("VCard is malformed missing the compulsory N " self.__add_msg(_("VCard is malformed missing the compulsory N "
"property, so there is no name; skip it.", "property, so there is no name; skip it."),
self.line_num-1) self.line_num-1)
return False return False
if not self.formatted_name: if not self.formatted_name:
self.__add_msg("VCard is malformed missing the compulsory FN " self.__add_msg(_("VCard is malformed missing the compulsory FN "
"property, get name from N alone.", self.line_num-1) "property, get name from N alone."), self.line_num-1)
data_fields = self.split_unescaped(self.name_parts, ';') data_fields = self.split_unescaped(self.name_parts, ';')
if len(data_fields) != 5: if len(data_fields) != 5:
self.__add_msg("VCard is malformed wrong number of name " self.__add_msg(_("VCard is malformed wrong number of name "
"components.", self.line_num-1) "components."), self.line_num-1)
name = Name() name = Name()
name.set_type(NameType(NameType.BIRTH)) name.set_type(NameType(NameType.BIRTH))