Make use default locale

This commit is contained in:
Li 2022-09-20 01:27:00 +12:00
parent a626623ecc
commit 85475b7d92
2 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -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"]))
<div id="psm-description">
<hr>
'. printDescription($description, "en") .'
'. printDescription($description, $defaultLocale) .'
<hr>
</div>