mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Allow module trans helper to replace values (#3006)
This commit is contained in:
parent
429f079cf5
commit
0fccf69e62
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user