mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-23 06:35:45 -07:00
New language configuration.
This commit is contained in:
parent
40e4fb0791
commit
1bd4444caf
9 changed files with 22 additions and 205 deletions
|
@ -204,7 +204,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
||||||
} else {
|
} else {
|
||||||
// Generate frameset
|
// Generate frameset
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'CONTENT_ENCODING' => $bb_cfg['charset'],
|
'CONTENT_ENCODING' => config('language.charset'),
|
||||||
'TPL_ADMIN_FRAMESET' => true,
|
'TPL_ADMIN_FRAMESET' => true,
|
||||||
));
|
));
|
||||||
send_no_cache_headers();
|
send_no_cache_headers();
|
||||||
|
|
12
config/tp.php
Normal file
12
config/tp.php
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* TorrentPier – Bull-powered BitTorrent tracker engine
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2005-2017 TorrentPier (https://torrentpier.com)
|
||||||
|
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
|
||||||
|
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
2
dl.php
2
dl.php
|
@ -52,7 +52,7 @@ function send_file_to_browser($attachment, $upload_dir)
|
||||||
header('Pragma: public');
|
header('Pragma: public');
|
||||||
$real_filename = clean_filename(basename($attachment['real_filename']));
|
$real_filename = clean_filename(basename($attachment['real_filename']));
|
||||||
$mimetype = $attachment['mimetype'] . ';';
|
$mimetype = $attachment['mimetype'] . ';';
|
||||||
$charset = "charset={$bb_cfg['charset']};";
|
$charset = 'charset=' . config('language.charset') . ';';
|
||||||
|
|
||||||
// Send out the Headers
|
// Send out the Headers
|
||||||
header("Content-Type: $mimetype $charset name=\"$real_filename\"");
|
header("Content-Type: $mimetype $charset name=\"$real_filename\"");
|
||||||
|
|
|
@ -591,8 +591,8 @@ class User
|
||||||
/** Place user language to the global */
|
/** Place user language to the global */
|
||||||
global $lang;
|
global $lang;
|
||||||
require(LANG_DIR . 'main.php');
|
require(LANG_DIR . 'main.php');
|
||||||
setlocale(LC_ALL, isset($bb_cfg['lang'][$this->data['user_lang']]['locale']) ?
|
|
||||||
$bb_cfg['lang'][$this->data['user_lang']]['locale'] : 'en_US.UTF-8');
|
setlocale(LC_ALL, config('language.lang.' . $this->data['user_lang'] . '.locale') ?? 'en_US.UTF-8');
|
||||||
|
|
||||||
$theme = setup_style();
|
$theme = setup_style();
|
||||||
$DeltaTime = new DateDelta();
|
$DeltaTime = new DateDelta();
|
||||||
|
|
|
@ -177,7 +177,7 @@ class Emailer
|
||||||
|
|
||||||
/** Set some variables */
|
/** Set some variables */
|
||||||
$this->subject = !empty($this->subject) ? $this->subject : $lang['EMAILER_SUBJECT']['EMPTY'];
|
$this->subject = !empty($this->subject) ? $this->subject : $lang['EMAILER_SUBJECT']['EMPTY'];
|
||||||
$this->encoding = $bb_cfg['charset'];
|
$this->encoding = config('language.charset');
|
||||||
|
|
||||||
/** Prepare message */
|
/** Prepare message */
|
||||||
if ($bb_cfg['emailer']['smtp']['enabled']) {
|
if ($bb_cfg['emailer']['smtp']['enabled']) {
|
||||||
|
|
|
@ -150,199 +150,6 @@ $bb_cfg['login_url'] = 'login.php'; # "http://{$domain_name}/login.php"
|
||||||
$bb_cfg['posting_url'] = 'posting.php'; # "http://{$domain_name}/posting.php"
|
$bb_cfg['posting_url'] = 'posting.php'; # "http://{$domain_name}/posting.php"
|
||||||
$bb_cfg['pm_url'] = 'privmsg.php'; # "http://{$domain_name}/privmsg.php"
|
$bb_cfg['pm_url'] = 'privmsg.php'; # "http://{$domain_name}/privmsg.php"
|
||||||
|
|
||||||
// Language
|
|
||||||
$bb_cfg['charset'] = 'UTF-8'; // page charset
|
|
||||||
$bb_cfg['lang'] = [
|
|
||||||
'af' => [
|
|
||||||
'name' => 'Afrikaans',
|
|
||||||
'locale' => 'af_ZA.UTF-8',
|
|
||||||
],
|
|
||||||
'sq' => [
|
|
||||||
'name' => 'Albanian',
|
|
||||||
'locale' => 'sq_AL.UTF-8',
|
|
||||||
],
|
|
||||||
'ar' => [
|
|
||||||
'name' => 'Arabic',
|
|
||||||
'locale' => 'ar_SA.UTF-8',
|
|
||||||
],
|
|
||||||
'hy' => [
|
|
||||||
'name' => 'Armenian',
|
|
||||||
'locale' => 'hy_AM.UTF-8',
|
|
||||||
],
|
|
||||||
'az' => [
|
|
||||||
'name' => 'Azerbaijani',
|
|
||||||
'locale' => 'az_AZ.UTF-8',
|
|
||||||
],
|
|
||||||
'be' => [
|
|
||||||
'name' => 'Belarusian',
|
|
||||||
'locale' => 'be_BY.UTF-8',
|
|
||||||
],
|
|
||||||
'bs' => [
|
|
||||||
'name' => 'Bosnian',
|
|
||||||
'locale' => 'bs_BA.UTF-8',
|
|
||||||
],
|
|
||||||
'bg' => [
|
|
||||||
'name' => 'Bulgarian',
|
|
||||||
'locale' => 'bg_BG.UTF-8',
|
|
||||||
],
|
|
||||||
'ca' => [
|
|
||||||
'name' => 'Catalan',
|
|
||||||
'locale' => 'ca_ES.UTF-8',
|
|
||||||
],
|
|
||||||
'zh' => [
|
|
||||||
'name' => 'Chinese Simplified',
|
|
||||||
'locale' => 'zh_CN.UTF-8',
|
|
||||||
],
|
|
||||||
'hr' => [
|
|
||||||
'name' => 'Croatian',
|
|
||||||
'locale' => 'hr_HR.UTF-8',
|
|
||||||
],
|
|
||||||
'cs' => [
|
|
||||||
'name' => 'Czech',
|
|
||||||
'locale' => 'cs_CZ.UTF-8',
|
|
||||||
],
|
|
||||||
'da' => [
|
|
||||||
'name' => 'Danish',
|
|
||||||
'locale' => 'da_DK.UTF-8',
|
|
||||||
],
|
|
||||||
'nl' => [
|
|
||||||
'name' => 'Dutch',
|
|
||||||
'locale' => 'nl_NL.UTF-8',
|
|
||||||
],
|
|
||||||
'en' => [
|
|
||||||
'name' => 'English',
|
|
||||||
'locale' => 'en_US.UTF-8',
|
|
||||||
],
|
|
||||||
'et' => [
|
|
||||||
'name' => 'Estonian',
|
|
||||||
'locale' => 'et_EE.UTF-8',
|
|
||||||
],
|
|
||||||
'fi' => [
|
|
||||||
'name' => 'Finnish',
|
|
||||||
'locale' => 'fi_FI.UTF-8',
|
|
||||||
],
|
|
||||||
'fr' => [
|
|
||||||
'name' => 'French',
|
|
||||||
'locale' => 'fr_FR.UTF-8',
|
|
||||||
],
|
|
||||||
'ka' => [
|
|
||||||
'name' => 'Georgian',
|
|
||||||
'locale' => 'ka_GE.UTF-8',
|
|
||||||
],
|
|
||||||
'de' => [
|
|
||||||
'name' => 'German',
|
|
||||||
'locale' => 'de_DE.UTF-8',
|
|
||||||
],
|
|
||||||
'el' => [
|
|
||||||
'name' => 'Greek',
|
|
||||||
'locale' => 'el_GR.UTF-8',
|
|
||||||
],
|
|
||||||
'he' => [
|
|
||||||
'name' => 'Hebrew',
|
|
||||||
'locale' => 'he_IL.UTF-8',
|
|
||||||
],
|
|
||||||
'hi' => [
|
|
||||||
'name' => 'Hindi',
|
|
||||||
'locale' => 'hi_IN.UTF-8',
|
|
||||||
],
|
|
||||||
'hu' => [
|
|
||||||
'name' => 'Hungarian',
|
|
||||||
'locale' => 'hu_HU.UTF-8',
|
|
||||||
],
|
|
||||||
'id' => [
|
|
||||||
'name' => 'Indonesian',
|
|
||||||
'locale' => 'id_ID.UTF-8',
|
|
||||||
],
|
|
||||||
'it' => [
|
|
||||||
'name' => 'Italian',
|
|
||||||
'locale' => 'it_IT.UTF-8',
|
|
||||||
],
|
|
||||||
'ja' => [
|
|
||||||
'name' => 'Japanese',
|
|
||||||
'locale' => 'ja_JP.UTF-8',
|
|
||||||
],
|
|
||||||
'kk' => [
|
|
||||||
'name' => 'Kazakh',
|
|
||||||
'locale' => 'kk_KZ.UTF-8',
|
|
||||||
],
|
|
||||||
'ko' => [
|
|
||||||
'name' => 'Korean',
|
|
||||||
'locale' => 'ko_KR.UTF-8',
|
|
||||||
],
|
|
||||||
'lv' => [
|
|
||||||
'name' => 'Latvian',
|
|
||||||
'locale' => 'lv_LV.UTF-8',
|
|
||||||
],
|
|
||||||
'lt' => [
|
|
||||||
'name' => 'Lithuanian',
|
|
||||||
'locale' => 'lt_LT.UTF-8',
|
|
||||||
],
|
|
||||||
'no' => [
|
|
||||||
'name' => 'Norwegian',
|
|
||||||
'locale' => 'nn_NO.UTF-8',
|
|
||||||
],
|
|
||||||
'pl' => [
|
|
||||||
'name' => 'Polish',
|
|
||||||
'locale' => 'pl_PL.UTF-8',
|
|
||||||
],
|
|
||||||
'pt' => [
|
|
||||||
'name' => 'Portuguese',
|
|
||||||
'locale' => 'pt_PT.UTF-8',
|
|
||||||
],
|
|
||||||
'ro' => [
|
|
||||||
'name' => 'Romanian',
|
|
||||||
'locale' => 'ro_RO.UTF-8',
|
|
||||||
],
|
|
||||||
'ru' => [
|
|
||||||
'name' => 'Russian',
|
|
||||||
'locale' => 'ru_RU.UTF-8',
|
|
||||||
],
|
|
||||||
'sr' => [
|
|
||||||
'name' => 'Serbian',
|
|
||||||
'locale' => 'sr_CS.UTF-8',
|
|
||||||
],
|
|
||||||
'sk' => [
|
|
||||||
'name' => 'Slovak',
|
|
||||||
'locale' => 'sk_SK.UTF-8',
|
|
||||||
],
|
|
||||||
'sl' => [
|
|
||||||
'name' => 'Slovenian',
|
|
||||||
'locale' => 'sl_SI.UTF-8',
|
|
||||||
],
|
|
||||||
'es' => [
|
|
||||||
'name' => 'Spanish',
|
|
||||||
'locale' => 'es_ES.UTF-8',
|
|
||||||
],
|
|
||||||
'sv' => [
|
|
||||||
'name' => 'Swedish',
|
|
||||||
'locale' => 'sv_SE.UTF-8',
|
|
||||||
],
|
|
||||||
'tg' => [
|
|
||||||
'name' => 'Tajik',
|
|
||||||
'locale' => 'tg_TJ.UTF-8',
|
|
||||||
],
|
|
||||||
'th' => [
|
|
||||||
'name' => 'Thai',
|
|
||||||
'locale' => 'th_TH.UTF-8',
|
|
||||||
],
|
|
||||||
'tr' => [
|
|
||||||
'name' => 'Turkish',
|
|
||||||
'locale' => 'tr_TR.UTF-8',
|
|
||||||
],
|
|
||||||
'uk' => [
|
|
||||||
'name' => 'Ukrainian',
|
|
||||||
'locale' => 'uk_UA.UTF-8',
|
|
||||||
],
|
|
||||||
'uz' => [
|
|
||||||
'name' => 'Uzbek',
|
|
||||||
'locale' => 'uz_UZ.UTF-8',
|
|
||||||
],
|
|
||||||
'vi' => [
|
|
||||||
'name' => 'Vietnamese',
|
|
||||||
'locale' => 'vi_VN.UTF-8',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
// Templates
|
// Templates
|
||||||
$bb_cfg['templates'] = [
|
$bb_cfg['templates'] = [
|
||||||
'default' => 'Стандартный',
|
'default' => 'Стандартный',
|
||||||
|
|
|
@ -1375,7 +1375,7 @@ function bb_simple_die($txt)
|
||||||
bb_die("bb_simple_die:<br /><br />$txt");
|
bb_die("bb_simple_die:<br /><br />$txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Content-Type: text/plain; charset=' . $bb_cfg['charset']);
|
header('Content-Type: text/plain; charset=' . config('language.charset'));
|
||||||
die($txt);
|
die($txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,10 @@ if (!defined('BB_ROOT')) {
|
||||||
//
|
//
|
||||||
function language_select($default_lang, $select_name = 'language')
|
function language_select($default_lang, $select_name = 'language')
|
||||||
{
|
{
|
||||||
global $bb_cfg;
|
$lang_default = config('language.lang');
|
||||||
|
|
||||||
$lang_default = reset($bb_cfg['lang']);
|
|
||||||
$lang_select = '<select name="' . $select_name . '">';
|
$lang_select = '<select name="' . $select_name . '">';
|
||||||
$x = 0;
|
$x = 0;
|
||||||
foreach ($bb_cfg['lang'] as $key => $data) {
|
foreach (config('language.lang') as $key => $data) {
|
||||||
$selected = '';
|
$selected = '';
|
||||||
if ($key == $default_lang) {
|
if ($key == $default_lang) {
|
||||||
$selected = ' selected="selected"';
|
$selected = ' selected="selected"';
|
||||||
|
@ -30,7 +28,7 @@ function language_select($default_lang, $select_name = 'language')
|
||||||
$x++;
|
$x++;
|
||||||
}
|
}
|
||||||
$lang_select .= '</select>';
|
$lang_select .= '</select>';
|
||||||
return ($x > 1) ? $lang_select : $lang_default['name'];
|
return ($x > 1) ? $lang_select : reset($lang_default)['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -109,7 +109,7 @@ $template->assign_vars(array(
|
||||||
// The following assigns all _common_ variables that may be used at any point in a template
|
// The following assigns all _common_ variables that may be used at any point in a template
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'SIMPLE_HEADER' => !empty($gen_simple_header),
|
'SIMPLE_HEADER' => !empty($gen_simple_header),
|
||||||
'CONTENT_ENCODING' => $bb_cfg['charset'],
|
'CONTENT_ENCODING' => config('language.charset'),
|
||||||
|
|
||||||
'IN_ADMIN' => defined('IN_ADMIN'),
|
'IN_ADMIN' => defined('IN_ADMIN'),
|
||||||
'USER_HIDE_CAT' => (BB_SCRIPT == 'index'),
|
'USER_HIDE_CAT' => (BB_SCRIPT == 'index'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue