diff --git a/README.md b/README.md index 032041c..042cc58 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/plugin.yml b/plugin.yml index 1041369..525275f 100644 --- a/plugin.yml +++ b/plugin.yml @@ -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] diff --git a/resources/language/de_DE.yml b/resources/language/de_DE.yml index d48e377..d7a495a 100644 --- a/resources/language/de_DE.yml +++ b/resources/language/de_DE.yml @@ -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 diff --git a/src/shock95x/auctionhouse/AuctionHouse.php b/src/shock95x/auctionhouse/AuctionHouse.php index 0991449..8fdf864 100644 --- a/src/shock95x/auctionhouse/AuctionHouse.php +++ b/src/shock95x/auctionhouse/AuctionHouse.php @@ -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); diff --git a/src/shock95x/auctionhouse/utils/Locale.php b/src/shock95x/auctionhouse/utils/Locale.php index 4c38a36..bba776b 100644 --- a/src/shock95x/auctionhouse/utils/Locale.php +++ b/src/shock95x/auctionhouse/utils/Locale.php @@ -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...");