Skip to content

Commit

Permalink
Update 1.2.5
Browse files Browse the repository at this point in the history
- Updated German language file
  • Loading branch information
Shock95 committed Oct 4, 2020
1 parent b2f1522 commit 3808dc1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ You can contribute to this project by creating a new language file and opening a
### Supported languages and contributors
- [Shock95x](https://github.com/Shock95x) (English)
- [No4NaMe](https://github.com/No4NaMe) (Russian)
- [Unickorn](https://github.com/Unickorn) (German)
- Chaosfelix4451#0157 (German)

## Credits / Virions Used
Expand Down
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: AuctionHouse
main: shock95x\auctionhouse\AuctionHouse
version: 1.2.4
version: 1.2.5
api: 3.0.0
author: Shock95x
softdepend: [EconomyAPI, InvCrashFix]
Expand Down
3 changes: 3 additions & 0 deletions resources/language/de_DE.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
# DO NOT EDIT THIS VALUE, INTERNAL USE ONLY. #
lang-version: 2

# Refer to https://minecraft.gamepedia.com/Formatting_codes for formatting codes, you can replace the '§' symbol with a '&'

# The titles of the Auction House UI
Expand Down
3 changes: 0 additions & 3 deletions src/shock95x/auctionhouse/AuctionHouse.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public function onEnable() : void {
$this->saveResource($file, $replace);
}

$defaultLang = new Config($this->getDataFolder() . "language/en_US.yml", Config::YAML);
ConfigUpdater::checkUpdate($this, $defaultLang, "lang-version", 2);

Locale::init($this);

if(!InvMenuHandler::isRegistered()) InvMenuHandler::register($this);
Expand Down
5 changes: 5 additions & 0 deletions src/shock95x/auctionhouse/utils/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ class Locale {

/** @var array */
public static $translation;
/** @var string[] */
private static $supported = ["en_US", "de_DE"];

public static function init(AuctionHouse $plugin) {
foreach(self::$supported as $locale) {
ConfigUpdater::checkUpdate($plugin, new Config($plugin->getDataFolder() . "language/{$locale}.yml", Config::YAML), "lang-version", 2);
}
self::loadLanguages($plugin->getDataFolder());
if(empty(self::$translation)) {
$plugin->getLogger()->error("No language file has been found, disabling plugin...");
Expand Down

0 comments on commit 3808dc1

Please sign in to comment.