Skip to content

Commit

Permalink
Update ImportFromCsvCommand.php
Browse files Browse the repository at this point in the history
  • Loading branch information
AidasK authored Apr 11, 2022
1 parent e1a46b5 commit 915cbc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Console/ImportFromCsvCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function handle()
if (!$locale) {
preg_match('#\((.*?)\)#', pathinfo($fileName, PATHINFO_FILENAME), $localeCode);
$locale = $localeCode[1] ?? pathinfo($fileName, PATHINFO_FILENAME);
if (file_exists(resource_path("lang/$locale"))) {
if (file_exists(lang_path($locale))) {
$this->info("Detected locale $locale");
} else {
$this->error("Could not detect locale of $fileName");
Expand All @@ -69,15 +69,15 @@ public function handle()
if ($this->option('placeholders') || config('lang_import_export.import_validate_placeholders')) {
$baseTranslations = LangListService::loadLangList(config('lang_import_export.base_locale'), $group);
foreach (LangListService::validatePlaceholders($translations, $baseTranslations) as $errors) {
$this->warn("resources/lang/$locale/{$errors['group']}.php {$errors['key']} is missing \"{$errors['placeholder']}\".");
$this->warn("lang/$locale/{$errors['group']}.php {$errors['key']} is missing \"{$errors['placeholder']}\".");
$this->info($errors['translation'], 'v');
$this->info($errors['baseTranslation'], 'vv');
}
}
if ($this->option('html') || config('lang_import_export.import_validate_html')) {
$baseTranslations = LangListService::loadLangList(config('lang_import_export.base_locale'), $group);
foreach (LangListService::validateHTML($translations, $baseTranslations) as $errors) {
$this->warn("resources/lang/$locale/{$errors['group']}.php {$errors['key']} is missing `{$errors['tag']}` html tag.");
$this->warn("lang/$locale/{$errors['group']}.php {$errors['key']} is missing `{$errors['tag']}` html tag.");
$this->info($errors['translation'], 'v');
$this->info($errors['baseTranslation'], 'vv');
}
Expand Down

0 comments on commit 915cbc5

Please sign in to comment.