fix (Arabic) comma in some other translated-output reports

This commit is contained in:
Paul Franklin 2014-04-27 16:19:28 -07:00
parent a5d7532ba5
commit e8bfbc9050
16 changed files with 44 additions and 112 deletions

View File

@ -23,11 +23,17 @@
#-------------------------------------------------------------------------
#
# Report
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gramps.gen.utils.grampslocale import GrampsLocale
from gramps.gen.display.name import NameDisplay
#-------------------------------------------------------------------------
#
# Report
#
#-------------------------------------------------------------------------
class Report(object):
"""
The Report base class. This is a base class for generating
@ -66,6 +72,7 @@ class Report(object):
self._get_date = locale.get_date
self._get_type = locale.get_type
self._dd = locale.date_displayer
self._name_display = NameDisplay(locale) # a legacy/historical name
return locale
def write_report(self):

View File

@ -31,7 +31,6 @@ Timeline Chart
#
#------------------------------------------------------------------------
from __future__ import division
import copy
#------------------------------------------------------------------------
#
@ -51,7 +50,6 @@ from gramps.gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
FONT_SANS_SERIF, DASHED, PARA_ALIGN_CENTER,
IndexMark, INDEX_TYPE_TOC)
from gramps.gen.sort import Sort
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.config import config
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
@ -103,9 +101,9 @@ class TimeLine(Report):
menu = options.menu
self.filter = menu.get_option_by_name('filter').get_filter()
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
self._lang = options.menu.get_option_by_name('trans').get_value()
self.set_locale(self._lang)
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
@ -116,9 +114,6 @@ class TimeLine(Report):
self.sort_func = sort_functions[sort_func_num][1]
self.calendar = config.get('preferences.calendar-format-report')
self._lang = options.menu.get_option_by_name('trans').get_value()
self.set_locale(self._lang)
def write_report(self):
# Apply the filter
with self._user.progress(_('Timeline'),

View File

@ -34,7 +34,6 @@ Family Lines, a GraphViz-based plugin for Gramps.
#------------------------------------------------------------------------
from __future__ import unicode_literals
from functools import partial
import copy
#------------------------------------------------------------------------
#
@ -62,7 +61,6 @@ from gramps.gen.plug.menu import (NumberOption, ColorOption, BooleanOption,
EnumeratedListOption, PersonListOption,
SurnameColorOption)
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.utils.location import get_main_location
#------------------------------------------------------------------------
@ -353,16 +351,13 @@ class FamilyLinesReport(Report):
#option can be from another family tree, so person can be None
self._interest_set.add(person.get_handle())
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
lang = menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
lang = menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
# convert the 'surnamecolors' string to a dictionary of names and colors
self._surnamecolors = {}
tmp = get_value('surnamecolors')

View File

@ -30,7 +30,6 @@ Generate an hourglass graph using the GraphViz generator.
# python modules
#
#------------------------------------------------------------------------
import copy
#------------------------------------------------------------------------
#
@ -39,7 +38,6 @@ import copy
#------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.plug.menu import (PersonOption, BooleanOption, NumberOption,
EnumeratedListOption)
@ -109,15 +107,12 @@ class HourGlassReport(Report):
self.colors = filled
self.roundcorners = menu.get_option_by_name('roundcorners').get_value()
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
self.set_locale(menu.get_option_by_name('trans').get_value())
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
self.set_locale(menu.get_option_by_name('trans').get_value())
def write_report(self):
"""
Generate the report.

View File

@ -39,7 +39,6 @@ Create a relationship graph using Graphviz
#
#------------------------------------------------------------------------
from functools import partial
import copy
#------------------------------------------------------------------------
#
@ -55,7 +54,6 @@ from gramps.gen.plug.report import Report
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gen.plug.report import MenuReportOptions
from gramps.gen.plug.report import stdoptions
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.datehandler import get_date
from gramps.gen.lib import ChildRefType, EventRoleType, EventType
from gramps.gen.utils.file import media_path_full, find_file
@ -162,16 +160,13 @@ class RelGraphReport(Report):
filter_option = get_option_by_name('filter')
self._filter = filter_option.get_filter()
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
lang = menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
lang = menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
self.center_person = database.get_person_from_gramps_id(
get_value('pid'))
self.increlname = get_value('increlname')

