Skip to content

Commit

Permalink
use different language variable for a single dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianVennen committed May 31, 2022
1 parent 252ac5e commit c5ce756
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ public function getDependencyPluginNames(): string
*/
public function getMessage(): string
{
if (count($this->getDependencyPlugins()) === 1) {
return Translator::getInstance()->getTranslation("plugin-dependency-problem", [
"plugin-name" => $this->getPluginName(),
"dependency-plugin-name" => $this->getDependencyPlugins()[0]
]);
}

return Translator::getInstance()->getTranslation("plugin-dependencies-problem", [
"plugin-name" => $this->getPluginName(),
"dependency-plugin-names" => $this->getDependencyPluginNames()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ public function testParseAndAnalyse(): void

$this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage());

$this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugins 'ViaVersion'.", $analysis[1]->getMessage());
$this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugin 'ViaVersion'.", $analysis[1]->getMessage());
$this->assertEquals("Install the plugin 'ViaVersion'.", $analysis[1][0]->getMessage());
$this->assertEquals("Delete the file 'plugins/ViaBackwards-4.2.1.jar'.", $analysis[1][1]->getMessage());

Expand Down
2 changes: 1 addition & 1 deletion test/tests/auto/Bukkit/PaperPluginDependency1182Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ public function testParseAndAnalyse(): void

$this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage());

$this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugins 'ViaVersion'.", $analysis[1]->getMessage());
$this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugin 'ViaVersion'.", $analysis[1]->getMessage());
$this->assertEquals("Install the plugin 'ViaVersion'.", $analysis[1][0]->getMessage());
$this->assertEquals("Delete the file 'plugins/ViaBackwards-4.2.1.jar'.", $analysis[1][1]->getMessage());

Expand Down

0 comments on commit c5ce756

Please sign in to comment.