Multi-language support - Part 1.

This commit is contained in:
Amin.MasterkinG
2020-09-10 12:11:07 +04:30
parent 3e4970ca4d
commit cb95c565bb
5 changed files with 38 additions and 6 deletions

View File

@@ -11,9 +11,12 @@ baseurl
That's your website URL. Example: "https://DOMAIN.COM"
page_title
That's your website title. Example: "My WOW Private server!"
language
Website language (english)
=====================================================================*/
$config['baseurl'] = "http://localhost";
$config['page_title'] = "Simple Register";
$config['language'] = "english";
/*===================================================================
If you see a white screen or have an issue, you can enable it to see the errors.
Note that after testing, be sure to disable this option.
@@ -296,4 +299,4 @@ $config['realmlists'] = array( // Add your realmlist here
$config['script_version'] = '1.9.8';
$config['script_version'] = '1.9.9';

View File

@@ -340,4 +340,14 @@ function verifySRP6($user, $pass, $salt, $verifier)
);
$v = gmp_powm($g, $x, $N);
return ($verifier === str_pad(gmp_export($v, 1, GMP_LSW_FIRST), 32, chr(0), STR_PAD_RIGHT));
}
// Get language text
function lang($val)
{
global $language;
if (!empty($language[$val])) {
return $language[$val];
}
return "";
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* @author Amin Mahmoudi (MasterkinG)
* @copyright Copyright (c) 2019 - 2022, MsaterkinG32 Team, Inc. (https://masterking32.com)
* @link https://masterking32.com
* @Description : It's not masterking32 framework !
**/
$language['lang'] = 'english';
$language['custom_css'] = '';

View File

@@ -0,0 +1 @@
<a href="https://masterking32.com">MasterkinG32.CoM</a>

View File

@@ -34,14 +34,20 @@ require_once app_path . 'include/database.php';
require_once app_path . 'include/user.php';
require_once app_path . 'include/vote.php';
require_once app_path . 'include/status.php';
if (!preg_match('/^([a-z]+)$/i', get_config('language')) || !file_exists(app_path . 'language/' . get_config('language') . '.php')) {
die('Language is not valid!');
}
require_once app_path . 'language/' . get_config('language') . '.php';
$antiXss = new AntiXSS();
if (!empty(get_config('script_version'))) {
/* @TODO Add online version check! */
if(version_compare(get_config('script_version'), '1.9.8', '<') )
{
echo 'Use last version of config.php file.';
exit();
}
if (version_compare(get_config('script_version'), '1.9.9', '<')) {
echo 'Use last version of config.php file.';
exit();
}
} else {
echo 'Use last version of config.php file.';
exit();