本文整理汇总了PHP中Translator::__方法的典型用法代码示例。如果您正苦于以下问题:PHP Translator::__方法的具体用法?PHP Translator::__怎么用?PHP Translator::__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Translator
的用法示例。
在下文中一共展示了Translator::__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __toString
/**
* @inheritDoc
*/
public function __toString()
{
try {
return Translator::__($this->key, $this->params, $this->domain, $this->locale);
} catch (\Exception $e) {
return (string) $this->key;
}
}
示例2: clientAll
function clientAll($con)
{
include "../functions/section.php";
//translate
require_once 'class.translation.php';
if (isset($llk)) {
$translate = new Translator($llk);
} else {
$translate = new Translator('en');
}
$query = mysqli_query($con, "SELECT * FROM client order by date DESC");
//$query = mysqli_query($con,"SELECT * FROM client JOIN admin_pass ON client.email = admin_pass.email ORDER BY client.id DESC");
echo "<table id='clientalh' >" . " <tr><td>id</td> <td>" . $translate->__('Firstname') . "</td><td>" . $translate->__('Lastname') . "</td><td title='{$email}'>" . $translate->__('Email') . "</td><td title='{$date}'>" . $translate->__('date') . " </td><td><span >" . $translate->__('Act/Deact') . "</span></td> <td><span >" . $translate->__('Check for Addmin') . "</span></td></tr>" . "</table>";
echo "<table id='cliental' >";
while ($row = mysqli_fetch_array($query)) {
$first = $row['firstname'];
$last = $row['lastname'];
$email = $row['email'];
$date = $row['date'];
$id = $row['id'];
$a = $row['act'];
$pp = $row['password'];
$lenE = ucfirst(substr($email, 0, 23));
if ($a == 1) {
$aa = "Active";
$radioc = "Checked";
} else {
$aa = "Deactive";
$radioc = "";
}
if ($a == 0) {
$radiocc = "Checked";
} else {
$radiocc = "";
}
$queryy = mysqli_query($con, "SELECT * FROM admin_pass where cid='{$id}'");
$rowe = mysqli_fetch_array($queryy);
$ae = $rowe['email'];
if ($email == $ae) {
$ade = "Admin";
$check = "Checked";
} else {
$ade = "Client";
$check = "";
}
echo " <tr><td><a href='#'>{$id}</a></td> <td>{$first}</td><td>{$last}</td><td title='{$email}'>{$lenE}</td><td title='{$date}'>{$date} </td><td title=''><input {$radioc} name='c{$id}' type='radio' value='act' onclick=\"act(1,'{$id}')\"\n >Act <input {$radiocc} onclick=\"act('0','{$id}')\" chedcked name='c{$id}' type='radio' value='deact'\n >Deact.<span style='color:white; background-color:orange; font-size:9px;' id='acc{$id}'>{$aa}</span></td><td><span ><input {$check} onClick=\"checkaddmin('{$id}','{$first}','{$last}','{$email}','{$pp}','{$ade}')\" value='checka' type=\"checkbox\" ><span id=\"adde{$id}\">{$ade}</span></span></td> </tr>";
}
echo "</table>";
}
示例3:
$dbfirstname = $row['firstname'];
$dblastname = $row['lastname'];
$dbpassword = $row['password'];
$dboccupation = $row['date'];
//working with sessions
$_SESSION['id'] = $id;
$_SESSION['email'] = $dbemail;
$_SESSION['lastname'] = $dblastname;
$_SESSION['firstname'] = $dbfirstname;
}
}
} else {
echo "User already exist";
}
} else {
$translate->__("Password do not match");
}
} else {
$translate->__("Password is too short");
}
} else {
$translate->__("Input password");
}
} else {
$translate->__("Email format not valid");
}
} else {
$translate->__("input email");
}
} else {
$translate->__("input lastname");
示例4: Translator
<?php
require_once 'class.translation.php';
if (isset($_GET['lang'])) {
$translate = new Translator($_GET['lang']);
} else {
$translate = new Translator('en');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php
$translate->__('CSS Registration Form');
?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15"/>
<link rel="stylesheet" type="text/css" href="css/default.css"/>
</head>
<body>
<form action="" class="register">
<h1><?php
$translate->__('Registration');
?>
<a class="flag_deutsch" title="deutsch" href="register.php?lang=de">english</a><a class="flag_english" title="english" href="register.php">spanish</a></h1>
<fieldset class="row1">
<legend><?php
$translate->__('Account Details');
?>
</legend>
<p>
示例5:
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>psych</title>
<link type="text/css" href="./css/login.css" rel="stylesheet"/>
</head>
<body id="s" >
<div id="lann">
<center><span id="show_lan" style="cursor:pointer;"><?php
echo $translate->__('Choose language');
?>
</span><br/> <div id="ll"><a title="spanish" href="index.php?lang=de"><?php
echo $translate->__('Spanish');
?>
</a><br/><a title="english" href="index.php">english</a></div>
<p></p>
</center>
</div>
<div id="top"></div>
<div id="login">
<fordm action="" method="post">
示例6:
<body>
<div id="cont">
<div id="header">
<h1><a href="/"><img src="img/logo.png" width="200"/></a></h1>
<div class="container">
<div id="nav">
<ul>
<li class="<?php
if ($page == 'main') {
echo 'active';
}
?>
"><a href="/"><?php
$translate->__('Main');
?>
</a></li>
<!-- <li><a href="index2.html"><?php
$translate->__('Description');
?>
</a></li> -->
<li class="<?php
if ($page == 'prod') {
echo 'active';
}
?>
">
<b><?php
$translate->__('Products');
?>
示例7: Translator
$translate = new Translator('en');
}
?>
<div id="search_body">
<div id="left_dropdown">
<select name="sel" id="sel" onchange="displaye();" title="Age">
<option style=" display:none;"><?php
echo $translate->__('Age');
?>
</option>
<?php
dropshow($con, "Age");
?>
</select>
<select name="sel2" id="sel2" onchange="displaye();" title="Stage of Change" >
<option style="display:none;"><?php
echo $translate->__('Stage of Change');
?>
</option>
示例8:
echo $setting[0];
}
?>
</title>
<link rel="stylesheet" type="text/css" href="min/?g=css_i&5259487"/>
<!--[if lt IE 9]><script src="js/html5shiv-printshiv.js"></script><![endif]-->
</head>
<body>
<div class="container">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class='container'>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#header-nav-collapse">
<span class="sr-only"><?php
$translate->__("Toggle navigation", false);
?>
</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href='index.php'><?php
if (isset($setting[0])) {
echo $setting[0];
}
?>
</a>
</div>
<div class="collapse navbar-collapse" id="header-nav-collapse">
示例9:
</head>
<body onload="loadp('<?php
echo $llk;
?>
');">
<div id="search_resulte">
</div>
<div id="admin">
<div id="heade">
<span id="logout" ><a style="color:orange; font-size:20px;
text-decoration:none; margin-left:2px;" href="../functions/logout.php" > <?php
echo $translate->__('Logout');
?>
</a></span>
<span id="insertm" style=" cursor:pointer; font-size:20px; color:green; border-left:thin solid green; border-right:thin solid green; padding:2px;"> <?php
echo $translate->__('Insert manually');
?>
</span>
<span id="uploadee" style=" cursor:pointer; font-size:20px; color:green; "><?php
echo $translate->__('Upload');
?>
</span>
<span id="searched" style="cursor:pointer; font-size:20px; color:green; border-left:thin solid green; padding:2px;"> <?php
echo $translate->__('Search');
?>
</span>
<span id="cliente" ><a href="admin.php" style=" text-decoration:none; color:orange; border-left:thin solid green; padding:2px;"><?php
示例10: Translator
require "connection.php";
require 'class.translation.php';
session_start();
//translate
$sp = $_GET['sp'];
if (isset($sp)) {
$translate = new Translator($sp);
} else {
$translate = new Translator('en');
}
$emailss = $_SESSION['email'];
$pagee = $_GET['v'];
$p = $pagee;
$x = $p * 25 - 25;
$query = mysqli_query($con, "select * from groupp order by id DESC limit {$x}, 25");
echo "\n\n\n<div ><table id='groupd' id='' style=' padding-left:3px;' ><tr ><td><center><div style='width:80px; '><b>\n" . $translate->__("Age") . "\n</b></div></center></td><td ><center><div style='width:140px; padding-left:3px;'><b>" . $translate->__("Stage of Change") . "</b></div></center></td><td><center><div style='width:140px; padding-left:3px; overflow-x: hidden;'><b>" . $translate->__("Symptoms and Disorders") . "</b></div></center></td><td><center><div style='width:200px;padding-left:3px; overflow-x: hidden; '><b>" . $translate->__("Psychological Treatment") . "</b></div></center></td><td><center><div style='width:120px; padding-left:3px;overflow-x: hidden; '><b>" . $translate->__("Evidence Level") . "</b></div></center></td><td><center><div style='width:500px; padding-left:3px;overflow-x: hidden; '><b>" . $translate->__("Basis for Evidence") . "</b></div></center></td><td></td><td></td></tr></table><div>";
while ($row = mysqli_fetch_array($query)) {
$age = ucfirst($row['Age']);
$id = ucfirst($row['id']);
$Stage_of_Change = ucfirst($row['Stage_of_Change']);
$Symptoms_and_Disorders = ucfirst($row['Symptoms_and_Disorders']);
$Psychological_Treatment = ucfirst($row['Psychological_Treatment']);
$Evidence_Level = ucfirst($row['Evidence_Level']);
$Basis_for_Evidence = ucfirst($row['Basis_for_Evidence']);
$id = $row['id'];
if ($age == "Child") {
mysqli_query($con, "DELETE FROM groupp WHERE id = '{$id}'");
}
echo "<table id='groupf' class='{$id}'><tr ><td ><div contenteditable='true' style='width:80px; padding-left:3px; overflow-x: hidden;'id='a{$id}' onkeyup=\"up({$id},'a{$id}','Age');\"> {$age}</div></td><td ><div style='width:140px; overflow-x: hidden; padding-left:3px;' contenteditable='true' id = 'b{$id}' onkeyup=\"up({$id},'b{$id}','Stage_of_Change');\" >{$Stage_of_Change}</div></td><td><div style='width:140px; overflow-x: hidden; padding-left:3px;' contenteditable='true' id='c{$id}' onkeyup=\"up({$id},'c{$id}','Symptoms_and_Disorders');\">{$Symptoms_and_Disorders}</div></td><td><div style='width:200px; overflow-x: hidden; padding-left:3px;' contenteditable='true' id='d{$id}' onkeyup=\"up({$id},'d{$id}','Psychological_Treatment');\">{$Psychological_Treatment}</div></td><td> <div contenteditable='true' style='width:120px; overflow-x: hidden; padding-left:3px;' id='e{$id}' onkeyup=\"up({$id},'e{$id}','Evidence_Level');\">{$Evidence_Level}</div></td><td><div style='width:500px; height:80px; overflow-x: hidden; padding-left:3px;' contenteditable='true' contenteditable='true' id='f{$id}' onkeyup=\"up({$id},'f{$id}','Basis_for_Evidence');\">{$Basis_for_Evidence} </div></td><td style=' border: 0px solid ;\tbackground-color:rgba(240,240,240,0); padding-left:3px; ' ><br/><span id='xx' onclick='delep({$id});' title='delete' >x</span></td></tr></table>";
}
?>
示例11:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<?php
$i = 1;
?>
<link type="text/css" href="../css/main.css" rel="stylesheet"/>
</head>
<body>
<div id="top">
<span id="logout"><a href="../functions/logout.php" title="<?php
echo $translate->__('Logout');
?>
"></a></span>
<span id= "welcome"><?php
echo $translate->__('Welcome') . " {$first} {$last} ";
?>
</span>
<span id="welcome"><span style="color:black;">||</span><a style="color:orange; text-decoration:none;" href="../main/admine.php" ><?php
echo $translate->__('Admin Section');
?>
</a></span>
</div>
<div id="admin">
示例12:
}
?>
<div id="top-anchor"></div>
<!-- NAVBAR
================================================== -->
<div class="banner navbar navbar-static-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<nav id="slide-menu" class="visible-phone">
<div class="menu-trigger"><i class="icon-reorder white icon-2x"></i></div>
<ul class="hide">
<li <?php
echo $home;
?>
><a href="index.php"><?php
echo $brtext->__('HOME');
?>
</a></li>
<li <?php
echo $about;
?>
><a href="about-joomla-component-creator.php"><?php
echo $brtext->__('ABOUT');
?>
</a></li>
<li <?php
echo $login;
?>
><a href="login.php"><?php
echo $brtext->__('LOGIN');
?>
示例13:
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<?php
$i = 1;
?>
<link type="text/css" href="../css/main.css" rel="stylesheet"/>
</head>
<body>
<div id="top">
<span id="logout"><a href="../functions/logout.php" title="Log Out" ></a></span>
<span id="setting" >
<a style=" margin-left:3px; color:orange;" href="./main.php" title="Main page"><?php
echo $translate->__('Main');
?>
</a></span>
<span id= "welcome"><a style=" font-family:'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'DejaVu Sans', Verdana, sans-serif;color:white; text-decoration:none; background-color: ;" href="./profilec.php" title="Your profile edit">
<?php
$ff = mysqli_query($con, "select * from client where email ='{$emailss}'");
while ($r = mysqli_fetch_array($ff)) {
echo $translate->__('Welcome') . $r['firstname'] . " " . $r['lastname'];
}
?>
</a></span>
</div>
示例14:
?>
</title>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="../min/?g=css_i&5259487"/>
<!--[if lt IE 9]><script src="../js/html5shiv-printshiv.js"></script><![endif]-->
</head>
<body>
<div class="container">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class='container'>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#header-nav-collapse">
<span class="sr-only"><?php
$translate->__("Toggle navigation", false);
?>
</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href='../index.php'><?php
if (isset($setting[0])) {
echo $setting[0];
}
?>
</a>
</div>
<div class="collapse navbar-collapse" id="header-nav-collapse">
示例15:
}
?>
</head>
<body>
<?php
if (isset($error)) {
echo '<script>alert("' . $error . '");</script>';
}
?>
<div class="container">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class='container'>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#header-nav-collapse">
<span class="sr-only"><?php
$translate->__("Toggle navigation", false);
?>
</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href='../index.php'><?php
if (isset($setting[0])) {
echo $setting[0];
}
?>
</a>
</div>
<div class="collapse navbar-collapse" id="header-nav-collapse">