Fix texts_ in country selector

This commit is contained in:
Hillel Coren 2017-05-14 17:42:24 +03:00
parent 553e782bb3
commit 6c8d0c1d53
4 changed files with 15 additions and 12 deletions

View File

@ -11,13 +11,15 @@ class CountriesSeeder extends Seeder
*/ */
public function run() public function run()
{ {
//Empty the countries table Eloquent::unguard();
DB::table('countries')->delete();
if (DB::table('countries')->count() == 0) { $countries = Countries::getList();
//Get all of the countries foreach ($countries as $countryId => $country) {
$countries = Countries::getList(); if ($record = Country::whereCountryCode($country['country-code'])->first()) {
foreach ($countries as $countryId => $country) { $record->name = $country['name'];
$record->full_name = ((isset($country['full_name'])) ? $country['full_name'] : null);
$record->save();
} else {
DB::table('countries')->insert([ DB::table('countries')->insert([
'id' => $countryId, 'id' => $countryId,
'capital' => ((isset($country['capital'])) ? $country['capital'] : null), 'capital' => ((isset($country['capital'])) ? $country['capital'] : null),
@ -36,7 +38,7 @@ class CountriesSeeder extends Seeder
]); ]);
} }
} }
// Source: http://www.bitboost.com/ref/international-address-formats.html // Source: http://www.bitboost.com/ref/international-address-formats.html
// Source: https://en.wikipedia.org/wiki/Linguistic_issues_concerning_the_euro // Source: https://en.wikipedia.org/wiki/Linguistic_issues_concerning_the_euro
$countries = [ $countries = [

View File

@ -11,6 +11,7 @@ class UpdateSeeder extends Seeder
{ {
$this->command->info('Running UpdateSeeder...'); $this->command->info('Running UpdateSeeder...');
$this->call('CountriesSeeder');
$this->call('PaymentLibrariesSeeder'); $this->call('PaymentLibrariesSeeder');
$this->call('FontsSeeder'); $this->call('FontsSeeder');
$this->call('GatewayTypesSeeder'); $this->call('GatewayTypesSeeder');

File diff suppressed because one or more lines are too long

View File

@ -1690,7 +1690,7 @@ $LANG = array(
'country_Wallis and Futuna' => 'Wallis and Futuna', 'country_Wallis and Futuna' => 'Wallis and Futuna',
'country_Samoa' => 'Samoa', 'country_Samoa' => 'Samoa',
'country_Yemen' => 'Yemen', 'country_Yemen' => 'Yemen',
'country_Zambi' => 'Zambi', 'country_Zambia' => 'Zambia',
// Languages // Languages
'lang_Brazilian Portuguese' => 'Brazilian Portuguese', 'lang_Brazilian Portuguese' => 'Brazilian Portuguese',