-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlanguage.php
More file actions
26 lines (21 loc) · 738 Bytes
/
language.php
File metadata and controls
26 lines (21 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
namespace okayinc;
use okayinc;
class language{
private $data;
private $default;
function __construct($language, $default = 'en'){
$this->data = $config = include $language.'.php';
$this->default = $config = require $default.'.php';
}
public function get($i){
$answer = '';
if ((is_array($this->data)) && (array_key_exists($i, $this->data))){
$answer = $this->data[$i];
}
elseif ((is_array($this->default)) && (array_key_exists($i, $this->default))){
$answer = $this->default[$i];
}
return $answer;
}
}