Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add command fop:translations:import #262

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

PrestaSafe
Copy link

Add new command for import translation package.

php bin/console fop:translations:import ISO_CODE

php bin/console fop:translations:import ISO_CODE
$errors = $languagePackImporter->import($iso);
if (empty($errors)) {
$this->io->text('lang '.$iso.' added !');
}
Copy link

@StoreCommanderDev StoreCommanderDev Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If 1 is for failure.

Does the code must be

if (!empty($errors)) {
    return Command::FAILURE_EXIT;
}
$this->io->text('lang '.$iso.' added !');
return Command::SUCCESS:

instead?

Copy link
Contributor

@PrestaEdit PrestaEdit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, too, the management and the display of the errors with the Command::FAILURE return could be done.

src/Commands/Translations/ImportLanguage.php Outdated Show resolved Hide resolved
src/Commands/Translations/ImportLanguage.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants