1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-19 16:01:34 +02:00

Localization fixes

This commit is contained in:
Hillel Coren 2017-12-07 12:33:46 +02:00
parent 8aa5f09f6b
commit d1cb62b444
8 changed files with 37 additions and 12 deletions

View File

@ -3,6 +3,7 @@
namespace App\Models;
use Eloquent;
use Str;
/**
* Class Currency.
@ -28,4 +29,12 @@ class Currency extends Eloquent
{
return $this->name;
}
/**
* @return mixed
*/
public function getTranslatedName()
{
return trans('texts.currency_' . Str::slug($this->name, '_'));
}
}

View File

@ -3,6 +3,7 @@
namespace App\Models;
use Eloquent;
use Str;
/**
* Class InvoiceStatus.
@ -33,6 +34,14 @@ class InvoiceStatus extends Eloquent
return INVOICE_STATUS_UNPAID;
default:
return false;
}
}
}
/**
* @return mixed
*/
public function getTranslatedName()
{
return trans('texts.status_' . Str::slug($this->name, '_'));
}
}

View File

@ -178,7 +178,7 @@ class User extends Authenticatable
} elseif ($this->email) {
return $this->email;
} else {
return 'Guest';
return trans('texts.guest');
}
}

View File

@ -2609,6 +2609,7 @@ $LANG = array(
'copy_shipping' => 'Copy Shipping',
'copy_billing' => 'Copy Billing',
'quote_has_expired' => 'The quote has expired, please contact the merchant.',
'empty_table_footer' => 'Showing 0 to 0 of 0 entries',
);

View File

@ -55,7 +55,7 @@
{!! Former::select('expense_currency_id')->addOption('','')
->data_bind('combobox: expense_currency_id')
->label(trans('texts.currency_id'))
->data_placeholder(Utils::getFromCache($account->getCurrencyId(), 'currencies')->name)
->data_placeholder(Utils::getFromCache($account->getCurrencyId(), 'currencies')->getTranslatedName())
->fromQuery($currencies, 'name', 'id') !!}
@if (! $isRecurring)

View File

@ -124,6 +124,7 @@
"bInfo": true,
"oLanguage": {
'sEmptyTable': "{{ trans('texts.empty_table') }}",
'sInfoEmpty': "{{ trans('texts.empty_table_footer') }}",
'sLengthMenu': '_MENU_ {{ trans('texts.rows') }}',
'sInfo': "{{ trans('texts.datatable_info', ['start' => '_START_', 'end' => '_END_', 'total' => '_TOTAL_']) }}",
'sSearch': ''

View File

@ -138,6 +138,11 @@
var clientMap = {};
var invoiceMap = {};
var invoicesForClientMap = {};
var statuses = [];
@foreach (cache('invoiceStatus') as $status)
statuses[{{ $status->id }}] = "{{ $status->getTranslatedName() }}";
@endforeach
for (var i=0; i<clients.length; i++) {
var client = clients[i];
@ -323,7 +328,7 @@
var invoice = list[i];
var client = clientMap[invoice.client.public_id];
if (!client || !getClientDisplayName(client)) continue; // client is deleted/archived
$invoiceCombobox.append(new Option(invoice.invoice_number + ' - ' + invoice.invoice_status.name + ' - ' +
$invoiceCombobox.append(new Option(invoice.invoice_number + ' - ' + statuses[invoice.invoice_status.id] + ' - ' +
getClientDisplayName(client) + ' - ' + formatMoneyInvoice(invoice.amount, invoice) + ' | ' +
formatMoneyInvoice(invoice.balance, invoice), invoice.public_id));
}

View File

@ -36,19 +36,19 @@
<div id="tooltip" class="hidden">
<p>
<strong><span id="tooltipTitle"></span></strong>
<a class="pull-right" href="#" target="_blank">View</a>
<a class="pull-right" href="#" target="_blank">{{ trans('texts.view') }}</a>
</p>
<p>Total <span id="tooltipTotal" class="pull-right"></span></p>
<p>Balance <span id="tooltipBalance" class="pull-right"></span></p>
<p>Age <span id="tooltipAge" class="pull-right"></span></p>
<p>{{ trans('texts.total') }} <span id="tooltipTotal" class="pull-right"></span></p>
<p>{{ trans('texts.balance') }} <span id="tooltipBalance" class="pull-right"></span></p>
<p>{{ trans('texts.age') }} <span id="tooltipAge" class="pull-right"></span></p>
</div>
<form class="form-inline" role="form">
Group By &nbsp;&nbsp;
{{ trans('texts.group_by') }} &nbsp;&nbsp;
<select id="groupBySelect" class="form-control" onchange="update()" style="background-color:white !important">
<option>Clients</option>
<option>Invoices</option>
<option>Products</option>
<option>{{ trans('texts.clients') }}</option>
<option>{{ trans('texts.invoices') }}</option>
<option>{{ trans('texts.products') }}</option>
</select>
&nbsp;&nbsp; <b>{!! $message !!}</b>
</form>