use Friendica\Content\Text\Markdown;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Core\Worker;
function admin_page_site(App $a)
{
/* Installed langs */
- $lang_choices = get_available_languages();
+ $lang_choices = L10n::getAvailableLanguages();
if (strlen(Config::get('system', 'directory_submit_url')) &&
!strlen(Config::get('system', 'directory'))) {
* @file mod/install.php
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Database\DBStructure;
$adminmail = notags(trim($_POST['adminmail']));
$timezone = ((x($_POST, 'timezone')) ? ($_POST['timezone']) : 'America/Los_Angeles');
/* Installed langs */
- $lang_choices = get_available_languages();
+ $lang_choices = L10n::getAvailableLanguages();
$tpl = get_markup_template('install_settings.tpl');
$o .= replace_macros($tpl, [
use Friendica\Content\Nav;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
}
/* Installed langs */
- $lang_choices = get_available_languages();
+ $lang_choices = L10n::getAvailableLanguages();
/// @TODO Fix indending (or so)
$o .= replace_macros($stpl, [
use Friendica\Core\Config;
use dba;
+require_once 'boot.php';
require_once 'include/dba.php';
/**
if (is_array($t)) {
$plural_function = 'string_plural_select_' . str_replace('-', '_', $lang);
if (function_exists($plural_function)) {
- $plural_function = 'string_plural_select_default';
+ $plural_function = 'self::stringPluralSelectDefault';
}
$i = $plural_function($count);
$s = $t[$i];
} else {
$s = $t;
}
- } elseif (string_plural_select_default($count)) {
+ } elseif (self::stringPluralSelectDefault($count)) {
$s = $plural;
} else {
$s = $singular;
return $s;
}
- // provide a fallback which will not collide with
- // a function defined in any language file
- function string_plural_select_default($n)
+ /**
+ * Provide a fallback which will not collide with a function defined in any language file
+ */
+ private static function stringPluralSelectDefault($n)
{
return $n != 1;
}
*
* @return array
*/
- function get_available_languages() {
+ public static function getAvailableLanguages()
+ {
$langs = [];
$strings_file_paths = glob('view/lang/*/strings.php');