diff --git a/src/classes/mappers/class-tainacan-dublin-core.php b/src/classes/mappers/class-tainacan-dublin-core.php index 6563765ae..23692ed55 100644 --- a/src/classes/mappers/class-tainacan-dublin-core.php +++ b/src/classes/mappers/class-tainacan-dublin-core.php @@ -16,56 +16,6 @@ class Dublin_Core extends Mapper { public $prefixes = [ 'dc' => 'http://purl.org/dc/elements/1.1/' ]; - public $metadata = [ - 'dc:contributor' => [ - 'label' => 'Contributor' - ], - 'dc:coverage' => [ - 'label' => 'Coverage' - ], - 'dc:creator' => [ - 'label' => 'Creator', - ], - 'dc:date' => [ - 'label' => 'Date', - 'metadata_type' => 'date' - ], - 'dc:description' => [ - 'label' => 'Description', - 'core_metadatum' => 'description' - ], - 'dc:format' => [ - 'label' => 'Format', - ], - 'dc:identifier' => [ - 'label' => 'Identifier' - ], - 'dc:language' => [ - 'label' => 'Language' - ], - 'dc:publisher' => [ - 'label' => 'Publisher' - ], - 'dc:relation' => [ - 'label' => 'Relation' - ], - 'dc:rights' => [ - 'label' => 'Rights' - ], - 'dc:source' => [ - 'label' => 'Source' - ], - 'dc:subject' => [ - 'label' => 'Subject' - ], - 'dc:title' => [ - 'label' => 'Title', - 'core_metadatum' => 'title' - ], - 'dc:type' => [ - 'label' => 'Type' - ] - ]; /** XML especial case **/ const XML_DC_NAMESPACE = 'http://purl.org/dc/elements/1.1/'; @@ -73,5 +23,76 @@ class Dublin_Core extends Mapper { public $XML_namespace = 'http://purl.org/dc/elements/1.1/'; public $XML_append_root = 'rdf:Description'; /** END: XML especial case **/ + + function __construct() { + parent::__construct(); + + /* Metadata should be set here to allow translable labels */ + $this->metadata = [ + 'dc:contributor' => [ + /* translators: Label for the dc:contributor field in the Dublin Core standard */ + 'label' => __( 'Contributor', 'tainacan') + ], + 'dc:coverage' => [ + /* translators: Label for the dc:coverage field in the Dublin Core standard */ + 'label' => __( 'Coverage', 'tainacan') + ], + 'dc:creator' => [ + /* translators: Label for the dc:creator field in the Dublin Core standard */ + 'label' => __( 'Creator', 'tainacan') + ], + 'dc:date' => [ + /* translators: Label for the dc:date field in the Dublin Core standard */ + 'label' => __( 'Date', 'tainacan'), + 'metadata_type' => 'date' + ], + 'dc:description' => [ + /* translators: Label for the dc:description field in the Dublin Core standard */ + 'label' => __( 'Description', 'tainacan'), + 'core_metadatum' => 'description' + ], + 'dc:format' => [ + /* translators: Label for the dc:format field in the Dublin Core standard */ + 'label' => __( 'Format', 'tainacan') + ], + 'dc:identifier' => [ + /* translators: Label for the dc:identifier field in the Dublin Core standard */ + 'label' => __( 'Identifier', 'tainacan') + ], + 'dc:language' => [ + /* translators: Label for the dc:language field in the Dublin Core standard */ + 'label' => __( 'Language', 'tainacan') + ], + 'dc:publisher' => [ + /* translators: Label for the dc:publisher field in the Dublin Core standard */ + 'label' => __( 'Publisher', 'tainacan') + ], + 'dc:relation' => [ + /* translators: Label for the dc:relation field in the Dublin Core standard */ + 'label' => __( 'Relation', 'tainacan') + ], + 'dc:rights' => [ + /* translators: Label for the dc:rights field in the Dublin Core standard */ + 'label' => __( 'Rights', 'tainacan') + ], + 'dc:source' => [ + /* translators: Label for the dc:source field in the Dublin Core standard */ + 'label' => __( 'Source', 'tainacan') + ], + 'dc:subject' => [ + /* translators: Label for the dc:subject field in the Dublin Core standard */ + 'label' => __( 'Subject', 'tainacan') + ], + 'dc:title' => [ + /* translators: Label for the dc:title field in the Dublin Core standard */ + 'label' => __( 'Title', 'tainacan'), + 'core_metadatum' => 'title' + ], + 'dc:type' => [ + /* translators: Label for the dc:type field in the Dublin Core standard */ + 'label' => __( 'Type', 'tainacan') + ] + ]; + } } \ No newline at end of file diff --git a/src/classes/mappers/class-tainacan-mapper.php b/src/classes/mappers/class-tainacan-mapper.php index 05f1eb322..f637a6eea 100644 --- a/src/classes/mappers/class-tainacan-mapper.php +++ b/src/classes/mappers/class-tainacan-mapper.php @@ -66,4 +66,5 @@ abstract class Mapper { return $url; } + function __construct() {} } \ No newline at end of file