View File

@ -29,7 +29,6 @@
#
#------------------------------------------------------------------------
import math
import copy
#------------------------------------------------------------------------
#
@ -38,7 +37,6 @@ import copy
#------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.lib import ChildRefType
from gramps.gen.plug.menu import (BooleanOption, NumberOption, PersonOption)
@ -102,16 +100,13 @@ class AncestorReport(Report):
if (self.center_person == None) :
raise ReportError(_("Person %s is not in the Database") % pid )
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
lang = menu.get_option_by_name('trans').get_value()
rlocale = self.set_locale(lang)
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
lang = menu.get_option_by_name('trans').get_value()
rlocale = self.set_locale(lang)
self.__narrator = Narrator(self.database, use_fulldate=True,
nlocale=rlocale)

View File

@ -26,7 +26,6 @@
# python modules
#
#------------------------------------------------------------------------
import copy
import datetime, time
#------------------------------------------------------------------------
@ -37,7 +36,6 @@ import datetime, time
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.const import URL_HOMEPAGE
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.lib import NameType, EventType, Name, Date, Person, Surname
from gramps.gen.lib.date import gregorian
@ -99,9 +97,9 @@ class BirthdayReport(Report):
self.filter = self.filter_option.get_filter()
pid = mgobn('pid')
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
lang = menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
@ -110,9 +108,6 @@ class BirthdayReport(Report):
if (self.center_person == None) :
raise ReportError(_("Person %s is not in the Database") % pid )
lang = menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
def get_name(self, person, maiden_name = None):
"""
Return person's name, unless maiden_name given, unless married_name

View File

@ -33,7 +33,6 @@ Reports/Text Reports/Descendant Report.
# standard python modules
#
#------------------------------------------------------------------------
import copy
#------------------------------------------------------------------------
#
@ -47,7 +46,6 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
PARA_ALIGN_CENTER)
from gramps.gen.plug.menu import (NumberOption, PersonOption, BooleanOption,
EnumeratedListOption)
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.plug.report import Report
from gramps.gen.plug.report import utils as ReportUtils
@ -359,8 +357,6 @@ class DescendantReport(Report):
marrs = menu.get_option_by_name('marrs').get_value()
divs = menu.get_option_by_name('divs').get_value()
# Copy the global NameDisplay so that we don't change application defaults.
self._name_display = copy.deepcopy(global_name_display)
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)

View File

@ -33,7 +33,6 @@
# standard python modules
#
#------------------------------------------------------------------------
import copy
#------------------------------------------------------------------------
#
@ -42,7 +41,6 @@ import copy
#------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.lib import EventType, FamilyRelType, Person, NoteType
from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
@ -136,10 +134,9 @@ class DetAncestorReport(Report):
if (self.center_person == None) :
raise ReportError(_("Person %s is not in the Database") % pid )
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
lang = menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
@ -157,9 +154,6 @@ class DetAncestorReport(Report):
else:
empty_place = ""
lang = menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
self.__narrator = Narrator(self.database, self.verbose, use_call,
use_fulldate, empty_date, empty_place,
nlocale=self._locale,

View File

@ -35,7 +35,6 @@
# standard python modules
#
#------------------------------------------------------------------------
import copy
from functools import partial
#------------------------------------------------------------------------
@ -45,7 +44,6 @@ from functools import partial
#------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.lib import FamilyRelType, Person, NoteType
from gramps.gen.plug.menu import (BooleanOption, NumberOption, PersonOption,
@ -170,15 +168,12 @@ class DetDescendantReport(Report):
else:
empty_place = ""
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
self._locale = self.set_locale(get_value('trans'))
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
self._locale = self.set_locale(get_value('trans'))
self.__narrator = Narrator(self.database, self.verbose,
use_call, use_fulldate,
empty_date, empty_place,

View File

@ -27,7 +27,6 @@
# python modules
#
#------------------------------------------------------------------------
import copy
#------------------------------------------------------------------------
#
@ -36,7 +35,6 @@ import copy
#------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
TableStyle, TableCellStyle,
@ -78,15 +76,12 @@ class EndOfLineReport(Report):
if (self.center_person == None) :
raise ReportError(_("Person %s is not in the Database") % pid )
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
self.set_locale(menu.get_option_by_name('trans').get_value())
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
self.set_locale(menu.get_option_by_name('trans').get_value())
# eol_map is a map whose:
# keys are the generations of the people
# values are a map whose:

View File

@ -28,7 +28,6 @@
# Python Library
#
#------------------------------------------------------------------------
import copy
from functools import partial
#------------------------------------------------------------------------
@ -48,7 +47,6 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
TableStyle, TableCellStyle,
FONT_SANS_SERIF, FONT_SERIF,
INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
from gramps.gen.display.name import displayer as global_name_display
#------------------------------------------------------------------------
#
@ -86,13 +84,6 @@ class FamilyGroup(Report):
else:
self.family_handle = None
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
get_option_by_name = menu.get_option_by_name
get_value = lambda name:get_option_by_name(name).get_value()
self.recursive = get_value('recursive')
@ -110,6 +101,10 @@ class FamilyGroup(Report):
rlocale = self.set_locale(get_value('trans'))
self._ = rlocale.translation.sgettext # needed for English
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
def dump_parent_event(self, name,event):
place = ""
date = ""

View File

@ -31,7 +31,6 @@
#
#------------------------------------------------------------------------
import os
import copy
from collections import defaultdict
#------------------------------------------------------------------------
@ -55,7 +54,6 @@ from gramps.gen.plug.report import MenuReportOptions
from gramps.gen.plug.report import Bibliography
from gramps.gen.plug.report import endnotes as Endnotes
from gramps.gen.plug.report import stdoptions
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.utils.file import media_path_full
#------------------------------------------------------------------------
@ -130,16 +128,13 @@ class IndivCompleteReport(Report):
self.section_list = menu.get_option_by_name('sections').get_selected()
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
lang = menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
lang = menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
def write_fact(self, event_ref, event, show_type=True):
"""
Writes a single event.

