From 85475b7d92d7f6f0d6c8c1695149ce912022eec4 Mon Sep 17 00:00:00 2001 From: Li Date: Tue, 20 Sep 2022 01:27:00 +1200 Subject: [PATCH] Make use default locale --- common.php | 4 +++- libary.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/common.php b/common.php index 21e9a21..ad6729f 100755 --- a/common.php +++ b/common.php @@ -112,7 +112,9 @@ function getLatestVer(string $game){ function getDesc(string $game){ $version = getLatestVer($game); $mdxml = simplexml_load_file('gameinfo/' . $game . "/".$version."/metadata.xml", 'SimpleXMLElement', LIBXML_NOENT); - return printDescription($mdxml->localizedMetadataList->children(), "en"); + + $defaultLocale = (string)$mdxml->localizedMetadataList->attributes()->default_locale; + return printDescription($mdxml->localizedMetadataList->children(), $defaultLocale); } function getTitle(string $game) diff --git a/libary.php b/libary.php index 81967ce..1f1598a 100755 --- a/libary.php +++ b/libary.php @@ -59,6 +59,9 @@ if(isset($_GET["game"])) $metadataXML = simplexml_load_file('gameinfo/' . $game . "/". $latestVersion ."/metadata.xml", 'SimpleXMLElement', LIBXML_NOENT); $description = $metadataXML->localizedMetadataList->children(); $screenshot = $metadataXML->screenShotList->screenShot; + + $defaultLocale = (string)$mdxml->localizedMetadataList->attributes()->default_locale; + $isplayable = ""; if($zrifinfo == "MISSING" && $zrifPendingInfo == "MISSING") @@ -106,7 +109,7 @@ if(isset($_GET["game"]))

- '. printDescription($description, "en") .' + '. printDescription($description, $defaultLocale) .'