Fix captialization

This commit is contained in:
Hillel Coren 2017-08-15 20:09:24 +03:00
parent 3c40cd460e
commit d31f23dcd3
3 changed files with 15 additions and 5 deletions

View File

@ -573,10 +573,20 @@ if (! defined('APP_NAME')) {
// Fix for mPDF: https://github.com/kartik-v/yii2-mpdf/issues/9 // Fix for mPDF: https://github.com/kartik-v/yii2-mpdf/issues/9
define('_MPDF_TTFONTDATAPATH', storage_path('framework/cache/')); define('_MPDF_TTFONTDATAPATH', storage_path('framework/cache/'));
// TODO remove these translation functions function uctrans($text, $data = [])
function uctrans($text)
{ {
return ucwords(trans($text)); $locale = Session::get(SESSION_LOCALE);
$text = trans($text, $data);
return $locale == 'en' ? ucwords($text) : $text;
}
function utrans($text, $data = [])
{
$locale = Session::get(SESSION_LOCALE);
$text = trans($text, $data);
return $locale == 'en' ? strtoupper($text) : $text;
} }
// optional trans: only return the string if it's translated // optional trans: only return the string if it's translated

View File

@ -28,7 +28,7 @@
@if ($account->hasCustomLabel('due_date')) @if ($account->hasCustomLabel('due_date'))
{{ $account->getLabel('due_date') }} {{ $account->formatDate($invoice->due_date) }} {{ $account->getLabel('due_date') }} {{ $account->formatDate($invoice->due_date) }}
@else @else
{{ strtoupper(trans('texts.due_by', ['date' => $account->formatDate($invoice->due_date)])) }} {{ utrans('texts.due_by', ['date' => $account->formatDate($invoice->due_date)]) }}
@endif @endif
@endif @endif
</span><br /> </span><br />

View File

@ -28,7 +28,7 @@
@if ($account->hasCustomLabel('due_date')) @if ($account->hasCustomLabel('due_date'))
{{ $account->getLabel('due_date') }} {{ $account->formatDate($invoice->due_date) }} {{ $account->getLabel('due_date') }} {{ $account->formatDate($invoice->due_date) }}
@else @else
{{ strtoupper(trans('texts.due_by', ['date' => $account->formatDate($invoice->due_date)])) }} {{ utrans('texts.due_by', ['date' => $account->formatDate($invoice->due_date)]) }}
@endif @endif
@endif @endif
</span><br /> </span><br />