2017-09-23 17:47:19 +02:00
|
|
|
<?php
|
|
|
|
/*
|
2023-10-28 23:03:40 +02:00
|
|
|
Copyright 2023 UUP dump API authors
|
2017-09-23 17:47:19 +02:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2017-09-29 23:40:56 +02:00
|
|
|
require_once dirname(__FILE__).'/shared/main.php';
|
2017-12-20 17:35:14 +01:00
|
|
|
require_once dirname(__FILE__).'/shared/packs.php';
|
2017-12-23 19:22:34 +01:00
|
|
|
require_once dirname(__FILE__).'/updateinfo.php';
|
2017-09-29 23:40:56 +02:00
|
|
|
|
2023-10-28 23:03:40 +02:00
|
|
|
function uupListLangsInternal($updateId) {
|
|
|
|
$genPack = uupApiGetPacks($updateId);
|
|
|
|
$fancyLangNames = uupGetInfoTexts()['fancyLangNames'];
|
2017-12-20 17:35:14 +01:00
|
|
|
|
2023-10-28 23:03:40 +02:00
|
|
|
$langList = [];
|
|
|
|
$langListFancy = [];
|
2019-01-05 01:25:25 +01:00
|
|
|
|
2019-02-17 18:39:18 +01:00
|
|
|
foreach($genPack as $key => $val) {
|
2023-10-28 23:03:40 +02:00
|
|
|
if(!count(array_diff(array_keys($val), ['LXP', 'FOD']))) {
|
2021-12-31 11:44:02 +01:00
|
|
|
continue;
|
|
|
|
}
|
2019-02-17 18:39:18 +01:00
|
|
|
|
2023-10-28 23:03:40 +02:00
|
|
|
$fancyName = isset($fancyLangNames[$key]) ? $fancyLangNames[$key] : $key;
|
2017-09-23 17:47:19 +02:00
|
|
|
|
2019-02-17 18:39:18 +01:00
|
|
|
$langList[] = $key;
|
|
|
|
$langListFancy[$key] = $fancyName;
|
2017-09-23 17:47:19 +02:00
|
|
|
}
|
2023-10-28 23:03:40 +02:00
|
|
|
|
|
|
|
return [
|
|
|
|
'langList' => $langList,
|
|
|
|
'langFancyNames' => $langListFancy,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
function uupListLangs($updateId = 0, $returnInfo = true) {
|
|
|
|
if($returnInfo) {
|
|
|
|
$info = uupUpdateInfo($updateId, ignoreFiles: true);
|
|
|
|
$info = isset($info['info']) ? $info['info'] : false;
|
2020-07-22 07:57:05 +02:00
|
|
|
}
|
2023-10-28 23:03:40 +02:00
|
|
|
|
|
|
|
$langList = uupListLangsInternal($updateId);
|
|
|
|
|
|
|
|
$response = [
|
|
|
|
'apiVersion' => uupApiVersion(),
|
|
|
|
'langList' => $langList['langList'],
|
|
|
|
'langFancyNames' => $langList['langFancyNames'],
|
|
|
|
];
|
|
|
|
|
|
|
|
if($returnInfo) $response['updateInfo'] = $info;
|
|
|
|
|
|
|
|
return $response;
|
2017-09-23 17:47:19 +02:00
|
|
|
}
|