php I18N类(方法)实例源码

下面列出了php I18N 类(方法)源码代码实例,从而了解它的用法。

作者:rmrevi    项目:yii2-applicatio   
public function testMain()
 {
     ob_start();
     dump(['test' => rand()]);
     // это тест!
     expect('Функция дампа не отдает результат', ob_get_clean())->notEmpty();
     $this->assertInstanceOf(yii\log\Dispatcher::class, YiiLog());
     $this->assertInstanceOf(yii\db\Connection::class, DB());
     $this->assertInstanceOf(yii\base\ErrorHandler::class, ErrorHandler());
     $this->assertInstanceOf(yii\caching\Cache::class, Cache());
     $this->assertInstanceOf(yii\i18n\Formatter::class, Formatter());
     $this->assertInstanceOf(yii\base\View::class, View());
     $this->assertInstanceOf(yii\i18n\I18N::class, I18N());
     $this->assertInstanceOf(yii\rbac\ManagerInterface::class, AuthManager());
     $this->assertInstanceOf(yii\web\AssetManager::class, AssetManager());
     $this->assertInstanceOf(yii\web\User::class, User());
     $this->assertInstanceOf(yii\base\Request::class, Request());
     $this->assertInstanceOf(yii\base\Response::class, Response());
     $this->assertInstanceOf(yii\web\Session::class, Session());
     $this->assertInstanceOf(yii\web\UrlManager::class, UrlManager());
     $this->assertInstanceOf(yii\mail\MailerInterface::class, Mailer());
     $this->assertInstanceOf(services\File\Service::class, FileService());
     $this->assertInstanceOf(services\Activity\Service::class, ActivityService());
 }

作者:jhbs    项目:DIR-850L_A   
HTTP/1.1 200 OK
Content-Type: Text/html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/css/help.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h2><?php 
echo I18N("h", "Firmware Update");
?>
</h2>
<p>
<?php 
echo I18N("", "You can upgrade the firmware of the device using this tool. Make sure that the firmware you want to use is saved on the local hard drive of the computer. Click on <strong>Browse</strong> to search the local hard drive for the firmware to be used for the update. Upgrading the firmware will not change any of your system settings but it is recommended that you save your system settings before doing a firmware upgrade. Please check the miiiCasa");
?>
 <a href="http://help.miiicasa.com" target="_blank"><?php 
echo I18N("h", "support site");
?>
</a><?php 
echo I18N("h", " for firmware updates");
?>
<!--or you can click on <strong>Check Now</strong> button to have the router check the new firmware automatically-->.
</p>
</body>
</html>

作者:jhbs    项目:DIR-850L_A   
<strong><?php 
echo i18n("Helpful Hints");
?>
...</strong>
<br/><br/>
<p>&nbsp;&#149;&nbsp;&nbsp;<?php 
echo I18N("h", "Click on the Save button to save log file to local hard drive which can later send to the network administrator for troubleshooting.");
echo I18N("h", "You can also select what type of event you would like to be logged from Log Type & Level.");
?>
</p>
<p>&nbsp;&#149;&nbsp;&nbsp;<?php 
echo I18N("h", "Check the log frequently to detect unauthorized network usage.");
?>
</p>
<p>&nbsp;&#149;&nbsp;&nbsp;<?php 
echo i18n("You can also have the log mailed to you periodically. Refer to <a href='/tools_email.php'>Tools -> EMail</a>.");
?>
</p>
<p>&nbsp;&#149;&nbsp;&nbsp;<?php 
echo '<a href="/spt_status.php#Logs">' . I18N("h", "More...") . '</a>';
?>
</p>

作者:jhbs    项目:DIR-850L_A   
if (radius_key.charAt(0)===" " || radius_key.charAt(radius_key.length-1)===" ")
			{
				alert("<?php 
echo I18N("h", "The prefix or postfix of the 'RADIUS server Shared Secret' could not be blank.");
?>
");
				return false;
			}
			
			if(radius_key_second!=="")
			{
				if (radius_key_second.charAt(0)===" " || radius_key_second.charAt(radius_key_second.length-1)===" ")
				{
					alert("<?php 
echo I18N("h", "The prefix or postfix of the 'Second RADIUS server Shared Secret' could not be blank.");
?>
");
					return false;
				}
			}
		}
		return true;
	}
}

