Loading core/modules/locale/locale.install +6 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,12 @@ function locale_install() { \Drupal::configFactory()->getEditable('locale.settings')->set('translation.path', $directory)->save(); } \Drupal::service('file_system')->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS); $t_args = [ ':translate_status' => base_path() . 'admin/reports/translations/check?destination=' . urlencode(base_path() . 'admin/reports/translations'), ]; $message = t('Check <a href=":translate_status">available translations</a> for your language(s).', $t_args); \Drupal::messenger()->addStatus($message); } /** Loading core/modules/locale/tests/src/Functional/LocaleInstallTest.php 0 → 100644 +47 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace Drupal\Tests\locale\Functional; use Drupal\Tests\BrowserTestBase; /** * Test installation of Locale module. * * @group locale */ class LocaleInstallTest extends BrowserTestBase { /** * {@inheritdoc} */ protected static $modules = [ 'system', 'file', 'language', ]; /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * Tests Locale install message. */ public function testLocaleInstallMessage(): void { $admin_user = $this->drupalCreateUser([ 'access administration pages', 'administer modules', ]); $this->drupalLogin($admin_user); $edit = []; $edit['modules[locale][enable]'] = 'locale'; $this->drupalGet('admin/modules'); $this->submitForm($edit, 'Install'); $this->assertSession()->statusMessageContains('available translations', 'status'); } } Loading
core/modules/locale/locale.install +6 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,12 @@ function locale_install() { \Drupal::configFactory()->getEditable('locale.settings')->set('translation.path', $directory)->save(); } \Drupal::service('file_system')->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS); $t_args = [ ':translate_status' => base_path() . 'admin/reports/translations/check?destination=' . urlencode(base_path() . 'admin/reports/translations'), ]; $message = t('Check <a href=":translate_status">available translations</a> for your language(s).', $t_args); \Drupal::messenger()->addStatus($message); } /** Loading
core/modules/locale/tests/src/Functional/LocaleInstallTest.php 0 → 100644 +47 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace Drupal\Tests\locale\Functional; use Drupal\Tests\BrowserTestBase; /** * Test installation of Locale module. * * @group locale */ class LocaleInstallTest extends BrowserTestBase { /** * {@inheritdoc} */ protected static $modules = [ 'system', 'file', 'language', ]; /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * Tests Locale install message. */ public function testLocaleInstallMessage(): void { $admin_user = $this->drupalCreateUser([ 'access administration pages', 'administer modules', ]); $this->drupalLogin($admin_user); $edit = []; $edit['modules[locale][enable]'] = 'locale'; $this->drupalGet('admin/modules'); $this->submitForm($edit, 'Install'); $this->assertSession()->statusMessageContains('available translations', 'status'); } }