Skip to content

Commit

Permalink
Fix language not saving when using command and register Persian langu…
Browse files Browse the repository at this point in the history
…age. (Thanks @MrKiaN!)
  • Loading branch information
Sandertv committed Jan 15, 2017
1 parent 92a928f commit f104ede
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Maximum-Radius: 10
Maximum-Undo-Stores: 7

# Language in which messages are displayed. Available languages:
# en (English), nl (Dutch), de (German), fr (French)
# en (English), nl (Dutch), de (German), fr (French), fa (Persian)
Message-Language: ""
...
3 changes: 2 additions & 1 deletion src/Sandertv/BlockSniper/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class Loader extends PluginBase {
"en",
"nl",
"de",
"fr"
"fr",
"fa"
];
public $language;

Expand Down
1 change: 1 addition & 0 deletions src/Sandertv/BlockSniper/commands/BlockSniperCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function execute(CommandSender $sender, $commandLabel, array $args) {
switch(strtolower($args[0])) {
case "language":
$this->getSettings()->set("Message-Language", $args[1]);
$this->getSettings()->save();
$sender->sendMessage(TF::GREEN . $this->getPlugin()->getTranslation("commands.succeed.language"));
return true;

Expand Down

0 comments on commit f104ede

Please sign in to comment.