# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2005  Donald N. Allingham
# Copyright (C) 2008       Brian G. Matherly
# Copyright (C) 2005-2012  Julio Sanchez
#
# 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 latr 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#-------------------------------------------------------------------------
"""
Spanish-specific classes for relationships.
"""

#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------

from gramps.gen.lib import Person
MALE = Person.MALE
FEMALE = Person.FEMALE
UNKNOWN = Person.UNKNOWN
import gramps.gen.rel
ationship

#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------

_level_name_male = [ "", "primero", "segundo", "tercero", "cuarto", "quinto",
                     "sexto", "séptimo", "octavo", "noveno", "décimo", "undécimo",
                     "duodécimo", "decimotercero", "decimocuarto", "decimoquinto",
               
      "decimosexto", "decimoséptimo", "decimoctavo", "decimonono",
                     "vigésimo" ]

# Short forms (in apocope) used before names
_level_name_male_a = [ "", "primer", "segundo", "tercer", "cuarto", "quinto",
                       "sexto", "séptimo", "octavo", "noveno", "décimo", "undécimo",
                       "duodécimo", "decimotercer", "decimocuarto", "decimoquinto",
                       "decimosexto", "decimoséptimo", "decimoctavo", "decimonono",
                       "vigésimo" ]

_level_name_female = [ "", "primera", "segunda", "tercera", "cuarta", "quinta",
                       "sexta", "séptima", "octava", "novena", "décima", "undécima",
                       "duodécima", "decimotercera", "decimocuarta", "decimoquinta",
                       "decimosexta", "decimoséptima", "decimoctava", "decimonona",
                       "vigésima" ]

_level_name_plural = [ "", "primeros", "segundos", "terceros", "cuartos",
                       "quintos", "sextos", "séptimos", "octavos", "novenos",
                       "décimos", "undécimos", "duodécimos", "decimoterceros",
                       "decimocuartos", "decimoquintos", "decimosextos",
                       "decimoséptimos", "decimoctavos", "decimononos",
                       "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. bisabuelo is 'segundo abuelo' and so on, that has been the
# traditional way in Spanish.  When we run out of ordinals we resort to
# N-ésimo notation, that is sort of understandable if in context.
# 'trastatarabuelo' is not in DRAE, but is well known
_parents_level = [ "", "padres",
                   "abuelos",
                   "bisabuelos",
                   "tatarabuelos",
                   "trastatarabuelos" ]

_father_level = [ "", "padre%(inlaw)s",
                  "abuelo%(inlaw)s",
                  "bisabuelo%(inlaw)s",
                  "tatarabuelo%(inlaw)s",
                  "trastatarabuelo%(inlaw)s"]

_mother_level = [ "", "madre%(inlaw)s",
                  "abuela%(inlaw)s",
                  "bisabuela%(inlaw)s",
                  "tatarabuela%(inlaw)s",
                  "trastatarabuela%(inlaw)s"]

# step-relationships can't be handled as in English
# Notice that the traditional lack of divorce in Catholic, Spanish-speaking, countries has resulted
# in a scarcity of terms to describe these relationships since only death of a spouse would let the
# other marry again. Divorce is common now, so these relationships abound, but history has left us
# without support in the language. So, in this case, we will be more liberal than in other cases and
# or coin a few new words or accept others that seem to have some use, but always patterned
# after the style of the well-documented cases, so that users can intuitively guess their meaning.
# Notice that "that relationship does not exist in Spanish" is not a valid objection. Once the Gramps
# core has computed a relationship, it *has* to be named *somehow*. The only alternative is to change
# the Gramps core so that it does not find relationships that cannot be named in Spanish.

_step_father_level = [ "", "padrastro%(inlaw)s",
                       "abuelastro%(inlaw)s" ]

_step_mother_level = [ "", "madrastra%(inlaw)s",
                       "abuelastra%(inlaw)s" ]

# Higher-order terms (after trastatarabuelo) on this list are not standard,
# but then there is no standard naming scheme at all for this in Spanish.
# Check http://www.genealogia-es.com/guia3.html that echoes a proposed
# scheme that has got some reception in the Spanish-language genealogy
# community. Uncomment these names if you want to use them.
#_parents_level = [ "", "padres", "abuelos", "bisabuelos", "tatarabuelos",
#                   "trastatarabuelos", "pentabuelos", "hexabuelos",
#                   "heptabuelos", "octabuelos", "eneabuelos", "decabuelos"]
#_father_level = [ "", "padre", "abuelo", "bisabuelo", "tatarabuelo",
#                  "trastatarabuelo", "pentabuelo", "hexabuelo",
#                  "heptabuelo", "octabuelo", "eneabuelo", "decabuelo"]
#_mother_level = [ "", "madre", "abuela", "bisabuela", "tatarabuela",
#                  "trastatarabuela", "pentabuela", "hexabuela",
#                  "heptabuela", "octabuela", "eneabuela", "decabuela"]

# DRAE defines cuadrinieto as well, with the same meaning as chozno
# trastataranieto is in use too, but is not in DRAE
# DRAE also registers bizchozno and bischozno, but prefers bichozno
_son_level = [ "", "hijo%(inlaw)s",
               "nieto%(inlaw)s",
               "bisnieto%(inlaw)s",
               "tataranieto%(inlaw)s",
               "chozno%(inlaw)s",
               "bichozno%(inlaw)s" ]

# Though "abuelastro" is in DRAE, "nietastro" isn't
_step_son_level = [ "", "hijastro%(inlaw)s",
                    "nietastro%(inlaw)s" ]

_daughter_level = [ "", "hija%(inlaw)s",
                    "nieta%(inlaw)s",
                    "bisnieta%(inlaw)s",
                    "tataranieta%(inlaw)s",
                    "chozna%(inlaw)s",
                    "bichozna%(inlaw)s" ]

_step_daughter_level = [ "", "hijastra%(inlaw)s",
                         "nietastra%(inlaw)s" ]

_sister_level = [ "", "hermana%(inlaw)s",
                  "tía%(inlaw)s",
                  "tía abuela%(inlaw)s",
                  "tía bisabuela%(inlaw)s",
                  "tía tatarabuela%(inlaw)s" ]

# Tiastro/tiastra aren't in DRAE
_step_sister_level = [ "", "hermanastra%(inlaw)s",
                       "tiastra%(inlaw)s",
                       "tía abuelastra%(inlaw)s" ]

_brother_level = [ "", "hermano%(inlaw)s",
                   "tío%(inlaw)s",
                   "tío abuelo%(inlaw)s",
                   "tío bisabuelo%(inlaw)s",
                   "tío tatarabuelo%(inlaw)s" ]

_step_brother_level = [ "", "hermanastro%(inlaw)s",
                        "tiastro%(inlaw)s",
                        "tío abuelastro%(inlaw)s" ]

_nephew_level = [ "", "sobrino%(inlaw)s",
                  "sobrino nieto%(inlaw)s",
                  "sobrino bisnieto%(inlaw)s",
                  "sobrino tataranieto%(inlaw)s",
                  "sobrino chozno%(inlaw)s",
                  "sobrino bichozno%(inlaw)s" ]

# Nether are sobr