function SetBNode(value)
{
	if (COMM_ToBOOL(value))
		return "1";
	else

作者:jhbs    项目:DIR-850L_A   
</dd>
		<dt><strong><?php 
echo i18n("Destination IPv6 / Prefix Length");
?>
</strong></dt>
	<dd><?php 
echo I18N("h", "The destination IPv6 address is the address of the host or network you wish to reach.");
echo I18N("h", "The prefix length field identifies the portion of the destination IP in use.");
?>
</dd>
		<dt><strong><?php 
echo i18n("Gateway");
?>
</strong></dt>
		<dd><?php 
echo I18N("h", "The gateway IP address is the IP address of the router, if any, used to reach the specified destination.");
?>
</dd>
	</dl>
</div>

<script type="text/javascript">
	var li_array = document.getElementsByTagName("li");
	for(var i=0; i < li_array.length; i++)
	{
		if(li_array[i].id!="") li_array[i].style.display="none";
	}
	var blackbox_array = document.getElementsByTagName("div");
	for(var i=0; i < blackbox_array.length; i++)
	{
		if(blackbox_array[i].className=="blackbox") blackbox_array[i].style.display="none";

作者:jhbs    项目:DIR-850L_A   
}
			if(this.pageInx > "0" && this.pageInx < this.logPages)
			{
				OBJ("pp").disabled=false;
				OBJ("np").disabled=false;
			}
		}
		OBJ("sLog_page").innerHTML = "<p>"+(this.pageInx + 1) + "/" + (1 + this.logPages)+"</p>";
		var str="";
		str += "<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"setup_form\" style=\"margin:0;\"><tr>";
		str += '<td width=\"25%\"><strong>' + "<?php 
echo I18N("j", "Time");
?>
</strong>" + "</td>";
		str += '<td width=\"75%\"><strong>' + "<?php 
