localization.class.php

来自「voip开源项目」· PHP 代码 · 共 25 行

PHP
25
字号
<?
class Localization{
	var $filePath;

	function Localization($language,$country,$page){
		$this->filePath = "language/".$page."_".$language."_".$country.".php";
	}
	

	function Translate($str){
		$source = $str;
		$filePath = dirname(dirname(__FILE__))."/include/".$this->filePath;
		if (file_exists($filePath)){
			require $this->filePath;
			$str =str_replace(" ","_",strtolower($str));
			if ($$str != "")
				return $$str;
			else
				return $source;
		}else{
			return $str;
		}
	}
}
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?