summaryrefslogtreecommitdiff
path: root/includes/functions
diff options
context:
space:
mode:
authorŁukasz Wilenski <wooc@gazeta.pl>2010-04-21 17:58:37 +0000
committerŁukasz Wilenski <wooc@gazeta.pl>2010-04-21 17:58:37 +0000
commitd8bd83ca3b396b8bd18225e86d8a0cbb810979c1 (patch)
tree72ad52073f4a689339458670d593f3a4d4c2d29b /includes/functions
parent493d751f529813324f2c91e17d915e93bab1f4e3 (diff)
downloadwebtrees-d8bd83ca3b396b8bd18225e86d8a0cbb810979c1.tar.gz
webtrees-d8bd83ca3b396b8bd18225e86d8a0cbb810979c1.tar.bz2
webtrees-d8bd83ca3b396b8bd18225e86d8a0cbb810979c1.zip
I18N
Diffstat (limited to 'includes/functions')
-rw-r--r--includes/functions/functions_print_facts.php26
-rw-r--r--includes/functions/functions_print_lists.php26
2 files changed, 18 insertions, 34 deletions
diff --git a/includes/functions/functions_print_facts.php b/includes/functions/functions_print_facts.php
index 658085c1a3..b977d53684 100644
--- a/includes/functions/functions_print_facts.php
+++ b/includes/functions/functions_print_facts.php
@@ -99,9 +99,16 @@ function print_fact(&$eventObj, $noedit=false) {
if (preg_match('/2 ASSO @('.WT_REGEX_XREF.')@/', $factrec, $match)) {
// Event of close relative
$label_person=Person::getInstance($match[1]);
- } elseif (preg_match('/2 _PGVS @('.WT_REGEX_XREF.')@/', $factrec, $match)) {
+ } else if (preg_match('/2 _PGVS @('.WT_REGEX_XREF.')@/', $factrec, $match)) {
// Event of close relative
$label_person=Person::getInstance($match[1]);
+ } else if ($parent instanceof Family) {
+ // Family event
+ $husb = $parent->getHusband();
+ $wife = $parent->getWife();
+ if (empty($wife) && !empty($husb)) $label_person=$husb;
+ else if (empty($husb) && !empty($wife)) $label_person=$wife;
+ else $label_person=$parent;
} else {
// The actual person
$label_person=$parent;
@@ -129,23 +136,6 @@ function print_fact(&$eventObj, $noedit=false) {
// Assume that all recognised tags are translated.
// -- handle generic facts
if ($fact!="EVEN" && $fact!="FACT" && $fact!="OBJE") {
- if ($fact=="_NMR") {
- // Allow special processing for different languages
- $func="fact_NMR_localisation_".WT_LOCALE;
- if (function_exists($func)) {
- // Localise the _NMR facts
- $fact = $func($fact, $pid);
- }
- }
- $explode_fact = explode("_", $fact);
- if (!empty($explode_fact[1]) && !empty($explode_fact[2])) {
- // Allow special processing for different languages
- $func="cr_facts_localisation_".WT_LOCALE;
- if (function_exists($func)) {
- // Localise close relatives facts
- $func($factrec, $fact, $explode_fact, $pid);
- }
- }
$factref = $fact;
if (!$eventObj->canShow()) return false;
if ($styleadd=="") $rowID = "row_".floor(microtime()*1000000);
diff --git a/includes/functions/functions_print_lists.php b/includes/functions/functions_print_lists.php
index 068806d328..4cbb18b957 100644
--- a/includes/functions/functions_print_lists.php
+++ b/includes/functions/functions_print_lists.php
@@ -660,23 +660,17 @@ function print_fam_table($datalist, $legend="", $option="") {
$marr_by_decade[floor($marriage_dates[0]->gregorianYear()/10)*10] .= $husb->getSex().$wife->getSex();
}
} else if (get_sub_record(1, "1 _NMR", $family->getGedcomRecord())) {
- // Allow special processing for different languages
- $func="fact_NMR_localisation_".WT_LOCALE;
- if (function_exists($func)) {
- // Localise the _NMR facts
- echo '<div>', i18n::translate($func("_NMR", $family->getXref())), '<a name="9999999"></a></div>';
- } else {
- echo '<div>', i18n::translate('_NMR'), '<a name="9999999"></a></div>';
- }
+ $husb = $family->getHusband();
+ $wife = $family->getWife();
+ if (empty($wife) && !empty($husb)) echo translate_fact('_NMR', $husb);
+ else if (empty($husb) && !empty($wife)) echo translate_fact('_NMR', $wife);
+ else echo translate_fact('_NMR');
} else if (get_sub_record(1, "1 _NMAR", $family->getGedcomRecord())) {
- // Allow special processing for different languages
- $func="fact_NMR_localisation_".WT_LOCALE;
- if (function_exists($func)) {
- // Localise the _NMR facts
- echo '<div>', i18n::translate($func("_NMAR", $family->getXref())), '<a name="9999999"></a></div>';
- } else {
- echo '<div>', i18n::translate('_NMAR'), '<a name="9999999"></a></div>';
- }
+ $husb = $family->getHusband();
+ $wife = $family->getWife();
+ if (empty($wife) && !empty($husb)) echo translate_fact('_NMAR', $husb);
+ else if (empty($husb) && !empty($wife)) echo translate_fact('_NMAR', $wife);
+ else echo translate_fact('_NMAR');
} else {
$factdetail = explode(' ', trim($family->getMarriageRecord()));
if (isset($factdetail)) {