XOOPS  2.6.0
Language.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  */
11 
12 namespace Xmf;
13 
28 class Language
29 {
40  public static function translate($string, $domain = null)
41  {
42  return $string;
43  }
44 
54  public static function load($name, $domain = '', $language = null)
55  {
56  if (empty($language)) {
57  if (!empty($GLOBALS['xoopsConfig']['language'])) {
58  $language = $GLOBALS['xoopsConfig']['language'];
59  } else {
60  $language = 'english';
61  }
62  }
63  $path = \XoopsBaseConfig::get('root-path') . '/' . ((empty($domain) || 'global' == $domain) ? ''
64  : "modules/{$domain}/") . 'language';
65  if (!$ret = Loader::loadFile("{$path}/{$language}/{$name}.php")) {
66  $ret = Loader::loadFile("{$path}/english/{$name}.php");
67  }
68 
69  return $ret;
70  }
71 }
$path
Definition: execute.php:31
static get($name)
static load($name, $domain= '', $language=null)
Definition: Language.php:54
$GLOBALS['xoops']
Definition: common.php:33
$language
static translate($string, $domain=null)
Definition: Language.php:40