Skip to content

Commit f9a96e9

Browse files
committed
Merge branch 'Namoshek-make-texts-translateable'
2 parents 1e3a1a3 + af23b93 commit f9a96e9

24 files changed

+248
-41
lines changed

src/Checks/AppKeyIsSet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class AppKeyIsSet implements Check
1111
*/
1212
public function name(array $config): string
1313
{
14-
return 'App key is set';
14+
return trans('self-diagnosis::checks.app_key_is_set.name');
1515
}
1616

1717
/**
@@ -31,6 +31,6 @@ public function check(array $config): bool
3131
*/
3232
public function message(array $config): string
3333
{
34-
return 'The application key is not set. Call "php artisan key:generate" to create it.';
34+
return trans('self-diagnosis::checks.app_key_is_set.message');
3535
}
3636
}

src/Checks/ComposerWithDevDependenciesIsUpToDate.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(Composer $composer)
2626
*/
2727
public function name(array $config): string
2828
{
29-
return 'Composer dependencies are up to date with the composer.lock file.';
29+
return trans('self-diagnosis::checks.composer_with_dev_dependencies_is_up_to_date.name');
3030
}
3131

3232
/**
@@ -48,6 +48,8 @@ public function check(array $config): bool
4848
*/
4949
public function message(array $config): string
5050
{
51-
return 'Your composer dependencies are not up to date. Call "composer install".' . $this->output;
51+
return trans('self-diagnosis::checks.composer_with_dev_dependencies_is_up_to_date.message', [
52+
'more' => $this->output,
53+
]);
5254
}
5355
}

src/Checks/ComposerWithoutDevDependenciesIsUpToDate.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(Composer $composer)
2626
*/
2727
public function name(array $config): string
2828
{
29-
return 'Composer dependencies (without dev) are up to date with the composer.lock file.';
29+
return trans('self-diagnosis::checks.composer_without_dev_dependencies_is_up_to_date.name');
3030
}
3131

3232
/**
@@ -48,6 +48,8 @@ public function check(array $config): bool
4848
*/
4949
public function message(array $config): string
5050
{
51-
return 'Your composer dependencies are not up to date. Call "composer install".' . $this->output;
51+
return trans('self-diagnosis::checks.composer_without_dev_dependencies_is_up_to_date.message', [
52+
'more' => $this->output,
53+
]);
5254
}
5355
}

src/Checks/ConfigurationIsCached.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ConfigurationIsCached implements Check
1414
*/
1515
public function name(array $config): string
1616
{
17-
return 'Configuration is cached';
17+
return trans('self-diagnosis::checks.configuration_is_cached.name');
1818
}
1919

2020
/**
@@ -34,6 +34,6 @@ public function check(array $config): bool
3434
*/
3535
public function message(array $config): string
3636
{
37-
return 'Your configuration files should be cached in production. Call "php artisan config:cache" to cache the configuration.';
37+
return trans('self-diagnosis::checks.configuration_is_cached.message');
3838
}
3939
}

src/Checks/ConfigurationIsNotCached.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ConfigurationIsNotCached implements Check
1414
*/
1515
public function name(array $config): string
1616
{
17-
return 'Configuration is not cached';
17+
return trans('self-diagnosis::checks.configuration_is_not_cached.name');
1818
}
1919

2020
/**
@@ -34,6 +34,6 @@ public function check(array $config): bool
3434
*/
3535
public function message(array $config): string
3636
{
37-
return 'Your configuration files should not be cached during development. Call "php artisan config:clear" to clear the config cache.';
37+
return trans('self-diagnosis::checks.configuration_is_not_cached.message');
3838
}
3939
}

src/Checks/CorrectPhpVersionIsInstalled.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct(Filesystem $filesystem)
2121
*/
2222
public function name(array $config): string
2323
{
24-
return 'The correct PHP version is installed';
24+
return trans('self-diagnosis::checks.correct_php_version_is_installed.name');
2525
}
2626

2727
/**
@@ -43,7 +43,10 @@ public function check(array $config): bool
4343
*/
4444
public function message(array $config): string
4545
{
46-
return 'You do not have the required PHP version installed.'.PHP_EOL.'Required: '.$this->getRequiredPhpVersion().PHP_EOL.'Used: '.phpversion();
46+
return trans('self-diagnosis::checks.correct_php_version_is_installed.message', [
47+
'required' => $this->getRequiredPhpVersion(),
48+
'used' => phpversion(),
49+
]);
4750
}
4851

4952
/**

src/Checks/DatabaseCanBeAccessed.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class DatabaseCanBeAccessed implements Check
1515
*/
1616
public function name(array $config): string
1717
{
18-
return 'The database can be accessed';
18+
return trans('self-diagnosis::checks.database_can_be_accessed.name');
1919
}
2020

2121
/**
@@ -42,6 +42,8 @@ public function check(array $config): bool
4242
*/
4343
public function message(array $config): string
4444
{
45-
return 'The database can not be accessed: '.$this->message;
45+
return trans('self-diagnosis::checks.database_can_be_accessed.message', [
46+
'error' => $this->message,
47+
]);
4648
}
4749
}

src/Checks/DebugModeIsNotEnabled.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DebugModeIsNotEnabled implements Check
1414
*/
1515
public function name(array $config): string
1616
{
17-
return 'Debug mode is not enabled';
17+
return trans('self-diagnosis::checks.debug_mode_is_not_enabled.name');
1818
}
1919

2020
/**
@@ -34,6 +34,6 @@ public function check(array $config): bool
3434
*/
3535
public function message(array $config): string
3636
{
37-
return 'You should not use debug mode in production. Set APP_DEBUG to false.';
37+
return trans('self-diagnosis::checks.debug_mode_is_not_enabled.message');
3838
}
3939
}

src/Checks/DirectoriesHaveCorrectPermissions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(Filesystem $filesystem)
2929
*/
3030
public function name(array $config): string
3131
{
32-
return 'The directories have the correct permissions.';
32+
return trans('self-diagnosis::checks.directories_have_correct_permissions.name');
3333
}
3434

3535
/**
@@ -39,7 +39,9 @@ public function name(array $config): string
3939
*/
4040
public function message(array $config): string
4141
{
42-
return 'The following directories are not writable: '.PHP_EOL.$this->paths->implode(PHP_EOL);
42+
return trans('self-diagnosis::checks.directories_have_correct_permissions.message', [
43+
'directories' => $this->paths->implode(PHP_EOL),
44+
]);
4345
}
4446

4547
/**

src/Checks/EnvFileExists.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(Filesystem $filesystem)
2222
*/
2323
public function name(array $config): string
2424
{
25-
return 'The environment file exists';
25+
return trans('self-diagnosis::checks.env_file_exists.name');
2626
}
2727

2828
/**
@@ -42,6 +42,6 @@ public function check(array $config): bool
4242
*/
4343
public function message(array $config): string
4444
{
45-
return 'These .env file does not exist. Please copy your .env.example file as .env';
45+
return trans('self-diagnosis::checks.env_file_exists.message');
4646
}
4747
}

0 commit comments

Comments
 (0)