View File

@ -29,7 +29,6 @@
# python modules
#
#------------------------------------------------------------------------
import copy
#------------------------------------------------------------------------
#
@ -38,7 +37,6 @@ import copy
#------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.relationship import get_relationship_calculator
from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
@ -92,15 +90,12 @@ class KinshipReport(Report):
if (self.person == None) :
raise ReportError(_("Person %s is not in the Database") % pid )
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
rlocale = self.set_locale(menu.get_option_by_name('trans').get_value())
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
rlocale = self.set_locale(menu.get_option_by_name('trans').get_value())
self.__db = database
self.rel_calc = get_relationship_calculator(reinit=True,
clocale=rlocale)

View File

@ -30,7 +30,6 @@
# standard python modules
#
#------------------------------------------------------------------------
import copy
import math
#------------------------------------------------------------------------
@ -40,7 +39,6 @@ import math
#------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.plug.menu import PersonOption
from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
@ -80,16 +78,13 @@ class NumberOfAncestorsReport(Report):
if (self.__person == None) :
raise ReportError(_("Person %s is not in the Database") % pid )
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
lang = options.menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
name_format = options.menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)
lang = options.menu.get_option_by_name('trans').get_value()
self._locale = self.set_locale(lang)
def write_report(self):
"""
The routine that actually creates the report.

View File

@ -28,7 +28,6 @@
# python modules
#
#------------------------------------------------------------------------
import copy
#------------------------------------------------------------------------
#
@ -48,7 +47,6 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
from gramps.gen.proxy import PrivateProxyDb
from gramps.gen.sort import Sort
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.utils.location import get_main_location
from gramps.gen.lib import PlaceType
@ -85,9 +83,6 @@ class PlaceReport(Report):
self.set_locale(menu.get_option_by_name('trans').get_value())
# Copy the global NameDisplay so that we don't change application
# defaults.
self._name_display = copy.deepcopy(global_name_display)
name_format = menu.get_option_by_name("name_format").get_value()
if name_format != 0:
self._name_display.set_default_format(name_format)