summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2011-02-22 18:40:48 +0000
committerfisharebest <fisharebest@gmail.com>2011-02-22 18:40:48 +0000
commit8d249016a8ab99045cae5bbd2101e8fc477142ca (patch)
treedb5c23b4d711759e79059fcb520d9cd47922617c
parent2174bb15596cb7dcbbc9b74b4964392703c113df (diff)
downloadwebtrees-8d249016a8ab99045cae5bbd2101e8fc477142ca.tar.gz
webtrees-8d249016a8ab99045cae5bbd2101e8fc477142ca.tar.bz2
webtrees-8d249016a8ab99045cae5bbd2101e8fc477142ca.zip
For events "1 EVEN/2 TYPE XXXX", where XXXX is a gedcom fact, translate it.
-rw-r--r--includes/functions/functions_print_facts.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/includes/functions/functions_print_facts.php b/includes/functions/functions_print_facts.php
index 2243b629e3..af4ca46719 100644
--- a/includes/functions/functions_print_facts.php
+++ b/includes/functions/functions_print_facts.php
@@ -147,7 +147,9 @@ function print_fact(&$eventObj) {
echo "<div class=\"copylink\"><a onclick=\"return copy_record('$pid', $linenum);\" href=\"javascript:;\" title=\"".WT_I18N::translate('Copy')."\"><span class=\"link_text\">".WT_I18N::translate('Copy')."</span></a></div>";
echo "<div class=\"deletelink\"><a onclick=\"return delete_record('$pid', $linenum);\" href=\"javascript:;\" title=\"".WT_I18N::translate('Delete')."\"><span class=\"link_text\">".WT_I18N::translate('Delete')."</span></a></div>";
echo "</div>";
- } else {echo translate_fact($factref, $label_person);}
+ } else {
+ echo translate_fact($factref, $label_person);
+ }
if ($fact=="_BIRT_CHIL") echo "<br />", WT_I18N::translate('#%d', $n_chil++);
if (preg_match("/_BIRT_GCH[I12]/", $fact)) echo "<br />", WT_I18N::translate('#%d', $n_gchi++);
echo "</td>";
@@ -155,10 +157,17 @@ function print_fact(&$eventObj) {
if ($fact == "OBJE") return false;
// -- find generic type for each fact
$ct = preg_match("/2 TYPE (.*)/", $factrec, $match);
- if ($ct>0) $factref = trim($match[1]);
- else $factref = $fact;
- if ($styleadd=="") $rowID = "row_".floor(microtime()*1000000);
- else $rowID = "row_".$styleadd;
+ if ($ct>0) {
+ // Some users (just Meliza?) use "1 EVEN/2 TYPE BIRT". Translate the TYPE, if we can.
+ $factref = strip_tags(translate_fact($match[1], $label_person));
+ } else {
+ $factref = $fact;
+ }
+ if ($styleadd=="") {
+ $rowID = "row_".floor(microtime()*1000000);
+ } else {
+ $rowID = "row_".$styleadd;
+ }
echo "<tr class=\"", $rowID, "\">";
echo "<td class=\"descriptionbox $styleadd width20\">";
if ($SHOW_FACT_ICONS)