Commit fc1014f2 by pupi1985

Removed support for metadata.php files in favor of metadata.json files

parent b5aca36a
......@@ -120,14 +120,12 @@
$options = array('' => 'English (US)');
// find all language folders
foreach (glob(QA_LANG_DIR.'*', GLOB_NOSORT) as $directory) {
$metadataUtil = new Q2A_Util_Metadata();
foreach (glob(QA_LANG_DIR.'*', GLOB_NOSORT | GLOB_MARK) as $directory) {
$code = basename($directory);
$metadatafile = QA_LANG_DIR . $code . '/metadata.php';
if (is_file($metadatafile)) {
$metadata = include $metadatafile;
$metadata = $metadataUtil->fetchFromAddonPath($directory);
if (isset($metadata['display_name']))
$options[$code] = $metadata['display_name'];
}
// otherwise use an entry from above
else if (isset($codetolanguage[$code]))
$options[$code] = $codetolanguage[$code];
......
{
"display_name": "English (UK)"
}
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-lang/en-GB/qa-lang-metadata.php
Description: Contains metadata about the translations
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
More about this license: http://www.question2answer.org/license.php
*/
return array(
'display_name' => 'English (UK)',
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment