mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-01 03:55:57 +00:00
fixed upgrade_language_translations
This commit is contained in:
@@ -71,7 +71,7 @@ class LanguageService
|
|||||||
|
|
||||||
// Find new translations in default translations
|
// Find new translations in default translations
|
||||||
$newbies = $default_translations[$license]
|
$newbies = $default_translations[$license]
|
||||||
->diff(map_language_translations($translations));
|
->diffKeys(map_language_translations($translations));
|
||||||
|
|
||||||
// Store new translations for every language
|
// Store new translations for every language
|
||||||
$locales->each(function ($locale) use ($newbies) {
|
$locales->each(function ($locale) use ($newbies) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Tests\Feature\App;
|
namespace Tests\Feature\App;
|
||||||
|
|
||||||
|
use App\Models\LanguageTranslation;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use DB;
|
use DB;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||||
@@ -58,7 +59,7 @@ class AppUpgradeTest extends TestCase
|
|||||||
'lang' => $locale
|
'lang' => $locale
|
||||||
], [
|
], [
|
||||||
'key' => 'activation.stripe.description',
|
'key' => 'activation.stripe.description',
|
||||||
'value' => 'To charge your users, please set up your Stripe account credentials.',
|
'value' => 'This is original test description',
|
||||||
'lang' => $locale
|
'lang' => $locale
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
@@ -75,6 +76,18 @@ class AppUpgradeTest extends TestCase
|
|||||||
'value' => 'Your Stripe account is not set',
|
'value' => 'Your Stripe account is not set',
|
||||||
'lang' => $locale,
|
'lang' => $locale,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$this->assertDatabaseHas('language_translations', [
|
||||||
|
'key' => 'activation.stripe.description',
|
||||||
|
'value' => 'This is original test description',
|
||||||
|
'lang' => $locale,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertDatabaseMissing('language_translations', [
|
||||||
|
'key' => 'activation.stripe.description',
|
||||||
|
'value' => 'To charge your users, please set up your Stripe account credentials.',
|
||||||
|
'lang' => $locale,
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user