File manager - Edit - /usr/local/cpanel/base/frontend/jupiter/cpguard/classes/language.class.php
Back
<?php class Language { public $lang_dir; protected $lang_text; public $current_language; protected $default_language = 'en'; public function __construct($lang_file) { global $locale; $this->current_language = $locale; $this->lang_dir = dirname(__DIR__) . '/language'; $this->LoadLanguageFile($lang_file); } public function _($lang_key, $return = false) { $args = func_get_args(); return call_user_func_array([$this, 'getText'], $args); } public function getText($lang_key, $return = false) { $output = ''; // If the text defined exists, use it if (isset($this->lang_text[$lang_key])) { $output = $this->lang_text[$lang_key]; } else { $output = $lang_key; } $argc = func_num_args(); if ($argc > 2) { $args = array_slice(func_get_args(), 2, $argc - 1); // If printf args are passed as an array use those instead. if (is_array($args[0])) { $args = $args[0]; } array_unshift($args, $output); $output = call_user_func_array('sprintf', $args); //mod } if ($return) { return $output; } echo $output; } function loadLanguageFile($lang_file) { $load_success = true; // Fetch $lang from the language file, if it exists if (file_exists($this->lang_dir . DIRECTORY_SEPARATOR . $this->current_language . DIRECTORY_SEPARATOR . $lang_file . '.php')) { include_once $this->lang_dir . DIRECTORY_SEPARATOR . $this->current_language . DIRECTORY_SEPARATOR . $lang_file . '.php'; } elseif (file_exists($this->lang_dir . DIRECTORY_SEPARATOR . $this->default_language . DIRECTORY_SEPARATOR . $lang_file . '.php')) { include_once $this->lang_dir . DIRECTORY_SEPARATOR . $this->default_language . DIRECTORY_SEPARATOR . $lang_file . '.php'; } else { $load_success = false; } if ($load_success) { $this->lang_text = &$lang; } } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings