]> Nutra Git (v1) - gamesguru/getmyancestors.git/commitdiff
Add events: Stillborn, Bar Mitzvah, Bat Mitzvah, Naturalization, Residence, Affiliati...
authorBenoît Fontaine <benoitfontaine.ba@gmail.com>
Tue, 19 Dec 2017 09:23:30 +0000 (10:23 +0100)
committerBenoît Fontaine <benoitfontaine.ba@gmail.com>
Tue, 19 Dec 2017 09:23:30 +0000 (10:23 +0100)
fsearch_translation.py
getmyancestors.py
mergemyancestors.py

index cca1fa6cae5eb8ced0e3a8e8d0fc38ca8d3ca9c6..d899bed77a1aed89e596cecc09401ce84952b5b8 100644 (file)
@@ -22,5 +22,77 @@ translations = {
         "pt": "Colaboradores",
         "ru": "Авторы",
         "zh": "贡献者"
-    }
+    },
+    "Stillborn": {
+        "de": "Tot geboren",
+        "eo": "[Šţîļļƀöŕñ----------- П國カ내]",
+        "es": "Nacido muerto o mortinato",
+        "fr": "Mort-né(e)",
+        "it": "Nato morto",
+        "ja": "死産",
+        "ko": "사산아",
+        "pt": "Natimorto",
+        "ru": "Мертворожденный",
+        "zh": "死胎"
+    },
+    "Affiliation": {
+        "de": "Zugehörigkeit",
+        "eo": "[Ńƒîļîåţîöñ---- П國カ내]",
+        "es": "Afiliación",
+        "fr": "Affiliation",
+        "it": "Affiliazione",
+        "ja": "所属",
+        "ko": "소속",
+        "pt": "Afiliação",
+        "ru": "Принадлежность",
+        "zh": "所屬團體"
+    },
+    "Clan Name": {
+        "de": "Bezeichnung des Clans",
+        "eo": "[Çļåñ Ñåɱé----------- П國カ내]",
+        "es": "Nombre del clan",
+        "fr": "Nom de clan",
+        "it": "Nome clan",
+        "ja": "氏族名",
+        "ko": "씨족 이름",
+        "pt": "Nome do Clã",
+        "ru": "Название клана",
+        "zh": "氏族名字"
+    },
+    "National Identification": {
+        "de": "Ausweisnummer",
+        "eo": "[Ñåţîöñåļ Îðéñţîƒîçåţîöñ----------- П國カ내]",
+        "es": "Identificación nacional",
+        "fr": "Numéro national d’identification",
+        "it": "Documento di identità",
+        "ja": "国民登録番号",
+        "ko": "주민등록번호",
+        "pt": "Carteira de Identidade Nacional",
+        "ru": "Удостоверение личности",
+        "zh": "國民身分證"
+    },
+    "Race": {
+        "de": "Ethnische Zugehörigkeit",
+        "eo": "[Ŕåçé- П國カ내]",
+        "es": "Raza",
+        "fr": "Race",
+        "it": "Razza",
+        "ja": "人種",
+        "ko": "인종",
+        "pt": "Raça",
+        "ru": "Раса",
+        "zh": "種族"
+    },
+    "Tribe Name": {
+        "de": "Bezeichnung des Stammes",
+        "eo": "[Ţŕîƀé Ñåɱé------------- П國カ내]",
+        "es": "Nombre de la tribu",
+        "fr": "Nom de tribu",
+        "it": "Nome tribù",
+        "ja": "部族名",
+        "ko": "부족명",
+        "pt": "Nome da Tribo",
+        "ru": "Название племени",
+        "zh": "部落名字"
+    },
 }
index bd8ac13c1db8ea36db0800920f06c402155fcff9..062fb1be630e4c7899484218a39309a6a4025c18 100755 (executable)
@@ -47,7 +47,25 @@ FACT_TAGS = {
     'http://gedcomx.org/Marriage': 'MARR',
     'http://gedcomx.org/Divorce': 'DIV',
     'http://gedcomx.org/Annulment': 'ANUL',
-    'http://gedcomx.org/CommonLawMarriage': '_COML'
+    'http://gedcomx.org/CommonLawMarriage': '_COML',
+    'http://gedcomx.org/BarMitzvah': 'BARM',
+    'http://gedcomx.org/BatMitzvah': 'BASM',
+    'http://gedcomx.org/Naturalization': 'NATU',
+    'http://gedcomx.org/Residence': 'RESI',
+    'http://gedcomx.org/Religion': 'RELI',
+    'http://familysearch.org/v1/TitleOfNobility': 'TITL',
+    'http://gedcomx.org/Cremation': 'CREM',
+    'http://gedcomx.org/Caste': 'CAST',
+    'http://gedcomx.org/Nationality': 'NATI',
+}
+
+FACT_EVEN = {
+    'http://gedcomx.org/Stillbirth': 'Stillborn',
+    'http://familysearch.org/v1/Affiliation': 'Affiliation',
+    'http://gedcomx.org/Clan': 'Clan Name',
+    'http://gedcomx.org/NationalId': 'National Identification',
+    'http://gedcomx.org/Ethnicity': 'Race',
+    'http://familysearch.org/v1/TribeName': 'Tribe Name'
 }
 
 
@@ -321,24 +339,32 @@ class Fact:
                 self.value = data['value']
             if 'type' in data:
                 self.type = data['type']
+                if self.type in FACT_EVEN:
+                    self.type = tree.fs._(FACT_EVEN[self.type])
+                elif self.type[:6] == u'data:,':
+                    self.type = self.type[6:]
+                elif self.type not in FACT_TAGS:
+                    self.type = None
             if 'date' in data:
                 self.date = data['date']['original']
             if 'place' in data:
                 self.place = data['place']['original']
             if 'changeMessage' in data['attribution']:
                 self.note = Note(data['attribution']['changeMessage'], tree)
-            if self.type == 'http://gedcomx.org/Death' and not any([self.date, self.place]):
+            if self.type == 'http://gedcomx.org/Death' and not (self.date or self.place):
                 self.value = 'Y'
 
     def print(self, file=sys.stdout, key=None):
         if self.type in FACT_TAGS:
             file.write('1 ' + FACT_TAGS[self.type])
-        elif self.type[:6] == u'data:,':
-            file.write('1 EVEN\n2 TYPE ' + self.type[6:] + '\n2 NOTE Description:')
+            if self.value:
+                file.write(' ' + self.value)
+        elif self.type:
+            file.write('1 EVEN\n2 TYPE ' + self.type)
+            if self.value:
+                file.write('\n2 NOTE Description: ' + self.value)
         else:
             return
-        if self.value:
-            file.write(' ' + self.value)
         file.write('\n')
         if self.date:
             file.write('2 DATE ' + self.date + '\n')
index 2f12e65456fa399a835b529ce9899dd5457193e5..dff90c44b6bed993a0405e738698894b318fb36a 100755 (executable)
@@ -225,20 +225,25 @@ class Gedcom:
 
     def __get_fact(self):
         fact = Fact()
-        if self.tag == 'EVEN':
-            self.__get_line()
-            fact.type = 'data:,' + self.data
-            self.__get_line()
-            fact.value = self.data[12:]
-        else:
+        if self.tag == 'EVEN':
+            self.__get_line()
+        #     fact.type = self.data
+            self.__get_line()
+            fact.value = self.data[12:]
+        if self.tag != 'EVEN':
             fact.type = FACT_TYPES[self.tag]
             fact.value = self.data
         while self.__get_line() and self.level > 1:
+            if self.tag == 'TYPE':
+                fact.type = self.data
             if self.tag == 'DATE':
                 fact.date = self.data
             elif self.tag == 'PLAC':
                 fact.place = self.data
             elif self.tag == 'NOTE':
+                if self.data[:12] == 'Description:':
+                    fact.value = self.data[13:]
+                    continue
                 num = int(self.data[2:len(self.data) - 1])
                 if num not in self.note:
                     self.note[num] = Note(tree=self.tree, num=num)