1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00
This commit is contained in:
Hillel Coren 2016-12-09 12:35:49 +02:00
parent d8ff4a3c05
commit 954c04c917
5 changed files with 23 additions and 2 deletions

View File

@ -67,6 +67,7 @@ class MakeModule extends Command
Artisan::call('ninja:make-class', ['name' => $name, 'module' => $name, 'class' => 'request', 'prefix' => 'update']);
Artisan::call('ninja:make-class', ['name' => $name, 'module' => $name, 'class' => 'api-controller']);
Artisan::call('ninja:make-class', ['name' => $name, 'module' => $name, 'class' => 'transformer', '--fields' => $fields]);
Artisan::call('ninja:make-class', ['name' => $name, 'module' => $name, 'class' => 'lang', '--filename' => 'texts']);
if ($migrate) {
Artisan::call('module:migrate', ['module' => $name]);

View File

@ -0,0 +1,10 @@
<?php
$LANG = array(
'$LOWER_NAME$' => '$STUDLY_NAME$',
);
return $LANG;
?>

View File

@ -908,6 +908,16 @@ if (!defined('CONTACT_EMAIL')) {
return $string != $english ? $string : '';
}
}
// include modules in translations
function mtrans($entityType, $text)
{
if ( ! Utils::isNinjaProd() && $module = Module::find($entityType)) {
return trans("{$module->getLowerName()}::texts.{$text}");
} else {
return trans("texts.{$text}");
}
}
}

View File

@ -105,7 +105,7 @@ return [
'filter' => 'Http/Middleware',
'request' => 'Http/Requests',
'provider' => 'Providers',
'lang' => 'Resources/lang',
'lang' => 'Resources/lang/en',
'views' => 'Resources/views',
'test' => 'Tests',
'jobs' => 'Jobs',

View File

@ -20,7 +20,7 @@
style="font-size:16px; padding-top:6px; padding-bottom:6px"
class="{{ Request::is("{$option}*") ? 'active' : '' }}">
<i class="fa fa-{{ empty($icon) ? \App\Models\EntityModel::getIcon($option) : $icon }}" style="width:46px; padding-right:10px"></i>
{{ ($option == 'recurring_invoices') ? trans('texts.recurring') : trans("texts.{$option}") }}
{{ ($option == 'recurring_invoices') ? trans('texts.recurring') : mtrans($option, $option) }}
{!! Utils::isTrial() && in_array($option, ['quotes', 'tasks', 'expenses', 'vendors']) ? '&nbsp;<sup>' . trans('texts.pro') . '</sup>' : '' !!}
</a>