From 0142511a1051f465aefed258cbb14d2932143d89 Mon Sep 17 00:00:00 2001 From: Jacson Passold Date: Thu, 24 May 2018 11:50:32 -0300 Subject: [PATCH] add support to i18n to mappers props --- src/exposers/class-tainacan-exposers.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/exposers/class-tainacan-exposers.php b/src/exposers/class-tainacan-exposers.php index 403b39ff1..836201468 100644 --- a/src/exposers/class-tainacan-exposers.php +++ b/src/exposers/class-tainacan-exposers.php @@ -37,7 +37,7 @@ class Exposers { add_filter( 'rest_request_after_callbacks', [$this, 'rest_request_after_callbacks'], 10, 3 ); //exposer mapping add_filter( 'tainacan-rest-response', [$this, 'rest_response'], 10, 2 ); // exposer types - add_filter( 'tainacan-js-i18n', [$this, 'mappers_i18n']); + add_filter( 'tainacan-admin-i18n', [$this, 'mappers_i18n']); } /** @@ -233,10 +233,16 @@ class Exposers { return false; // No mapper need, using Tainacan defautls } + /** + * Add mappers data to translations + * @param array $i18n_strings + * @return array + */ public function mappers_i18n($i18n_strings) { foreach ($this->mappers as $mapper) { $obj = new $mapper; - $i18n_strings[$obj->slug] = $obj->slug; + $i18n_strings[$obj->slug] = $obj->slug; // For url breadcrumb translations + $i18n_strings[$obj->name] = $obj->name; } return $i18n_strings; }