summaryrefslogtreecommitdiff
path: root/app/Fact.php
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2020-05-26 17:00:03 +0100
committerGreg Roach <greg@subaqua.co.uk>2020-05-26 17:00:03 +0100
commit18475794c1ca3ea0fd2d6eafbbf938ff2a4d386a (patch)
tree2e9c7314b2ddcb0eebc24438ae2e7625f91f323b /app/Fact.php
parentcb8614c7e10fcd22e3507379eec69f8d1b0334b6 (diff)
downloadwebtrees-18475794c1ca3ea0fd2d6eafbbf938ff2a4d386a.tar.gz
webtrees-18475794c1ca3ea0fd2d6eafbbf938ff2a4d386a.tar.bz2
webtrees-18475794c1ca3ea0fd2d6eafbbf938ff2a4d386a.zip
Fix: #1194 - inconsistent case in MARR:TYPE keywords
Diffstat (limited to 'app/Fact.php')
-rw-r--r--app/Fact.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/app/Fact.php b/app/Fact.php
index 6f76400a56..b4d2215fea 100644
--- a/app/Fact.php
+++ b/app/Fact.php
@@ -75,10 +75,6 @@ class Fact
'_MARI',
'_MBON',
'MARR',
- 'MARR_CIVIL',
- 'MARR_RELIGIOUS',
- 'MARR_PARTNERS',
- 'MARR_UNKNOWN',
'_COML',
'_STAT',
'_SEPR',
@@ -466,11 +462,22 @@ class Fact
public function label(): string
{
// Custom FACT/EVEN - with a TYPE
- if (($this->tag === 'FACT' || $this->tag === 'EVEN') && $this->attribute('TYPE') !== '') {
- return I18N::translate(e($this->attribute('TYPE')));
+ if ($this->tag === 'FACT' || $this->tag === 'EVEN') {
+ $type = $this->attribute('TYPE');
+
+ if ($type !== '') {
+ // Allow user-translations of custom types.
+ $translated = I18N::translate($type);
+
+ if ($translated !== $type) {
+ return $translated;
+ }
+
+ return e($type);
+ }
}
- return GedcomTag::getLabel($this->tag);
+ return GedcomTag::getLabel($this->record::RECORD_TYPE . ':' . $this->tag);
}
/**