Updated to latest version of CMS
This commit is contained in:
parent
ccdf8fbb81
commit
edf41b1198
76 changed files with 465 additions and 1162 deletions
|
@ -1,7 +1,9 @@
|
|||
<?php
|
||||
$module["lang"]["name"]="Language Class";
|
||||
$module["lang"]["ver"]="0.1.2";
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /inc/lang.class.php
|
||||
* Project: BeCast WebEngine - simple site engine
|
||||
* File: /inc/lang.class.php
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -17,30 +19,30 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* @link http://www.astat.org SVN: $URL: $
|
||||
* @copyright 2025 becast.at
|
||||
* @link http://www.becast.at
|
||||
* @copyright 2009-2025 becast.at
|
||||
* @author Bernhard Jaud <bernhard at becast dot at>
|
||||
* @package astat core
|
||||
* @package BcWe core
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @version $Id$
|
||||
*/
|
||||
$module["lang"]["name"]="Language Class";
|
||||
$module["lang"]["ver"]="0.1.1";
|
||||
*/
|
||||
|
||||
|
||||
class lang{
|
||||
var $langname=array('de'=>'Deutsch','en'=>'English');
|
||||
var $language;
|
||||
var $languagedir;
|
||||
var $lf;
|
||||
var array $langdata;
|
||||
|
||||
function __construct($languagedir='/languages/'){
|
||||
$this->languagedir = dirname(dirname(__FILE__)).'/languages/';
|
||||
}
|
||||
|
||||
function setlang($language){
|
||||
global $config, $error, $db, $log, $core, $plugin, $lang;
|
||||
function setlang($language): void
|
||||
{
|
||||
global $config;
|
||||
unset($this->language);
|
||||
unset($this->lf);
|
||||
unset($this->langdata);
|
||||
if(!$language || $language==''){
|
||||
$language=$config['lang'];
|
||||
if(!$language){
|
||||
|
@ -51,8 +53,10 @@ class lang{
|
|||
}else{
|
||||
$this->language=$language;
|
||||
}
|
||||
include_once $this->languagedir.$this->language.'.lang.php';
|
||||
$this->lf=$lf;
|
||||
require_once $this->languagedir.$this->language.'.lang.php';
|
||||
if (isset($lf)) {
|
||||
$this->langdata = $lf;
|
||||
}
|
||||
}
|
||||
|
||||
function getlanguages(){
|
||||
|
@ -71,8 +75,8 @@ class lang{
|
|||
}
|
||||
|
||||
function _($string){
|
||||
if(isset($this->lf[$string])){
|
||||
return($this->lf[$string]);
|
||||
if(isset($this->langdata[$string])){
|
||||
return($this->langdata[$string]);
|
||||
}else{
|
||||
return($string);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue