From 471ec72966a08fe5e61fb1085357af0d5cd36f3e Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Mon, 17 Mar 2014 08:03:23 -0700 Subject: [PATCH] 7276: translate some punctuation marks -- partial --- gramps/gen/lib/name.py | 17 ++++++++++++----- gramps/gen/plug/report/utils.py | 3 ++- gramps/plugins/textreport/detancestralreport.py | 3 ++- .../plugins/textreport/detdescendantreport.py | 3 ++- gramps/plugins/textreport/indivcomplete.py | 6 ++++-- gramps/plugins/tool/verify.py | 9 ++++++--- po/POTFILES.in | 1 + po/POTFILES.skip | 1 - 8 files changed, 29 insertions(+), 14 deletions(-) diff --git a/gramps/gen/lib/name.py b/gramps/gen/lib/name.py index 01451dd8c..a1b024331 100644 --- a/gramps/gen/lib/name.py +++ b/gramps/gen/lib/name.py @@ -40,6 +40,8 @@ from .datebase import DateBase from .surnamebase import SurnameBase from .nametype import NameType from .const import IDENTICAL, EQUAL, DIFFERENT +from gramps.gen.const import GRAMPS_LOCALE as glocale +_ = glocale.translation.gettext #------------------------------------------------------------------------- # @@ -463,9 +465,11 @@ class Name(SecondaryObject, PrivacyBase, SurnameBase, CitationBase, NoteBase, first = self.first_name surname = self.get_surname() if self.suffix: - return "%s, %s %s" % (surname, first, self.suffix) + # translators: needed for Arabic, ignore otherwise + return _("%s, %s %s") % (surname, first, self.suffix) else: - return "%s, %s" % (surname, first) + # translators: needed for Arabic, ignore otherwise + return _("%s, %s") % (surname, first) def get_upper_name(self): """ @@ -475,9 +479,11 @@ class Name(SecondaryObject, PrivacyBase, SurnameBase, CitationBase, NoteBase, first = self.first_name surname = self.get_surname().upper() if self.suffix: - return "%s, %s %s" % (surname, first, self.suffix) + # translators: needed for Arabic, ignore otherwise + return _("%s, %s %s") % (surname, first, self.suffix) else: - return "%s, %s" % (surname, first) + # translators: needed for Arabic, ignore otherwise + return _("%s, %s") % (surname, first) def get_regular_name(self): """ @@ -489,7 +495,8 @@ class Name(SecondaryObject, PrivacyBase, SurnameBase, CitationBase, NoteBase, if (self.suffix == ""): return "%s %s" % (first, surname) else: - return "%s %s, %s" % (first, surname, self.suffix) + # translators: needed for Arabic, ignore otherwise + return _("%s %s, %s") % (first, surname, self.suffix) def get_gedcom_parts(self): """ diff --git a/gramps/gen/plug/report/utils.py b/gramps/gen/plug/report/utils.py index 98d46f5fa..4c3511f6b 100644 --- a/gramps/gen/plug/report/utils.py +++ b/gramps/gen/plug/report/utils.py @@ -232,7 +232,8 @@ def get_address_str(addr): if str == "": str = info else: - str = "%s, %s" % (str, info) + # translators: needed for Arabic, ignore otherwise + str = _("%s, %s") % (str, info) return str #------------------------------------------------------------------------- diff --git a/gramps/plugins/textreport/detancestralreport.py b/gramps/plugins/textreport/detancestralreport.py index 1343d1d91..fbb17e5f6 100644 --- a/gramps/plugins/textreport/detancestralreport.py +++ b/gramps/plugins/textreport/detancestralreport.py @@ -374,7 +374,8 @@ class DetAncestorReport(Report): date = addr.get_date_object().get_year() if date: - self.doc.write_text( '%s, ' % date ) + # translators: needed for Arabic, ignore otherwise + self.doc.write_text(self._('%s, ') % date ) self.doc.write_text( text ) self.doc.write_text_citation( self.endnotes(addr) ) self.doc.end_paragraph() diff --git a/gramps/plugins/textreport/detdescendantreport.py b/gramps/plugins/textreport/detdescendantreport.py index cc3f2f2b7..f0a2aa2c5 100644 --- a/gramps/plugins/textreport/detdescendantreport.py +++ b/gramps/plugins/textreport/detdescendantreport.py @@ -826,7 +826,8 @@ class DetDescendantReport(Report): self.doc.write_text(self._('Address: ')) if date: - self.doc.write_text( '%s, ' % date ) + # translators: needed for Arabic, ignore otherwise + self.doc.write_text(self._('%s, ') % date ) self.doc.write_text( text ) self.doc.write_text_citation( self.endnotes(addr) ) self.doc.end_paragraph() diff --git a/gramps/plugins/textreport/indivcomplete.py b/gramps/plugins/textreport/indivcomplete.py index f98139e06..6afc211fa 100644 --- a/gramps/plugins/textreport/indivcomplete.py +++ b/gramps/plugins/textreport/indivcomplete.py @@ -162,11 +162,13 @@ class IndivCompleteReport(Report): column_1 = self._(self._get_type(event.get_type())) if role not in (EventRoleType.PRIMARY, EventRoleType.FAMILY): column_1 = column_1 + ' (' + self._(role.xml_str()) + ')' - column_2 = combine('%s, %s', '%s', description, date_place) + # translators: needed for Arabic, ignore otherwise + column_2 = combine(self._('%s, %s'), '%s', description, date_place) else: # Groups with a single type (remove event type from first column) column_1 = date - column_2 = combine('%s, %s', '%s', description, place) + # translators: needed for Arabic, ignore otherwise + column_2 = combine(self._('%s, %s'), '%s', description, place) endnotes = "" if self.use_srcs: diff --git a/gramps/plugins/tool/verify.py b/gramps/plugins/tool/verify.py index aa794c802..4ef272f3b 100644 --- a/gramps/plugins/tool/verify.py +++ b/gramps/plugins/tool/verify.py @@ -274,11 +274,14 @@ class Verify(tool.Tool, ManagedWindow, UpdateCallback): # print data for the user, no GUI (msg,gramps_id, name, the_type, rule_id, severity, handle) = results if severity == Rule.WARNING: - print("W: %s, %s: %s, %s" % (msg,the_type, gramps_id, name)) + # translators: needed for Arabic, ignore otherwise + print(_("W: %s, %s: %s, %s") % (msg, the_type, gramps_id, name)) elif severity == Rule.ERROR: - print("E: %s, %s: %s, %s" % (msg,the_type,gramps_id, name)) + # translators: needed for Arabic, ignore otherwise + print(_("E: %s, %s: %s, %s") % (msg, the_type, gramps_id, name)) else: - print("S: %s, %s: %s, %s" % (msg,the_type,gramps_id, name)) + # translators: needed for Arabic, ignore otherwise + print(_("S: %s, %s: %s, %s") % (msg, the_type,gramps_id, name)) def init_gui(self): # Draw dialog and make it handle everything diff --git a/po/POTFILES.in b/po/POTFILES.in index bf6603a55..4da1b2d43 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -282,6 +282,7 @@ gramps/gen/lib/familyreltype.py gramps/gen/lib/grampstype.py gramps/gen/lib/ldsord.py gramps/gen/lib/markertype.py +gramps/gen/lib/name.py gramps/gen/lib/nameorigintype.py gramps/gen/lib/nametype.py gramps/gen/lib/notetype.py diff --git a/po/POTFILES.skip b/po/POTFILES.skip index 967f5c7e0..a0cdfed41 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -144,7 +144,6 @@ gramps/gen/lib/locationbase.py gramps/gen/lib/mediaobj.py gramps/gen/lib/mediabase.py gramps/gen/lib/mediaref.py -gramps/gen/lib/name.py gramps/gen/lib/note.py gramps/gen/lib/notebase.py gramps/gen/lib/personref.py