mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 01:37:02 +02:00
added the webui to the tarball
This commit is contained in:
40
webui/system/language.php
Normal file
40
webui/system/language.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
class Language {
|
||||
public $data = array();
|
||||
|
||||
|
||||
public function __construct () {
|
||||
if(isset($_SESSION['lang'])) {
|
||||
$file = DIR_LANGUAGE . $_SESSION['lang'] . '/messages.php';
|
||||
} else {
|
||||
$file = DIR_LANGUAGE . LANG . '/messages.php';
|
||||
}
|
||||
|
||||
if (file_exists($file)) {
|
||||
$_ = array();
|
||||
|
||||
require($file);
|
||||
|
||||
$this->data = array_merge($this->data, $_);
|
||||
}
|
||||
else {
|
||||
exit('Error: Could not load language ' . $file . '!');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function get($key) {
|
||||
return (isset($this->data[$key]) ? $this->data[$key] : $key);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
Reference in New Issue
Block a user