mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Adding translation support for languages
- Languages can now be translated via texts.php
This commit is contained in:
parent
19b443d641
commit
a114f60127
@ -393,7 +393,6 @@ class AccountController extends BaseController
|
||||
'dateFormats' => Cache::get('dateFormats'),
|
||||
'datetimeFormats' => Cache::get('datetimeFormats'),
|
||||
'currencies' => Cache::get('currencies'),
|
||||
'languages' => Cache::get('languages'),
|
||||
'title' => trans('texts.localization'),
|
||||
];
|
||||
|
||||
|
@ -206,7 +206,6 @@ class ClientController extends BaseController
|
||||
'sizes' => Cache::get('sizes'),
|
||||
'paymentTerms' => Cache::get('paymentTerms'),
|
||||
'currencies' => Cache::get('currencies'),
|
||||
'languages' => Cache::get('languages'),
|
||||
'customLabel1' => Auth::user()->account->custom_client_label1,
|
||||
'customLabel2' => Auth::user()->account->custom_client_label2,
|
||||
];
|
||||
|
@ -369,7 +369,6 @@ class InvoiceController extends BaseController
|
||||
'taxRateOptions' => $options,
|
||||
'defaultTax' => $defaultTax,
|
||||
'currencies' => Cache::get('currencies'),
|
||||
'languages' => Cache::get('languages'),
|
||||
'sizes' => Cache::get('sizes'),
|
||||
'paymentTerms' => Cache::get('paymentTerms'),
|
||||
'invoiceDesigns' => InvoiceDesign::getDesigns(),
|
||||
|
@ -39,5 +39,10 @@ class TranslationComposer
|
||||
return $pType->name;
|
||||
}));
|
||||
|
||||
$view->with('languages', Cache::get('languages')->each(function ($lang) {
|
||||
$lang->name = trans('texts.lang_'.$lang->name);
|
||||
})->sortBy(function ($lang) {
|
||||
return $lang->name;
|
||||
}));
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@ class ComposerServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
view()->composer(
|
||||
['accounts.details', 'clients.edit', 'payments.edit', 'invoices.edit'],
|
||||
['accounts.details', 'clients.edit', 'payments.edit', 'invoices.edit', 'accounts.localization'],
|
||||
'App\Http\ViewComposers\TranslationComposer'
|
||||
);
|
||||
}
|
||||
|
@ -1674,6 +1674,24 @@ $LANG = array(
|
||||
'country_Yemen' => '',
|
||||
'country_Zambi' => '',
|
||||
|
||||
// Languages
|
||||
'lang_Brazilian Portuguese' => 'Brazilian Portuguese',
|
||||
'lang_Croatian' => 'Kroatisch',
|
||||
'lang_Czech' => 'Tschechisch',
|
||||
'lang_Danish' => 'Dänisch',
|
||||
'lang_Dutch' => 'Niederländisch',
|
||||
'lang_English' => 'Englisch',
|
||||
'lang_French' => 'Französisch',
|
||||
'lang_French - Canada' => 'French - Canada',
|
||||
'lang_German' => 'Deutsch',
|
||||
'lang_Italian' => 'Italian',
|
||||
'lang_Japanese' => 'Japanese',
|
||||
'lang_Lithuanian' => 'Lithuanian',
|
||||
'lang_Norwegian' => 'Norwegian',
|
||||
'lang_Polish' => 'Polish',
|
||||
'lang_Spanish' => 'Spanish',
|
||||
'lang_Spanish - Spain' => 'Spanish - Spain',
|
||||
'lang_Swedish' => 'Swedish',
|
||||
);
|
||||
|
||||
return $LANG;
|
||||
|
@ -1674,6 +1674,25 @@ $LANG = array(
|
||||
'country_Yemen' => 'Yemen',
|
||||
'country_Zambi' => 'Zambi',
|
||||
|
||||
// Languages
|
||||
'lang_Brazilian Portuguese' => 'Brazilian Portuguese',
|
||||
'lang_Croatian' => 'Croatian',
|
||||
'lang_Czech' => 'Czech',
|
||||
'lang_Danish' => 'Danish',
|
||||
'lang_Dutch' => 'Dutch',
|
||||
'lang_English' => 'English',
|
||||
'lang_French' => 'French',
|
||||
'lang_French - Canada' => 'French - Canada',
|
||||
'lang_German' => 'German',
|
||||
'lang_Italian' => 'Italian',
|
||||
'lang_Japanese' => 'Japanese',
|
||||
'lang_Lithuanian' => 'Lithuanian',
|
||||
'lang_Norwegian' => 'Norwegian',
|
||||
'lang_Polish' => 'Polish',
|
||||
'lang_Spanish' => 'Spanish',
|
||||
'lang_Spanish - Spain' => 'Spanish - Spain',
|
||||
'lang_Swedish' => 'Swedish',
|
||||
|
||||
// Frequencies
|
||||
'freq_weekly' => 'Weekly',
|
||||
'freq_two_weeks' => 'Two weeks',
|
||||
|
@ -122,7 +122,7 @@
|
||||
->placeholder($account->currency ? $account->currency->name : '')
|
||||
->fromQuery($currencies, 'name', 'id') !!}
|
||||
{!! Former::select('language_id')->addOption('','')
|
||||
->placeholder($account->language ? $account->language->name : '')
|
||||
->placeholder($account->language ? trans('texts.lang_'.$account->language->name) : '')
|
||||
->fromQuery($languages, 'name', 'id') !!}
|
||||
{!! Former::select('payment_terms')->addOption('','')
|
||||
->fromQuery($paymentTerms, 'name', 'num_days')
|
||||
|
Loading…
Reference in New Issue
Block a user