From bdcbfb45d0039e1e7487272bdfe5f0e1f72957e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Charette?= Date: Sat, 13 Oct 2007 10:07:28 +0000 Subject: [PATCH] added Portuguese rel_pt.py contributed by Duarte Loreto svn: r9172 --- ChangeLog | 6 + po/POTFILES.in | 1 + src/plugins/Makefile.am | 1 + src/plugins/rel_pt.py | 330 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 338 insertions(+) create mode 100644 src/plugins/rel_pt.py diff --git a/ChangeLog b/ChangeLog index d7ae412e6..431e7aa8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-10-13 Stephane Charette + * src/plugins/rel_pt.py: new file (Portuguese) contributed by Duarte + Loreto + * src/plugins/Makefile.am: added rel_pt.py + * po/POTFILES.in: added rel_pt.py + 2007-10-12 Brian Matherly * src/plugins/NarrativeWeb.py: 0001252: Unicode error in NarrativeWeb.py in gramps3.0 diff --git a/po/POTFILES.in b/po/POTFILES.in index 41d1917fc..cd7bb85ce 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -302,6 +302,7 @@ src/plugins/rel_fr.py src/plugins/rel_hu.py src/plugins/rel_it.py src/plugins/rel_no.py +src/plugins/rel_pt.py src/plugins/rel_ru.py src/plugins/rel_sk.py src/plugins/rel_sv.py diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index f4e75910b..27bc75579 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -65,6 +65,7 @@ pkgdata_PYTHON = \ rel_fi.py\ rel_fr.py\ rel_no.py\ + rel_pt.py\ rel_sv.py\ rel_sk.py\ ImportGeneWeb.py\ diff --git a/src/plugins/rel_pt.py b/src/plugins/rel_pt.py new file mode 100644 index 000000000..2cd6de40c --- /dev/null +++ b/src/plugins/rel_pt.py @@ -0,0 +1,330 @@ +# -*- coding: utf-8 -*- +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2003-2005 Donald N. Allingham +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# Portuguese version by Duarte Loreto , 2007. +# Based on the Spanish version by Julio Sanchez + +# $Id$ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- + +import RelLib +import Relationship +import types +from gettext import gettext as _ +from PluginUtils import register_relcalc + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- + +_level_name_male = [ "", "primeiro", "segundo", "terceiro", "quarto", "quinto", + "sexto", "sétimo", "oitavo", "nono", "décimo", "décimo-primeiro", + "décimo-segundo", "décimo-terceiro", "décimo-quarto", "décimo-quinto", + "décimo-sexto", "décimo-sétimo", "décimo-oitavo", "décimo-nono", + "vigésimo", ] + +# Short forms (in apocope) used before names +_level_name_male_a = [ "", "primeiro", "segundo", "terceiro", "quarto", "quinto", + "sexto", "sétimo", "oitavo", "nono", "décimo", "décimo-primeiro", + "décimo-segundo", "décimo-terceiro", "décimo-quarto", "décimo-quinto", + "décimo-sexto", "décimo-sétimo", "décimo-oitavo", "décimo-nono", + "vigésimo"] + +_level_name_female = [ "", "primeira", "segunda", "terceira", "quarta", "quinta", + "sexta", "sétima", "oitava", "nona", "décima", "décima-primeira", + "décima-segunda", "décima-terceira", "décima-quarta", "décima-quinta", + "décima-sexta", "décima-sétima", "décima-oitava", "décima-nona", + "vigésima"] + +_level_name_plural = [ "", "primeiros", "segundos", "terceiros", "quartos", + "quintos", "sextos", "sétimos", "oitavos", "nonos", + "décimos", "décimos-primeiros", "décimos-segundos", "décimos-terceiros", + "décimos-quartos", "décimos-quintos", "décimos-sextos", + "décimos-sétimos", "décimos-oitavos", "décimos-nonos", + "vigésimos", ] + +# This plugin tries to be flexible and expect little from the following +# tables. Ancestors are named from the list for the first generations. +# When this list is not enough, ordinals are used based on the same idea, +# i.e. bisavô is 'segundo avô' and so on, that has been the +# traditional way in Portuguese. When we run out of ordinals we resort to +# Nº notation, that is sort of understandable if in context. +# There is a specificity for pt_BR where they can use "tataravô" instead +# of "tetravô", being both forms correct for pt_BR but just "tetravô" +# correct for pt. Translation keeps "tetravô". +_parents_level = [ "", "pais", "avós", "bisavós", "trisavós", + "tetravós"] + +_father_level = [ "", "pai", "avô", "bisavô", "trisavô", + "tetravô"] + +_mother_level = [ "", "mãe", "avó", "bisavó", "trisavó", + "tetravó"] + +# Higher-order terms (after "tetravô") are not standard in Portuguese. +# Check http://www.geneall.net/P/forum_msg.php?id=136774 that states +# that although some people may use other greek-prefixed forms for +# higher levels, both pt and pt_BR correct form is to use, after +# "tetravô", the "quinto avô", "sexto avô", etc. + +_son_level = [ "", "filho", "neto", "bisneto", + "trisneto", ] + +_daughter_level = [ "", "filha", "neta", "bisneta", + "trisneta", ] + +_sister_level = [ "", "irmã", "tia", "tia avó", ] + +_brother_level = [ "", "irmão", "tio", "tio avô", ] + +_nephew_level = [ "", "sobrinho", "sobrinho neto", "sobrinho bisneto", ] + +_niece_level = [ "", "sobrinha", "sobrinha neta", "sobrinha bisneta", ] + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +class RelationshipCalculator(Relationship.RelationshipCalculator): + + def __init__(self,db): + Relationship.RelationshipCalculator.__init__(self,db) + + def get_male_cousin(self,level): + if level