Adapted the filters for internationalization, fixed minor bugs in report generators
svn: r44
This commit is contained in:
parent
84cf231fc5
commit
883475a8ea
@ -32,11 +32,12 @@ class AbiWordDoc(TextDoc):
|
||||
TextDoc.__init__(self,type,orientation)
|
||||
self.f = None
|
||||
self.level = 0
|
||||
self.new_page = 0
|
||||
|
||||
def open(self,filename):
|
||||
|
||||
if filename[-4:] != ".abw":
|
||||
self.filename = filename + ".abw"
|
||||
self.filename = "%s.abw" % filename
|
||||
else:
|
||||
self.filename = filename
|
||||
|
||||
@ -104,6 +105,7 @@ class AbiWordDoc(TextDoc):
|
||||
|
||||
def start_paragraph(self,style_name):
|
||||
style = self.style_list[style_name]
|
||||
self.current_style = style
|
||||
self.f.write('<p props="')
|
||||
if style.get_alignment() == PARA_ALIGN_RIGHT:
|
||||
self.f.write('text-align:right;')
|
||||
@ -118,6 +120,7 @@ class AbiWordDoc(TextDoc):
|
||||
indent = float(style.get_first_indent())/2.54
|
||||
self.f.write(' margin-right:%.4fin;' % rmargin)
|
||||
self.f.write(' margin-left:%.4fin;' % lmargin)
|
||||
self.f.write(' tabstops:%.4fin/L;' % lmargin)
|
||||
self.f.write(' text-indent:%.4fin' % indent)
|
||||
self.f.write('">')
|
||||
font = style.get_font()
|
||||
@ -126,7 +129,7 @@ class AbiWordDoc(TextDoc):
|
||||
self.f.write('Arial;')
|
||||
else:
|
||||
self.f.write('Times New Roman;')
|
||||
self.f.write('font-size:' + str(font.get_size()) + 'pt')
|
||||
self.f.write('font-size:%dpt' % font.get_size())
|
||||
if font.get_bold():
|
||||
self.f.write('; font-weight:bold')
|
||||
if font.get_italic():
|
||||
@ -135,15 +138,58 @@ class AbiWordDoc(TextDoc):
|
||||
if color != (0,0,0):
|
||||
self.f.write('; color:%2x%2x%2x' % color)
|
||||
if font.get_underline():
|
||||
self.f.write('; text-decoration:underline' % color)
|
||||
self.f.write('; text-decoration:underline')
|
||||
self.f.write('">')
|
||||
if self.new_page == 1:
|
||||
self.new_page = 0
|
||||
self.f.write('<pbr/>')
|
||||
|
||||
def page_break(self,orientation=None):
|
||||
self.new_page = 1
|
||||
|
||||
def end_paragraph(self):
|
||||
self.f.write('</c></p>\n')
|
||||
|
||||
def write_text(self,text):
|
||||
self.f.write(text)
|
||||
|
||||
def start_bold(self):
|
||||
font = self.current_style.get_font()
|
||||
self.f.write('</c><c props="font-family:')
|
||||
if font.get_type_face() == FONT_SANS_SERIF:
|
||||
self.f.write('Arial;')
|
||||
else:
|
||||
self.f.write('Times New Roman;')
|
||||
self.f.write('font-size:%dpt' % font.get_size())
|
||||
self.f.write('; font-weight:bold')
|
||||
if font.get_italic():
|
||||
self.f.write('; font-style:italic')
|
||||
color = font.get_color()
|
||||
if color != (0,0,0):
|
||||
self.f.write('; color:%2x%2x%2x' % color)
|
||||
if font.get_underline():
|
||||
self.f.write('; text-decoration:underline')
|
||||
self.f.write('">')
|
||||
|
||||
def end_bold(self):
|
||||
font = self.current_style.get_font()
|
||||
self.f.write('</c><c props="font-family:')
|
||||
if font.get_type_face() == FONT_SANS_SERIF:
|
||||
self.f.write('Arial;')
|
||||
else:
|
||||
self.f.write('Times New Roman;')
|
||||
self.f.write('font-size:%dpt' % font.get_size())
|
||||
if font.get_bold():
|
||||
self.f.write('; font-weight:bold')
|
||||
if font.get_italic():
|
||||
self.f.write('; font-style:italic')
|
||||
color = font.get_color()
|
||||
if color != (0,0,0):
|
||||
self.f.write('; color:%2x%2x%2x' % color)
|
||||
if font.get_underline():
|
||||
self.f.write('; text-decoration:underline')
|
||||
self.f.write('">')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
paper = PaperStyle("Letter",27.94,21.59)
|
||||
|
@ -1023,7 +1023,7 @@ def on_apply_person_clicked(obj):
|
||||
|
||||
if error == 1:
|
||||
msg = _("Changing the gender caused problems with marriage information.")
|
||||
msg2 = _("Please check the person's marriage relationships")
|
||||
msg2 = _("Please check the person's marriage relationships.")
|
||||
GnomeErrorDialog(msg + msg2)
|
||||
|
||||
text = edit_person_obj.notes_field.get_chars(0,-1)
|
||||
|
@ -18,13 +18,6 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Documentation String - used to describe the filter
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
"All people"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Standard python modules
|
||||
@ -33,6 +26,9 @@
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
import intl
|
||||
|
||||
_ = intl.gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -40,7 +36,6 @@ import sys
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class Filter:
|
||||
"All people"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -106,9 +101,9 @@ def create(text):
|
||||
def need_qualifier():
|
||||
return 0
|
||||
|
||||
filterList = [ "All people" ]
|
||||
filterMap = { "All people" : create }
|
||||
filterEnb = { "All people" : need_qualifier }
|
||||
filterList = [ _("All people") ]
|
||||
filterMap = { _("All people") : create }
|
||||
filterEnb = { _("All people") : need_qualifier }
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -135,9 +130,16 @@ def load_filters(dir):
|
||||
plugin = __import__(groups[0])
|
||||
except:
|
||||
continue
|
||||
|
||||
if "get_name" in plugin.__dict__.keys():
|
||||
name = plugin.get_name()
|
||||
else:
|
||||
name = plugin.__doc__
|
||||
|
||||
for task in plugin.__dict__.keys():
|
||||
if task == "create":
|
||||
filterMap[plugin.__doc__] = plugin.__dict__[task]
|
||||
filterMap[name] = plugin.__dict__[task]
|
||||
filterList.append(plugin.__doc__)
|
||||
if task == "need_qualifier" :
|
||||
filterEnb[plugin.__doc__] = plugin.__dict__[task]
|
||||
filterEnb[name] = plugin.__dict__[task]
|
||||
|
||||
|
@ -785,7 +785,6 @@ class GrampsParser(handler.ContentHandler):
|
||||
f(self,attrs)
|
||||
except:
|
||||
GrampsParser.func_map[tag] = (None,None)
|
||||
print tag
|
||||
self.func = None
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
|
@ -40,6 +40,7 @@ class OpenOfficeDoc(TextDoc):
|
||||
self.filename = None
|
||||
self.level = 0
|
||||
self.time = "0000-00-00T00:00:00"
|
||||
self.new_page = 0
|
||||
|
||||
def open(self,filename):
|
||||
import time
|
||||
@ -91,6 +92,15 @@ class OpenOfficeDoc(TextDoc):
|
||||
self.f.write('style:font-pitch="variable"/>\n')
|
||||
self.f.write('</office:font-decls>\n')
|
||||
self.f.write('<office:automatic-styles>\n')
|
||||
for style_name in self.style_list.keys():
|
||||
style = self.style_list[style_name]
|
||||
self.f.write('<style:style style:name="NL')
|
||||
self.f.write(style_name)
|
||||
self.f.write('" style:family="paragraph" ')
|
||||
self.f.write('style:parent-style-name="')
|
||||
self.f.write(style_name)
|
||||
self.f.write('">\n<style:properties fo:break-before="page"/>\n')
|
||||
self.f.write('</style:style>\n')
|
||||
for style_name in self.table_styles.keys():
|
||||
style = self.table_styles[style_name]
|
||||
self.f.write('<style:style style:name="' + style_name + '" ')
|
||||
@ -132,7 +142,7 @@ class OpenOfficeDoc(TextDoc):
|
||||
self.f.write('/>\n')
|
||||
self.f.write('</style:style>\n')
|
||||
|
||||
self.f.write('<style:style style:name="T1" style:family="text">\n')
|
||||
self.f.write('<style:style style:name="Tbold" style:family="text">\n')
|
||||
self.f.write('<style:properties fo:font-weight="bold"/>\n')
|
||||
self.f.write('</style:style>\n')
|
||||
self.f.write('</office:automatic-styles>\n')
|
||||
@ -206,6 +216,12 @@ class OpenOfficeDoc(TextDoc):
|
||||
for col in range(1,self.span):
|
||||
self.f.write('<table:covered-table-cell/>\n')
|
||||
|
||||
def start_bold(self):
|
||||
self.f.write('<text:span text:style-name="Tbold">')
|
||||
|
||||
def end_bold(self):
|
||||
self.f.write('</text:span>')
|
||||
|
||||
def _write_zip(self):
|
||||
|
||||
if os.path.isfile(self.filename):
|
||||
@ -364,14 +380,23 @@ class OpenOfficeDoc(TextDoc):
|
||||
self.f.write('</office:master-styles>\n')
|
||||
self.f.write('</office:document-styles>\n')
|
||||
self.f.close()
|
||||
|
||||
def page_break(self):
|
||||
self.new_page = 1
|
||||
|
||||
def start_paragraph(self,style_name):
|
||||
style = self.style_list[style_name]
|
||||
self.level = style.get_header_level()
|
||||
if self.new_page == 1:
|
||||
self.new_page = 0
|
||||
name = "NL%s" % style_name
|
||||
else:
|
||||
name = style_name
|
||||
if self.level == 0:
|
||||
self.f.write('<text:p text:style-name="' + style_name + '">')
|
||||
self.f.write('<text:p text:style-name="%s">' % name)
|
||||
else:
|
||||
self.f.write('<text:h text:style-name="' + style_name)
|
||||
self.f.write('<text:h text:style-name="')
|
||||
self.f.write(name)
|
||||
self.f.write('" text:level="' + str(self.level) + '">')
|
||||
|
||||
def end_paragraph(self):
|
||||
|
@ -377,10 +377,13 @@ class TextDoc:
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def start_page(self,orientation=None):
|
||||
def page_break(self):
|
||||
pass
|
||||
|
||||
def end_page(self):
|
||||
def start_bold(self):
|
||||
pass
|
||||
|
||||
def end_bold(self):
|
||||
pass
|
||||
|
||||
def start_paragraph(self,style_name):
|
||||
|
@ -4,7 +4,6 @@ mv template.po template.po.bak
|
||||
echo "Working on the glade files"
|
||||
libglade-xgettext -c -o glade.c *.glade
|
||||
echo "Working on python files"
|
||||
./get_strings *.py >> glade.c
|
||||
./get_strings *.py filters/*.py >> glade.c
|
||||
echo "Building template.po"
|
||||
xgettext -C -s -a -o template.po glade.c
|
||||
#rm glade.c
|
||||
|
@ -67,7 +67,7 @@ gtkrcFile = rootDir + os.sep + "gtkrc"
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
progName = "gramps"
|
||||
version = "0.1.4"
|
||||
version = "0.1.5pre"
|
||||
copyright = "(C) 2001 Donald N. Allingham"
|
||||
authors = ["Donald N. Allingham"]
|
||||
comments = _("Gramps (Genealogical Research and Analysis Management ") +\
|
||||
|
@ -24,6 +24,8 @@ import Filter
|
||||
import string
|
||||
import Date
|
||||
import RelLib
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -60,6 +62,14 @@ class EventAfter(Filter.Filter):
|
||||
break
|
||||
return val
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def get_name():
|
||||
return _("People with an event after ...")
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
|
@ -24,6 +24,8 @@ import Filter
|
||||
import string
|
||||
import Date
|
||||
import RelLib
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -76,3 +78,11 @@ def create(text):
|
||||
#------------------------------------------------------------------------
|
||||
def need_qualifier():
|
||||
return 1
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def get_name():
|
||||
return _("People with an event before ...")
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
import Filter
|
||||
import RelLib
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class Disconnected(Filter.Filter):
|
||||
"Disconnected individuals"
|
||||
@ -34,3 +36,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 0
|
||||
|
||||
def get_name():
|
||||
return _("Disconnected individuals")
|
||||
|
@ -24,6 +24,8 @@ import Filter
|
||||
import string
|
||||
import re
|
||||
import RelLib
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class EventPlace(Filter.Filter):
|
||||
"People with an event location of ..."
|
||||
@ -52,3 +54,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 1
|
||||
|
||||
def get_name():
|
||||
return _("People with an event location of ...")
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
import Filter
|
||||
import string
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class EventType(Filter.Filter):
|
||||
"People who have photos"
|
||||
@ -37,3 +39,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 1
|
||||
|
||||
def get_name():
|
||||
return _("People who have an event type of ...")
|
||||
|
@ -24,6 +24,8 @@ import Filter
|
||||
import string
|
||||
import utils
|
||||
from RelLib import Person
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class Females(Filter.Filter):
|
||||
"Females"
|
||||
@ -37,3 +39,5 @@ def create(text):
|
||||
def need_qualifier():
|
||||
return 0
|
||||
|
||||
def get_name():
|
||||
return _("Females")
|
||||
|
@ -23,6 +23,8 @@
|
||||
import Filter
|
||||
import string
|
||||
import utils
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class HavePhotos(Filter.Filter):
|
||||
"People who have photos"
|
||||
@ -35,3 +37,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 0
|
||||
|
||||
def get_name():
|
||||
return _("People who have photos")
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
import Filter
|
||||
from RelLib import Person
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class IncompleteNames(Filter.Filter):
|
||||
"People with incomplete names"
|
||||
@ -36,3 +38,5 @@ def create(text):
|
||||
def need_qualifier():
|
||||
return 0
|
||||
|
||||
def get_name():
|
||||
return _("People with incomplete names")
|
||||
|
@ -23,6 +23,8 @@
|
||||
import Filter
|
||||
import soundex
|
||||
import RelLib
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class MatchSndEx(Filter.Filter):
|
||||
"Names with same SoundEx code as ..."
|
||||
@ -39,3 +41,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 1
|
||||
|
||||
def get_name():
|
||||
return _("Names with same SoundEx code as ...")
|
||||
|
@ -23,6 +23,8 @@
|
||||
import Filter
|
||||
import soundex
|
||||
import RelLib
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class MatchSndEx2(Filter.Filter):
|
||||
"Names with the specified SoundEx code"
|
||||
@ -35,3 +37,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 1
|
||||
|
||||
def get_name():
|
||||
return _("Names with the specified SoundEx code")
|
||||
|
@ -23,6 +23,8 @@
|
||||
import Filter
|
||||
import string
|
||||
import utils
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class MultipleMarriages(Filter.Filter):
|
||||
"People with multiple marriage records"
|
||||
@ -35,3 +37,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 0
|
||||
|
||||
def get_name():
|
||||
return _("People with multiple marriage records")
|
||||
|
@ -23,6 +23,8 @@
|
||||
import Filter
|
||||
import string
|
||||
import utils
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class NeverMarried(Filter.Filter):
|
||||
"People with no marriage records"
|
||||
@ -35,3 +37,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 0
|
||||
|
||||
def get_name():
|
||||
return _("People with no marriage records")
|
||||
|
@ -23,6 +23,8 @@
|
||||
import Filter
|
||||
import string
|
||||
import utils
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class NoBirthdate(Filter.Filter):
|
||||
"People no listed birth date"
|
||||
@ -35,3 +37,8 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 0
|
||||
|
||||
def get_name():
|
||||
return _("People no listed birth date")
|
||||
|
||||
|
||||
|
@ -23,6 +23,8 @@
|
||||
import Filter
|
||||
import string
|
||||
import utils
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class HaveChildren(Filter.Filter):
|
||||
"People with children"
|
||||
@ -41,3 +43,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 0
|
||||
|
||||
def get_name():
|
||||
return _("People with children")
|
||||
|
@ -23,6 +23,8 @@
|
||||
import Filter
|
||||
import re
|
||||
import utils
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class RegExMatch(Filter.Filter):
|
||||
"Names that match a regular expression"
|
||||
@ -46,3 +48,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 1
|
||||
|
||||
def get_name():
|
||||
return _("Names that match a regular expression")
|
||||
|
@ -23,6 +23,8 @@
|
||||
import Filter
|
||||
import string
|
||||
import utils
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
class SubString(Filter.Filter):
|
||||
"Names that contain a substring"
|
||||
@ -35,3 +37,6 @@ def create(text):
|
||||
|
||||
def need_qualifier():
|
||||
return 1
|
||||
|
||||
def get_name():
|
||||
return _("Names that contain a substring")
|
||||
|
@ -36,6 +36,9 @@ from gtk import *
|
||||
from gnome.ui import *
|
||||
from libglade import *
|
||||
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@ -198,7 +201,8 @@ def report(database,person):
|
||||
PaperMenu.make_paper_menu(topDialog.get_widget("papersize"))
|
||||
PaperMenu.make_orientation_menu(topDialog.get_widget("orientation"))
|
||||
|
||||
topDialog.get_widget("labelTitle").set_text("Ancestor chart for " + name)
|
||||
title = _("Ancestor chart for %s") % name
|
||||
topDialog.get_widget("labelTitle").set_text(title)
|
||||
topDialog.signal_autoconnect({
|
||||
"destroy_passed_object" : utils.destroy_passed_object,
|
||||
"on_save_clicked" : on_save_clicked
|
||||
@ -213,7 +217,7 @@ def on_save_clicked(obj):
|
||||
global active_person
|
||||
global db
|
||||
|
||||
outputName = topDialog.get_widget("filename").get_text()
|
||||
outputName = topDialog.get_widget("fileentry1").get_full_path(0)
|
||||
if outputName == "":
|
||||
return
|
||||
|
||||
@ -240,7 +244,16 @@ def on_save_clicked(obj):
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def get_description():
|
||||
return "Produces a graphical ancestral tree graph"
|
||||
return _("Produces a graphical ancestral tree graph")
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def get_name():
|
||||
return _("Generate files/Ancestor Chart")
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -29,6 +29,9 @@ from gtk import *
|
||||
from gnome.ui import *
|
||||
from libglade import *
|
||||
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
col2person = {}
|
||||
reportPerson = None
|
||||
zoom = 1.0
|
||||
@ -377,7 +380,10 @@ def mysort(first, second) :
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def get_description():
|
||||
return "Produces a graphical ancestral tree graph"
|
||||
return _("Produces a graphical ancestral tree graph")
|
||||
|
||||
def get_name():
|
||||
return _("View/View an ancestor graph")
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -27,6 +27,9 @@ import re
|
||||
import sort
|
||||
import string
|
||||
import utils
|
||||
import intl
|
||||
|
||||
_ = intl.gettext
|
||||
|
||||
from TextDoc import *
|
||||
from OpenOfficeDoc import *
|
||||
@ -53,35 +56,35 @@ db = None
|
||||
class AncestorReport:
|
||||
|
||||
gen = {
|
||||
1 : "First",
|
||||
2 : "Second",
|
||||
3 : "Third",
|
||||
4 : "Fourth",
|
||||
5 : "Fifth",
|
||||
6 : "Sixth",
|
||||
7 : "Seventh",
|
||||
8 : "Eighth",
|
||||
9 : "Ninth",
|
||||
10: "Tenth",
|
||||
11: "Eleventh",
|
||||
12: "Twelfth",
|
||||
13: "Thirteenth",
|
||||
14: "Fourteenth",
|
||||
15: "Fifteenth",
|
||||
16: "Sixteenth",
|
||||
17: "Seventeenth",
|
||||
18: "Eigthteenth",
|
||||
19: "Nineteenth",
|
||||
20: "Twentieth",
|
||||
21: "Twenty-first",
|
||||
22: "Twenty-second",
|
||||
23: "Twenty-third",
|
||||
24: "Twenty-fourth",
|
||||
25: "Twenty-fifth",
|
||||
26: "Twenty-sixth",
|
||||
27: "Twenty-seventh",
|
||||
28: "Twenty-eighth",
|
||||
29: "Twenty-ninth"
|
||||
1 : _("First"),
|
||||
2 : _("Second"),
|
||||
3 : _("Third"),
|
||||
4 : _("Fourth"),
|
||||
5 : _("Fifth"),
|
||||
6 : _("Sixth"),
|
||||
7 : _("Seventh"),
|
||||
8 : _("Eighth"),
|
||||
9 : _("Ninth"),
|
||||
10: _("Tenth"),
|
||||
11: _("Eleventh"),
|
||||
12: _("Twelfth"),
|
||||
13: _("Thirteenth"),
|
||||
14: _("Fourteenth"),
|
||||
15: _("Fifteenth"),
|
||||
16: _("Sixteenth"),
|
||||
17: _("Seventeenth"),
|
||||
18: _("Eigthteenth"),
|
||||
19: _("Nineteenth"),
|
||||
20: _("Twentieth"),
|
||||
21: _("Twenty-first"),
|
||||
22: _("Twenty-second"),
|
||||
23: _("Twenty-third"),
|
||||
24: _("Twenty-fourth"),
|
||||
25: _("Twenty-fifth"),
|
||||
26: _("Twenty-sixth"),
|
||||
27: _("Twenty-seventh"),
|
||||
28: _("Twenty-eighth"),
|
||||
29: _("Twenty-ninth")
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
@ -103,6 +106,8 @@ class AncestorReport:
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_header_level(1)
|
||||
para.set_top_border(0.2)
|
||||
para.set_bottom_border(0.2)
|
||||
self.doc.add_style("Title",para)
|
||||
|
||||
font = FontStyle()
|
||||
@ -113,6 +118,8 @@ class AncestorReport:
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_header_level(2)
|
||||
para.set_top_border(0.15)
|
||||
para.set_bottom_border(0.15)
|
||||
self.doc.add_style("Header",para)
|
||||
|
||||
para = ParagraphStyle()
|
||||
@ -122,7 +129,7 @@ class AncestorReport:
|
||||
try:
|
||||
self.doc.open(output)
|
||||
except IOError,msg:
|
||||
GnomeErrorDialog("Could not open %s\n%s",msg)
|
||||
GnomeErrorDialog(_("Could not open %s\n%s"),msg)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
#
|
||||
@ -150,7 +157,8 @@ class AncestorReport:
|
||||
|
||||
name = self.start.getPrimaryName().getRegularName()
|
||||
self.doc.start_paragraph("Title")
|
||||
self.doc.write_text("Ahnentafel Chart for " + name)
|
||||
title = _("Ahnentafel Chart for %s") % name
|
||||
self.doc.write_text(title)
|
||||
self.doc.end_paragraph()
|
||||
|
||||
keys = self.map.keys()
|
||||
@ -160,8 +168,11 @@ class AncestorReport:
|
||||
|
||||
for key in keys :
|
||||
if generation == 0 or key >= 2**generation:
|
||||
if self.pgbrk and generation > 0:
|
||||
self.doc.page_break()
|
||||
self.doc.start_paragraph("Header")
|
||||
self.doc.write_text(AncestorReport.gen[generation+1 ]+ " Generation")
|
||||
t = _("%s Generation") % AncestorReport.gen[generation+1]
|
||||
self.doc.write_text(t)
|
||||
self.doc.end_paragraph()
|
||||
generation = generation + 1
|
||||
|
||||
@ -169,7 +180,14 @@ class AncestorReport:
|
||||
person = self.map[key]
|
||||
name = person.getPrimaryName().getRegularName()
|
||||
|
||||
self.doc.write_text(str(key) + ".\t" + name )
|
||||
self.doc.write_text(str(key) + ".\t")
|
||||
self.doc.start_bold()
|
||||
self.doc.write_text(name)
|
||||
self.doc.end_bold()
|
||||
if name[-1:] == '.':
|
||||
self.doc.write_text(" ")
|
||||
else:
|
||||
self.doc.write_text(". ")
|
||||
|
||||
# Check birth record
|
||||
|
||||
@ -177,21 +195,25 @@ class AncestorReport:
|
||||
if birth:
|
||||
date = birth.getDateObj().get_start_date()
|
||||
place = birth.getPlace()
|
||||
if place[-1:] == '.':
|
||||
place = place[:-1]
|
||||
if date.getDate() != "" or place != "":
|
||||
self.doc.write_text(" was born")
|
||||
if date.getDate() != "":
|
||||
if date.getDay() != -1 and date.getMonth() != -1:
|
||||
self.doc.write_text(" on ")
|
||||
if place != "":
|
||||
t = _("%s was born on %s in %s. ") % \
|
||||
(name,date.getDate(),place)
|
||||
else:
|
||||
t = _("%s was born on %s. ") % \
|
||||
(name,date.getDate())
|
||||
else:
|
||||
self.doc.write_text(" in ")
|
||||
self.doc.write_text(date.getDate())
|
||||
if place != "":
|
||||
self.doc.write_text(" in " + place)
|
||||
if place == "" or place[-1] != '.':
|
||||
self.doc.write_text(".")
|
||||
self.doc.write_text("\n")
|
||||
else:
|
||||
self.doc.write_text(".\n")
|
||||
if place != "":
|
||||
t = _("%s was born in %s in %s. ") % \
|
||||
(name,date.getDate(),place)
|
||||
else:
|
||||
t = _("%s was born in %s. ") % \
|
||||
(name,date.getDate())
|
||||
self.doc.write_text(t)
|
||||
|
||||
death = person.getDeath()
|
||||
buried = None
|
||||
@ -202,42 +224,71 @@ class AncestorReport:
|
||||
if death:
|
||||
date = death.getDateObj().get_start_date()
|
||||
place = death.getPlace()
|
||||
if place[-1:] == '.':
|
||||
place = place[:-1]
|
||||
if date.getDate() != "" or place != "":
|
||||
if person.getGender() == RelLib.Person.male:
|
||||
self.doc.write_text("He")
|
||||
male = 1
|
||||
else:
|
||||
self.doc.write_text("She")
|
||||
self.doc.write_text(" died")
|
||||
male = 0
|
||||
|
||||
if date.getDate() != "":
|
||||
if date.getDay() != -1 and date.getMonth() != -1:
|
||||
self.doc.write_text(" on ")
|
||||
if male:
|
||||
if place != "":
|
||||
t = _("He died on %s in %s") % \
|
||||
(date.getDate(),place)
|
||||
else:
|
||||
t = _("He died on %s") % date.getDate()
|
||||
else:
|
||||
if place != "":
|
||||
t = _("She died on %s in %s") % \
|
||||
(date.getDate(),place)
|
||||
else:
|
||||
t = _("She died on %s") % date.getDate()
|
||||
else:
|
||||
self.doc.write_text(" in ")
|
||||
self.doc.write_text(date.getDate())
|
||||
if place != "":
|
||||
self.doc.write_text(" in " + place)
|
||||
if male:
|
||||
if place != "":
|
||||
t = _("He died in %s in %s") % \
|
||||
(date.getDate(),place)
|
||||
else:
|
||||
t = _("He died in %s") % date.getDate()
|
||||
else:
|
||||
if place != "":
|
||||
t = _("She died in %s in %s") % \
|
||||
(date.getDate(),place)
|
||||
else:
|
||||
t = _("She died in %s") % date.getDate()
|
||||
|
||||
self.doc.write_text(t)
|
||||
|
||||
if buried:
|
||||
date = buried.getDateObj().get_start_date()
|
||||
place = buried.getPlace()
|
||||
if place[-1:] == '.':
|
||||
place = place[:-1]
|
||||
if date.getDate() != "" or place != "":
|
||||
self.doc.write_text(", and was buried")
|
||||
|
||||
if date.getDate() != "":
|
||||
if date.getDay() != -1 and date.getMonth() != -1:
|
||||
self.doc.write_text(" on ")
|
||||
if place != "":
|
||||
t = _(", and was buried on %s in %s.") % \
|
||||
(date.getDate(),place)
|
||||
else:
|
||||
t = _(", and was buried on %s.") % \
|
||||
date.getDate()
|
||||
else:
|
||||
self.doc.write_text(" in ")
|
||||
self.doc.write_text(date.getDate())
|
||||
if place != "":
|
||||
self.doc.write_text(" in " + place)
|
||||
|
||||
if place == "" or place[-1] != '.':
|
||||
if place != "":
|
||||
t = _(", and was buried in %s in %s.") % \
|
||||
(date.getDate(),place)
|
||||
else:
|
||||
t = _(", and was buried in %s.") % \
|
||||
date.getDate()
|
||||
else:
|
||||
t = _(" and was buried in %s." % place)
|
||||
self.doc.write_text(t)
|
||||
else:
|
||||
self.doc.write_text(".")
|
||||
self.doc.write_text("\n")
|
||||
else:
|
||||
self.doc.write_text(".\n")
|
||||
|
||||
|
||||
self.doc.end_paragraph()
|
||||
|
||||
self.doc.close()
|
||||
@ -301,7 +352,10 @@ def on_save_clicked(obj):
|
||||
global active_person
|
||||
global db
|
||||
|
||||
outputName = topDialog.get_widget("filename").get_text()
|
||||
outputName = topDialog.get_widget("fileentry1").get_full_path(0)
|
||||
if outputName == "":
|
||||
return
|
||||
|
||||
max_gen = topDialog.get_widget("generations").get_value_as_int()
|
||||
pgbrk = topDialog.get_widget("pagebreak").get_active()
|
||||
template = topDialog.get_widget("htmltemplate").get_full_path(0)
|
||||
@ -310,9 +364,6 @@ def on_save_clicked(obj):
|
||||
orien_obj = topDialog.get_widget("orientation").get_menu().get_active()
|
||||
orien = orien_obj.get_data("i")
|
||||
|
||||
if outputName == "":
|
||||
return
|
||||
|
||||
if topDialog.get_widget("openoffice").get_active():
|
||||
document = OpenOfficeDoc(paper,orien)
|
||||
elif topDialog.get_widget("abiword").get_active():
|
||||
@ -332,7 +383,10 @@ def on_save_clicked(obj):
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def get_description():
|
||||
return "Produces a textual ancestral report"
|
||||
return _("Produces a textual ancestral report")
|
||||
|
||||
def get_name():
|
||||
return _("Generate files/Ahnentafel Chart")
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -29,6 +29,9 @@ from libglade import *
|
||||
import RelLib
|
||||
import const
|
||||
import utils
|
||||
import intl
|
||||
|
||||
_ = intl.gettext
|
||||
|
||||
topDialog = None
|
||||
|
||||
@ -90,5 +93,7 @@ def runTool(database,person,callback):
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def get_description():
|
||||
return "Allows all the events of a certain name to be renamed to a new name"
|
||||
return _("Allows all the events of a certain name to be renamed to a new name")
|
||||
|
||||
def get_name():
|
||||
return _("Database Processing/Rename personal event types")
|
||||
|
@ -24,6 +24,8 @@ import RelLib
|
||||
import utils
|
||||
import soundex
|
||||
import Config
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
import string
|
||||
import os
|
||||
@ -136,26 +138,26 @@ class CheckIntegrity:
|
||||
errors = blink + efam + pphotos + fphotos
|
||||
|
||||
if errors == 0:
|
||||
GnomeOkDialog("No errors were found")
|
||||
GnomeOkDialog(_("No errors were found"))
|
||||
return
|
||||
|
||||
text = ""
|
||||
if blink == 1:
|
||||
text = text + "1 broken family link was found\n"
|
||||
text = text + _("1 broken family link was found\n")
|
||||
elif blink > 1:
|
||||
text = text + "%d broken family links were found\n" % blink
|
||||
text = text + _("%d broken family links were found\n") % blink
|
||||
if efam == 1:
|
||||
text = text + "1 empty family was found\n"
|
||||
text = text + _("1 empty family was found\n")
|
||||
elif efam > 1:
|
||||
text = text + "%d empty families were found\n" % efam
|
||||
text = text + _("%d empty families were found\n") % efam
|
||||
if fphotos == 1:
|
||||
text = text + "1 broken family photo was found\n"
|
||||
text = text + _("1 broken family photo was found\n")
|
||||
elif fphotos > 1:
|
||||
text = text + "%d broken family photos were found\n" % fphotos
|
||||
text = text + _("%d broken family photos were found\n") % fphotos
|
||||
if pphotos == 1:
|
||||
text = text + "1 broken personal photo was found\n"
|
||||
text = text + _("1 broken personal photo was found\n")
|
||||
elif pphotos > 1:
|
||||
text = text + "%d broken personal photos were found\n" % pphotos
|
||||
text = text + _("%d broken personal photos were found\n") % pphotos
|
||||
|
||||
GnomeWarningDialog(string.strip(text))
|
||||
|
||||
@ -165,5 +167,7 @@ class CheckIntegrity:
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def get_description():
|
||||
return "Checks the database for any relationship errors"
|
||||
return _("Checks the database for any relationship errors")
|
||||
|
||||
def get_name():
|
||||
return _("Database Processing/Check database integrity")
|
||||
|
@ -172,7 +172,7 @@ def on_save_clicked(obj):
|
||||
myobj = obj.get_data("o")
|
||||
db = obj.get_data("d")
|
||||
|
||||
file = myobj.top.get_widget("filename").get_text()
|
||||
file = myobj.top.get_widget("fileentry1").get_full_path(0)
|
||||
if file == "":
|
||||
return
|
||||
|
||||
|
@ -435,7 +435,7 @@ def on_save_clicked(obj):
|
||||
global active_person
|
||||
global db
|
||||
|
||||
outputName = topDialog.get_widget("filename").get_text()
|
||||
outputName = topDialog.get_widget("fileentry1").get_full_path(0)
|
||||
if outputName == "":
|
||||
return
|
||||
|
||||
|
@ -242,8 +242,8 @@ def on_ok_clicked(obj):
|
||||
global restrict
|
||||
global no_photos
|
||||
|
||||
start = re.compile(r"<!-- START -->")
|
||||
stop = re.compile(r"<!-- STOP -->")
|
||||
start = re.compile(r"<!--\s*START\s*-->")
|
||||
stop = re.compile(r"<!--\s*STOP\s*-->")
|
||||
top = []
|
||||
bottom = []
|
||||
|
||||
|
@ -394,7 +394,7 @@ def on_save_clicked(obj):
|
||||
global active_person
|
||||
global db
|
||||
|
||||
outputName = topDialog.get_widget("filename").get_text()
|
||||
outputName = topDialog.get_widget("fileentry1").get_full_path(0)
|
||||
if outputName == "":
|
||||
return
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user