mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Fixes syntax error in "system/lv" lang, write test to prevent further breakages
This commit is contained in:
parent
690d7f0a02
commit
3a2b94829a
@ -154,7 +154,7 @@ return [
|
||||
'mailgun_secret_comment' => 'Ievadiet savu Mailgun API kodu.',
|
||||
'mandrill' => 'Mandrill',
|
||||
'mandrill_secret' => 'Mandrill Secret',
|
||||
'mandrill_secret_comment' => 'Ievadiet savu Mandrill API kodu.'
|
||||
'mandrill_secret_comment' => 'Ievadiet savu Mandrill API kodu.',
|
||||
'drivers_hint_header' => 'Dziņi nav instalēti',
|
||||
'drivers_hint_content' => 'Šai pasta metodei nepieciešams spraudnis ":plugin" instalējiet to pirms pasta sūtīšanas.'
|
||||
],
|
||||
|
@ -20,4 +20,27 @@ class TranslatorTest extends TestCase
|
||||
$this->assertCount(1, $messages);
|
||||
$this->assertEquals('The name must be at least 5 characters.', $messages->all()[0]);
|
||||
}
|
||||
|
||||
public function testValidCoreLanguageFiles()
|
||||
{
|
||||
$translator = $this->app['translator'];
|
||||
$locales = $translator->get('system::lang.locale');
|
||||
$this->assertNotEmpty($locales);
|
||||
|
||||
$locales = array_keys($locales);
|
||||
$modules = ['system', 'backend', 'cms'];
|
||||
$files = ['lang.php', 'validation.php', 'client.php'];
|
||||
|
||||
foreach ($modules as $module) {
|
||||
foreach ($locales as $locale) {
|
||||
foreach ($files as $file) {
|
||||
$srcPath = base_path() . '/modules/'.$module.'/lang/'.$locale.'/'.$file;
|
||||
if (!file_exists($srcPath)) continue;
|
||||
$messages = require $srcPath;
|
||||
$this->assertNotEmpty($messages);
|
||||
$this->assertNotCount(0, $messages);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user