echo I18N("j", "Message");
?>
</strong>" + "</td>";
		str += "</tr>";
		
		var base = PXML.FindModule("RUNTIME.LOG");
		base += "/runtime/log/" + this.logType + "/entry";
		
		for(var inx=(this.logItems-this.pageInx*this.msgItems); inx > this.logItems-(this.pageInx+1)*this.msgItems && inx > 0; inx--)
		{
			var time = XG(base + ":" + inx + "/time");
			var msg = XG(base + ":" + inx + "/message");
			if(inx%2==0)
				str += "<tr class=\"light_bg\">";
			else
				str += "<tr class=\"gray_bg\">";

作者:jhbs    项目:DIR-850L_A   
if((fw_maj < cfw_maj) || (fw_maj == cfw_maj && fw_min <= cfw_min))
		{
			OBJ("fw_message").innerHTML = "<?php 
echo I18N("j", "This firmware is the latest version.");
?>
";
			//OBJ("div_ckfwver").style.display="none";
			if (tr_ckfwver_obj.length)
			{
				for (var k=0; k<tr_ckfwver_obj.length; k++)
					tr_ckfwver_obj[k].style.display="none";
			}
			return;
		}
		OBJ("fw_message").innerHTML = "<?php 
echo I18N("j", "A new version is available.");
?>
";
		//OBJ("div_ckfwver").style.display="";
		if (tr_ckfwver_obj.length)
		{
			for (var k=0; k<tr_ckfwver_obj.length; k++)
				tr_ckfwver_obj[k].style.display="";
		}

		while(Loc_list.firstChild != null) /* check whether select box has member inside, if yes remove them */
			Loc_list.removeChild(Loc_list.firstChild);

		if (ie) /* browser is IE */
		{
			var xmlDownloadLocation = xmlDoc.XDoc.getElementsByTagName("urls")[0].childNodes[0].nodeName;

作者:jhbs    项目:DIR-850L_A   
/* The "services" will be requested by GetCFG(), then the InitValue() will be
	 * called to process the services XML document. */
	InitValue: function(xml)
	{
		PXML.doc = xml;
		var upnp = PXML.FindModule("UPNP.LAN-1");
		var icmprsp = PXML.FindModule("ICMP.WAN-1");
		var phy = PXML.FindModule("PHYINF.WAN-1");
		var wanphyuid = PXML.doc.Get(phy+"/inf/phyinf");
		var wan = PXML.doc.GetPathByTarget(phy, "phyinf", "uid", wanphyuid, false);
		this.DEVICEp = PXML.FindModule("DEVICE");
	
		var mcast = PXML.FindModule("MULTICAST");
		if (upnp==="" || icmprsp==="" || mcast==="" || wan==="")
		{ BODY.ShowMessage("<?php 
echo I18N("j", "Error");
?>
","InitValue ERROR!"); return false; }

		OBJ("upnp").checked = (XG(upnp+"/inf/upnp/count") == 1);
		OBJ("icmprsp").checked = (XG(icmprsp+"/inf/icmp")==="ACCEPT");
		
		var speed = XG(wan+"/media/linktype");
		if(speed === "AUTO")
			{OBJ("wanspeed").value = "0";}
		else if(speed === "10F")
			{OBJ("wanspeed").value = "1";}
		else if(speed === "100F")
			{OBJ("wanspeed").value = "2";}
<?php 
if ($FEATURE_WAN1000FTYPE != "1") {

作者:jhbs    项目:DIR-850L_A   
if (OBJ("stunnel").checked)
		{
			XS(this.stunnel, "1");
		}
		else
		{
			XS(this.stunnel, "0");
		}
*/		
		if(!COMM_EqSTRING(OBJ("gw_name").value,"") )
		{
			var ori_gwname = XG(this.gw_name);
			if(!this.OnCheckGwName(OBJ("gw_name").value))
			{	
				BODY.ShowConfigError("gw_name", "<?php 
echo I18N("j", "Illegal gateway name");
?>
");
				OBJ("gw_name").focus();
				return false;
			}
			
			if(OBJ("gw_name").value != ori_gwname)
			{
				XS(this.gw_name, OBJ("gw_name").value);
				this.OnSetGwName(OBJ("gw_name").value);
			}
		}
		return true;
	},
	OnCheckGwName: function(gwname)

作者:jhbs    项目:DIR-850L_A   
if(index != -1)
			{
				var BgnStr = OrgStr.substring(0, index);
				var EndStr = OrgStr.substring(index+this.StrArray[i].length, OrgStr.length);
				var MidStr = null;
				switch(i)
				{
				case 0:
					MidStr = "<?php 
echo I18N("j", "is alive");
?>
";
					break;
				case 1:
					MidStr = "<?php 
echo I18N("j", "No response from");
?>
";
				}
				WrappedStr = BgnStr+MidStr+EndStr;
				break;
			}
		}
		return WrappedStr;
	},
	//////////////////////////////////////////////////
	/* Don't remove dummy or add function after dummy, Its using for browser compatibility */
	dummy: null
}
//]]>
</script>

作者:jhbs    项目:DIR-850L_A   
?>
</th>
                        <th width=10%><?php 
echo I18N("h", "Gateway");
?>
</th>
                        <th width=13%><?php 
echo I18N("h", "Genmask");
?>
</th>
                        <th width=8%><?php 
echo I18N("h", "Metric");
?>
</th>
                        <th width=8%><?php 
echo I18N("h", "Iface");
?>
</th>
                        <th width=9%><?php 
echo I18N("h", "Creator");
?>
</th>
                </tr>
       </table>
<div class="emptyline"></div>
<div class="emptyline"></div>
<div class="emptyline"></div>
<div class="emptyline"></div>
<div class="emptyline"></div>
</div>
</form>

作者:jhbs    项目:DIR-850L_A   
HTTP/1.1 200 OK
Content-Type: text/html

<?php 
$TEMP_MYNAME = "tools_time";
$TEMP_MYHELP = "help_rt_time";
$TEMP_TITLE = I18N("h", "Advanced Settings") . " - " . I18N("h", "Time");
$ICON_HOME = 1;
$ICON_NETMAP = 1;
include "/htdocs/webinc/templates.php";

作者:jhbs    项目:DIR-850L_A   
HTTP/1.1 200 OK
Content-Type: text/html

<?php 
$TEMP_MYNAME = "wiz_miiicasa";
$TEMP_TITLE = I18N("h", "Share your files and devices");
$ICON_HOME = 1;
$ICON_ADV = 0;
$ICON_NETMAP = 1;
include "/htdocs/webinc/templates.php";

作者:jhbs    项目:DIR-850L_A   
{
			hwver=char_code.toUpperCase()+"x";
			break;
		}
	}
	if(fwcheckparameter == "")
	{
		fwcheckparameter = 	hwver+"_Default";
	}

	OBJ("fwq").innerHTML = "http:\/\/"+fwsrv+fwpath+"?model="+model+"_"+fwcheckparameter;
}

function Configured()
{
	OBJ("configured").innerHTML = "<?php 
$size = query("/runtime/device/devconfsize");
if ($size == "") {
    echo I18N("h", "N/A");
} else {
    if ($size > 0) {
        echo I18N("h", "0 (False: Settings has been modified)");
    } else {
        echo I18N("h", "1 (True: Factory Default Settings)");
    }
}
?>
";
}
</script>

作者:jhbs    项目:DIR-850L_A   
?>
</a></li>
			<li class="dive"><a href="javascript:jumpto('/help/help_log_info.php')"><?php 
echo I18N("h", "Logs");
?>
</a></li>
			<li class="dive"><a href="javascript:jumpto('/help/help_log_statistic.php')"><?php 
echo I18N("h", "Statistics");
?>
</a></li>
			<li class="dive"><a href="javascript:jumpto('/help/help_log_internet_sessions.php')"><?php 
echo I18N("h", "Internet Sessions");
?>
</a></li>
			<li class="dive_end"><a href="javascript:jumpto('/help/help_log_wireless_status.php')"><?php 
echo I18N("h", "Wireless");
?>
</a></li>
		</ul>
	</li>
	<!-- left Menu -->
	<!-- Main content -->
	<li class="maincolumn_content">
	<script language="javascript">
	<!--
	
	//Drop-down Document Viewer II- © Dynamic Drive (www.dynamicdrive.com)
	//For full source code, 100's more DHTML scripts, and TOS,
	//visit http://www.dynamicdrive.com
	
	//Specify display mode (0 or 1)

作者:jhbs    项目:DIR-850L_A   
}
		
		setTimeout(PAGE.CloseScanWindow, 550000);
	},
	check_sdstatus: function()
	{
		upnpav = PXML.FindModule("UPNPAV");
		var storage_count = XG(upnpav+"/runtime/device/storage/count");		
		if(storage_count != "0" && storage_count != "")
		{			
			return true; 
		}
		else 
		{
			BODY.ShowAlert("<?php 
echo I18N("j", "No storage device!");
?>
");
			return false;
		}	
	},
	SendEvent: function(str)
	{
		var ajaxObj = GetAjaxObj(str);	
		if (EventName != null) return;
		
		EventName = str;			
		ajaxObj.createRequest();
		ajaxObj.onCallback = function (xml)
		{
			ajaxObj.release();

作者:jhbs    项目:DIR-850L_A   
<strong><?php 
echo i18n("Helpful Hints");
?>
...</strong>
<br/><br/>
<p>&nbsp;&#149;&nbsp;&nbsp;<?php 
echo i18n("<strong>Enable</strong> if other wireless devices you wish to include in the local network support Wi-Fi Protected Setup.");
?>
</p>
<p>&nbsp;&#149;&nbsp;&nbsp;<?php 
echo I18N("h", 'Only "Admin" account can change security settings.');
?>
</p>
<p>&nbsp;&#149;&nbsp;&nbsp;<?php 
echo i18n("<strong>Lock WPS-PIN Setup</strong> Locking the WPS-PIN Method prevents the settings from being changed by any new external registrar using its PIN. Devices can still be added to the wireless network using Wi-Fi Protected Setup Push Button Configuration (WPS-PIN).");
?>
</p>
<p>&nbsp;&#149;&nbsp;&nbsp;<?php 
echo i18n("Click <strong>Connect your Wireless Device</strong> to use Wi-Fi Protected Setup to add wireless devices to the wireless network.");
?>
</p>
<p>&nbsp;&#149;&nbsp;&nbsp;<?php 
echo '<a href="/spt_adv.php#WPS">' . I18N("h", "More...") . '</a>';
?>
</p>

作者:jhbs    项目:DIR-850L_A   
}		
		XS(p+"/count", cur_count);
		XS(p+"/seqno", cur_seqno);
		return PXML.doc;
	},
	//////////////////////////////////////////////////
	rgmode: <?php 
if (query("/runtime/device/layout") == "bridge") {
    echo "false";
} else {
    echo "true";
}
?>
,
	apps: [	{name: "<?php 
echo I18N("h", "Application Name");
?>
",value:{tport:"", uport:""}},
			{name: "Age of Empires",					value:{tport:"2302-2400,6073",
															   uport:"2302-2400,6073"}},
			{name: "Aliens vs. Predator",               value:{tport:"80,2300-2400,8000-8999",                                                                 
															   uport:"80,2300-2400,8000-8999"}},
			{name: "America Army",                      value:{tport:"20045",                                                                                       
															   uport:"1716-1718,8777,27900"}},
			{name: "Asheron Call",                      value:{tport:"9000-9013",                                                                                         
															   uport:"2001,9000-9013"}},
			{name: "Battlefield 1942",                  value:{tport:"",                                                                             
															   uport:"14567,22000,23000-23009,27900,28900"}},
			{name: "Battlefield 2",                     value:{tport:"80,4711,29900,29901,29920,28910",                        
															   uport:"1500-4999,16567,27900,29900,29910,27901,55123,55124,55215"}},
			{name: "Battlefield: Vietnam",              value:{tport:"",

作者:jhbs    项目:DIR-850L_A   
OBJ("hostlist").disabled = false;
		}
		else
		{
			OBJ("dmzhost").setAttribute("modified", "ignore");
			OBJ("dmzhost").disabled = true;
			OBJ("dmzadd").disabled = true;
			OBJ("hostlist").disabled = true;
		}
	},
	OnClickDMZAdd: function()
	{
		if(OBJ("hostlist").value === "")
		{
			BODY.ShowConfigError("hostlist","<?php 
echo I18N("j", "Please select a machine first!");
?>
");
			return null;
		}
		OBJ("dmzhost").value = OBJ("hostlist").value;
	},
	OnChangeProt: function(index)
	{
		var prot = OBJ("pro_"+index).value;

		if (prot==="TCP" || prot==="UDP")
		{
			OBJ("dst_startport_"+index).disabled = false;
			OBJ("dst_endport_"+index).disabled = false;
		}

作者:jhbs    项目:DIR-850L_A   
BODY.ShowAlert("<?php 
echo I18N("j", "WPS can't be enabled when a hidden SSID (invisible) is selected.") . "\\n" . I18N("j", "Please select use visible SSID in SETUP => WIRELESS SETTINGS to enable WPS.");
?>
");
				return null;
			}
			
			var wifi_verify	= "<?php 
echo get('', '/runtime/devdata/wifiverify');
?>
";
			if(wifi_verify=="1" && this.Is_MacFilterEnabled())
			{
				OBJ("en_wps").checked		= false;
				BODY.ShowAlert("<?php 
echo I18N("j", "WPS can't be enabled when network filter is enabled.") . "\\n" . I18N("j", "Please select disable network filter in ADVANCED --> NETWORK FILTER to enable WPS.");
?>
");
				return null;
			}
		}
		return PXML.doc;
	},
	IsDirty: null,
	Synchronize: function()
	{
		if (OBJ("pin").innerHTML!=this.curpin)
		{
			OBJ("mainform").setAttribute("modified", "true");
			XS(this.wifip+"/wps/pin", OBJ("pin").innerHTML);
			if(this.dual_band)


问题


面经


文章

微信
公众号

扫码关注公众号