From 0fccf69e62f856e6171ab9fd930f527c7d55b07b Mon Sep 17 00:00:00 2001 From: Christopher Di Carlo Date: Mon, 21 Oct 2019 22:29:22 -0400 Subject: [PATCH] Allow module trans helper to replace values (#3006) --- app/Constants.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Constants.php b/app/Constants.php index 9b6f812c6b..cc0a6a718f 100644 --- a/app/Constants.php +++ b/app/Constants.php @@ -759,7 +759,7 @@ if (! defined('APP_NAME')) { } // include modules in translations - function mtrans($entityType, $text = false) + function mtrans($entityType, $text = false, $replace = []) { if (! $text) { $text = $entityType; @@ -768,7 +768,7 @@ if (! defined('APP_NAME')) { // check if this has been translated in a module language file if (! Utils::isNinjaProd() && $module = Module::find($entityType)) { $key = "{$module->getLowerName()}::texts.{$text}"; - $value = trans($key); + $value = trans($key, $replace); if ($key != $value) { return $value; }