1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

Fix translation of currencies and countries

This commit is contained in:
Hillel Coren 2017-07-24 18:04:25 +03:00
parent f31b03717d
commit 89bb0bd23f
10 changed files with 77 additions and 25 deletions

View File

@ -423,7 +423,6 @@ class AccountController extends BaseController
'timezones' => Cache::get('timezones'),
'dateFormats' => Cache::get('dateFormats'),
'datetimeFormats' => Cache::get('datetimeFormats'),
'currencies' => Cache::get('currencies'),
'title' => trans('texts.localization'),
'weekdays' => Utils::getTranslatedWeekdayNames(),
'months' => Utils::getMonthOptions(),

View File

@ -191,7 +191,6 @@ class ClientController extends BaseController
'data' => Input::old('data'),
'account' => Auth::user()->account,
'sizes' => Cache::get('sizes'),
'currencies' => Cache::get('currencies'),
'customLabel1' => Auth::user()->account->custom_client_label1,
'customLabel2' => Auth::user()->account->custom_client_label2,
];

View File

@ -289,14 +289,6 @@ class ExpenseController extends BaseController
return [
'data' => Input::old('data'),
'account' => Auth::user()->account,
'sizes' => Cache::get('sizes'),
'paymentTerms' => Cache::get('paymentTerms'),
'industries' => Cache::get('industries'),
'currencies' => Cache::get('currencies'),
'languages' => Cache::get('languages'),
'countries' => Cache::get('countries'),
'customLabel1' => Auth::user()->account->custom_vendor_label1,
'customLabel2' => Auth::user()->account->custom_vendor_label2,
'categories' => ExpenseCategory::whereAccountId(Auth::user()->account_id)->withArchived()->orderBy('name')->get(),
'taxRates' => TaxRate::scope()->whereIsInclusive(false)->orderBy('name')->get(),
'isRecurring' => false,

View File

@ -305,7 +305,6 @@ class InvoiceController extends BaseController
'account' => Auth::user()->account->load('country'),
'products' => Product::scope()->orderBy('product_key')->get(),
'taxRateOptions' => $taxRateOptions,
'currencies' => Cache::get('currencies'),
'sizes' => Cache::get('sizes'),
'invoiceDesigns' => InvoiceDesign::getDesigns(),
'invoiceFonts' => Cache::get('fonts'),

View File

@ -100,14 +100,10 @@ class QuoteController extends BaseController
'account' => $account,
'products' => Product::scope()->orderBy('product_key')->get(),
'taxRateOptions' => $account->present()->taxRateOptions,
'countries' => Cache::get('countries'),
'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(),
'taxRates' => TaxRate::scope()->orderBy('name')->get(),
'currencies' => Cache::get('currencies'),
'sizes' => Cache::get('sizes'),
'paymentTerms' => Cache::get('paymentTerms'),
'languages' => Cache::get('languages'),
'industries' => Cache::get('industries'),
'invoiceDesigns' => InvoiceDesign::getDesigns(),
'invoiceFonts' => Cache::get('fonts'),
'invoiceLabels' => Auth::user()->account->getInvoiceLabels(),

View File

@ -115,14 +115,6 @@ class RecurringExpenseController extends BaseController
return [
'data' => Input::old('data'),
'account' => Auth::user()->account,
'sizes' => Cache::get('sizes'),
'paymentTerms' => Cache::get('paymentTerms'),
'industries' => Cache::get('industries'),
'currencies' => Cache::get('currencies'),
'languages' => Cache::get('languages'),
'countries' => Cache::get('countries'),
'customLabel1' => Auth::user()->account->custom_vendor_label1,
'customLabel2' => Auth::user()->account->custom_vendor_label2,
'categories' => ExpenseCategory::whereAccountId(Auth::user()->account_id)->withArchived()->orderBy('name')->get(),
'taxRates' => TaxRate::scope()->whereIsInclusive(false)->orderBy('name')->get(),
'isRecurring' => true,

View File

@ -151,7 +151,6 @@ class VendorController extends BaseController
return [
'data' => Input::old('data'),
'account' => Auth::user()->account,
'currencies' => Cache::get('currencies'),
];
}

View File

@ -2,6 +2,7 @@
namespace App\Http\ViewComposers;
use Str;
use Cache;
use Illuminate\View\View;
@ -44,5 +45,11 @@ class TranslationComposer
})->sortBy(function ($lang) {
return $lang->name;
}));
$view->with('currencies', Cache::get('currencies')->each(function ($currency) {
$currency->name = trans('texts.currency_' . Str::slug($currency->name, '_'));
})->sortBy(function ($currency) {
return $currency->name;
}));
}
}

View File

@ -2321,6 +2321,75 @@ $LANG = array(
'refund_subject' => 'Refund Processed',
'refund_body' => 'You have been processed a refund of :amount for invoice :invoice_number.',
'currency_us_dollar' => 'US Dollar',
'currency_british_pound' => 'British Pound',
'currency_euro' => 'Euro',
'currency_south_african_rand' => 'South African Rand',
'currency_danish_krone' => 'Danish Krone',
'currency_israeli_shekel' => 'Israeli Shekel',
'currency_swedish_krona' => 'Swedish Krona',
'currency_kenyan_shilling' => 'Kenyan Shilling',
'currency_canadian_dollar' => 'Canadian Dollar',
'currency_philippine_peso' => 'Philippine Peso',
'currency_indian_rupee' => 'Indian Rupee',
'currency_australian_dollar' => 'Australian Dollar',
'currency_singapore_dollar' => 'Singapore Dollar',
'currency_norske_kroner' => 'Norske Kroner',
'currency_new_zealand_dollar' => 'New Zealand Dollar',
'currency_vietnamese_dong' => 'Vietnamese Dong',
'currency_swiss_franc' => 'Swiss Franc',
'currency_guatemalan_quetzal' => 'Guatemalan Quetzal',
'currency_malaysian_ringgit' => 'Malaysian Ringgit',
'currency_brazilian_real' => 'Brazilian Real',
'currency_thai_baht' => 'Thai Baht',
'currency_nigerian_naira' => 'Nigerian Naira',
'currency_argentine_peso' => 'Argentine Peso',
'currency_bangladeshi_taka' => 'Bangladeshi Taka',
'currency_united_arab_emirates_dirham' => 'United Arab Emirates Dirham',
'currency_hong_kong_dollar' => 'Hong Kong Dollar',
'currency_indonesian_rupiah' => 'Indonesian Rupiah',
'currency_mexican_peso' => 'Mexican Peso',
'currency_egyptian_pound' => 'Egyptian Pound',
'currency_colombian_peso' => 'Colombian Peso',
'currency_west_african_franc' => 'West African Franc',
'currency_chinese_renminbi' => 'Chinese Renminbi',
'currency_rwandan_franc' => 'Rwandan Franc',
'currency_tanzanian_shilling' => 'Tanzanian Shilling',
'currency_netherlands_antillean_guilder' => 'Netherlands Antillean Guilder',
'currency_trinidad_and_tobago_dollar' => 'Trinidad and Tobago Dollar',
'currency_east_caribbean_dollar' => 'East Caribbean Dollar',
'currency_ghanaian_cedi' => 'Ghanaian Cedi',
'currency_bulgarian_lev' => 'Bulgarian Lev',
'currency_aruban_florin' => 'Aruban Florin',
'currency_turkish_lira' => 'Turkish Lira',
'currency_romanian_new_leu' => 'Romanian New Leu',
'currency_croatian_kuna' => 'Croatian Kuna',
'currency_saudi_riyal' => 'Saudi Riyal',
'currency_japanese_yen' => 'Japanese Yen',
'currency_maldivian_rufiyaa' => 'Maldivian Rufiyaa',
'currency_costa_rican_colón' => 'Costa Rican Colón',
'currency_pakistani_rupee' => 'Pakistani Rupee',
'currency_polish_zloty' => 'Polish Zloty',
'currency_sri_lankan_rupee' => 'Sri Lankan Rupee',
'currency_czech_koruna' => 'Czech Koruna',
'currency_uruguayan_peso' => 'Uruguayan Peso',
'currency_namibian_dollar' => 'Namibian Dollar',
'currency_tunisian_dinar' => 'Tunisian Dinar',
'currency_russian_ruble' => 'Russian Ruble',
'currency_mozambican_metical' => 'Mozambican Metical',
'currency_omani_rial' => 'Omani Rial',
'currency_ukrainian_hryvnia' => 'Ukrainian Hryvnia',
'currency_macanese_pataca' => 'Macanese Pataca',
'currency_taiwan_new_dollar' => 'Taiwan New Dollar',
'currency_dominican_peso' => 'Dominican Peso',
'currency_chilean_peso' => 'Chilean Peso',
'currency_icelandic_króna' => 'Icelandic Króna',
'currency_papua_new_guinean_kina' => 'Papua New Guinean Kina',
'currency_jordanian_dinar' => 'Jordanian Dinar',
'currency_myanmar_kyat' => 'Myanmar Kyat',
'currency_peruvian_sol' => 'Peruvian Sol',
);
return $LANG;

View File

@ -622,7 +622,7 @@
{!! Former::select('client[country_id]')
->label(trans('texts.country_id'))
->addOption('','')->addGroupClass('country_select')
->fromQuery(Cache::get('countries'), 'name', 'id')->data_bind("dropdown: country_id") !!}
->fromQuery($countries, 'name', 'id')->data_bind("dropdown: country_id") !!}
</span>
</div>