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 check for existence of en language pack #108

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Mike-on-Tour
Copy link

Currently EPV does not check whether an extension has an English language pack, since English is the default and fallback language a missing "en" language pack should throw an error.
This PR adds check to do exactly that

@@ -79,6 +79,11 @@ public function validateDirectory(array $files)
}
}

if (!empty($langs) && !array_key_exists('en', $langs))
{
$this->output->addMessage(OutputInterface::FATAL, sprintf("English language pack is missing"));
Copy link
Member

Choose a reason for hiding this comment

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

should be:

$this->output->addMessage(OutputInterface::FATAL, 'English language pack is missing');

Copy link
Author

Choose a reason for hiding this comment

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

That's just a formality, and double quotes are already used in this file in lines 92 and 100 (numbering with my PR), so what

Copy link
Member

Choose a reason for hiding this comment

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

You're calling the sprintf function for no reason, plus with double quotes, just adding extra processing that's not needed.

Copy link
Member

Choose a reason for hiding this comment

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

I think it also should be a error instead of a fatal

Copy link
Author

@Mike-on-Tour Mike-on-Tour Apr 12, 2022

Choose a reason for hiding this comment

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

@iMattPro: Sorry, I didn't see that you removed the sprintf command. That is easily fixed.

@paul999: If an extension doesn't have a en language pack (English is the fallback language for every situation where a language key could not be found in the chosen language) then phpBB will terminate with a fatal error. This is a good enough reason to make it not an error but a fatal.

Copy link
Author

Choose a reason for hiding this comment

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

The sprintf command has been removed.

Copy link
Member

@DavidIQ DavidIQ left a comment

Choose a reason for hiding this comment

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

See comments.

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