本文整理汇总了PHP中Translate函数的典型用法代码示例。如果您正苦于以下问题:PHP Translate函数的具体用法?PHP Translate怎么用?PHP Translate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Translate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: credit_selection
function credit_selection()
{
$selection_string = '';
$close_string = '';
$credit_class_string = '';
if (MODULE_ORDER_TOTAL_INSTALLED) {
$header_string .= '<div class="infobox_heading">' . Translate('Hebt u een cadeaubon?') . '</div>';
$header_string .= '<div class="infobox_content">';
$close_string = '</div>';
reset($this->modules);
$output_string = '';
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {
if ($selection_string == '') {
$selection_string = $GLOBALS[$class]->credit_selection();
}
if ($use_credit_string != '' || $selection_string != '') {
$output_string = $selection_string;
}
}
}
if ($output_string != '') {
$output_string = $header_string . $output_string;
$output_string .= $close_string;
}
}
return $output_string;
}
示例2: Index
public function Index($Offset = 0, $Limit = NULL)
{
$this->AddJsFile('/js/library/jquery.gardenmorepager.js');
$this->AddJsFile('search.js');
$this->Title(Translate('Search'));
if (!is_numeric($Limit)) {
$Limit = Gdn::Config('Garden.Search.PerPage', 20);
}
$Search = $this->Form->GetFormValue('Search');
$ResultSet = $this->SearchModel->Search($Search, $Offset, $Limit);
$this->SetData('SearchResults', $ResultSet, TRUE);
$this->SetData('SearchTerm', Format::Text($Search), TRUE);
$NumResults = $ResultSet->NumRows();
if ($NumResults == $Offset + $Limit) {
$NumResults++;
}
// Build a pager
$PagerFactory = new PagerFactory();
$Pager = $PagerFactory->GetPager('MorePager', $this);
$Pager->MoreCode = 'More Results';
$Pager->LessCode = 'Previous Results';
$Pager->ClientID = 'Pager';
$Pager->Configure($Offset, $Limit, $NumResults, 'garden/search/%1$s/%2$s/?Search=' . Format::Url($Search));
$this->SetData('Pager', $Pager, TRUE);
$this->View = 'results';
$this->Render();
}
示例3: Advanced
public function Advanced()
{
$this->Permission('Vanilla.Settings.Manage');
$Validation = new Gdn_Validation();
$ConfigurationModel = new Gdn_ConfigurationModel($Validation);
$ConfigurationModel->SetField(array('Vanilla.Archive.Date', 'Vanilla.Archive.Exclude'));
// Set the model on the form.
$this->Form->SetModel($ConfigurationModel);
// If seeing the form for the first time...
if ($this->Form->AuthenticatedPostBack() === FALSE) {
// Apply the config settings to the form.
$this->Form->SetData($ConfigurationModel->Data);
} else {
$ConfigurationModel->Validation->ApplyRule('Vanilla.Archive.Date', 'Date');
// Grab old config values to check for an update.
$ArchiveDateBak = Gdn::Config('Vanilla.Archive.Date');
$ArchiveExcludeBak = (bool) Gdn::Config('Vanilla.Archive.Exclude');
$Saved = $this->Form->Save();
if ($Saved) {
$ArchiveDate = Gdn::Config('Vanilla.Archive.Date');
$ArchiveExclude = (bool) Gdn::Config('Vanilla.Archive.Exclude');
if ($ArchiveExclude != $ArchiveExcludeBak || $ArchiveExclude && $ArchiveDate != $ArchiveDateBak) {
$DiscussionModel = new Gdn_DiscussionModel();
$DiscussionModel->UpdateDiscussionCount('All');
}
$this->StatusMessage = Translate("Your changes have been saved.");
}
}
$this->AddSideMenu('vanilla/settings/advanced');
$this->AddJsFile('settings.js');
$this->Title(Translate('Advanced Forum Settings'));
$this->Render();
}
示例4: Spam
public function Spam()
{
$this->Permission('Vanilla.Spam.Manage');
$this->AddSideMenu('vanilla/settings/spam');
$Validation = new Gdn_Validation();
$ConfigurationModel = new Gdn_ConfigurationModel('Configuration', PATH_CONF . DS . 'config.php', $Validation);
$ConfigurationModel->SetField(array('Vanilla.Discussion.SpamCount', 'Vanilla.Discussion.SpamTime', 'Vanilla.Discussion.SpamLock', 'Vanilla.Comment.SpamCount', 'Vanilla.Comment.SpamTime', 'Vanilla.Comment.SpamLock', 'Vanilla.Comment.MaxLength'));
// Set the model on the form.
$this->Form->SetModel($ConfigurationModel);
// If seeing the form for the first time...
if ($this->Form->AuthenticatedPostBack() === FALSE) {
// Apply the config settings to the form.
$this->Form->SetData($ConfigurationModel->Data);
} else {
// Define some validation rules for the fields being saved
$ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamCount', 'Required');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamCount', 'Integer');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamTime', 'Required');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamTime', 'Integer');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamLock', 'Required');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamLock', 'Integer');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamCount', 'Required');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamCount', 'Integer');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamTime', 'Required');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamTime', 'Integer');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamLock', 'Required');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamLock', 'Integer');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.MaxLength', 'Required');
$ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.MaxLength', 'Integer');
if ($this->Form->Save() !== FALSE) {
$this->StatusMessage = Translate("Your changes have been saved.");
}
}
$this->Render();
}
示例5: PluginController_SingleSignOn_Create
public function PluginController_SingleSignOn_Create($Sender, $EventArguments)
{
$Sender->Head->Title('Single Sign-on');
$Sender->AddSideMenu('garden/plugin/singlesignon');
$Validation = new Gdn_Validation();
$ConfigurationModel = new Gdn_ConfigurationModel($Validation);
$ConfigurationModel->SetField(array('Garden.Authenticator.Type', 'Garden.Authenticator.Encoding', 'Garden.Authenticator.AuthenticateUrl', 'Garden.Authenticator.SignInUrl', 'Garden.Authenticator.SignOutUrl', 'Garden.Authenticator.RegisterUrl', 'Garden.Cookie.Path'));
// Set the model on the form.
$Sender->Form = new Gdn_Form();
$Sender->Form->SetModel($ConfigurationModel);
// If seeing the form for the first time...
if ($Sender->Form->AuthenticatedPostBack() === FALSE) {
// Apply the config settings to the form.
$Sender->Form->SetData($ConfigurationModel->Data);
$Sender->Form->SetValue('EnableSSO', Gdn::Config('Garden.Authenticator.Type') == 'Handshake' ? 'TRUE' : '');
} else {
// Make sure to force some values
$Sender->Form->SetFormValue('Garden.Authenticator.Type', $Sender->Form->GetFormValue('EnableSSO', '') == 'TRUE' ? 'Handshake' : 'Password');
$Sender->Form->SetFormValue('Garden.Authenticator.Encoding', 'ini');
$Sender->Form->SetFormValue('Garden.Cookie.Path', '/');
// <-- Make sure that Vanilla's cookies don't have a path
if ($Sender->Form->Save() !== FALSE) {
$Sender->StatusMessage = Translate("Your changes have been saved successfully.");
}
}
$Sender->Render(PATH_PLUGINS . DS . 'SingleSignOn' . DS . 'views' . DS . 'index.php');
}
示例6: quote
function quote($method = '')
{
global $order, $cart, $shipping_weight, $shipping_num_boxes;
if (MODULE_SHIPPING_TABLE4_MODE == 'price') {
$order_total = $cart->show_total();
} else {
$order_total = $shipping_weight;
}
$table4_cost = preg_split("/[:,]/", MODULE_SHIPPING_TABLE4_COST);
$size = sizeof($table4_cost);
for ($i = 0, $n = $size; $i < $n; $i += 2) {
if ($order_total <= $table4_cost[$i]) {
$shipping = $table4_cost[$i + 1];
break;
}
}
if (MODULE_SHIPPING_TABLE4_MODE == 'weight') {
$shipping = $shipping * $shipping_num_boxes;
}
$this->quotes = array('id' => $this->code, 'module' => Translate('table4 titel'), 'methods' => array(array('id' => $this->code, 'title' => Translate('table4 omschrijving'), 'cost' => $shipping + MODULE_SHIPPING_TABLE4_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (tep_not_null($this->icon)) {
$this->quotes['icon'] = tep_image($this->icon, $this->title);
}
return $this->quotes;
}
示例7: create_iDeal_box
function create_iDeal_box()
{
if ($this->query_bankinfo) {
$client = new SoapClient($this->wsdl);
$params->merchantID = MODULE_PAYMENT_ICEPAY_MERCHANT_ID;
$params->secretCode = MODULE_PAYMENT_ICEPAY_SECRET;
$ideal_object = $client->GetIDEALIssuers($params);
$ideal_issuers = $ideal_object->GetIDEALIssuersResult->string;
$ideal_issuers_arr = array();
foreach ($ideal_issuers as $ideal_issuer) {
$ideal_issuers_arr[] = array('id' => $ideal_issuer, 'text' => $ideal_issuer);
}
} else {
$ideal_issuers_arr[] = array('id' => 'ABNAMRO', 'text' => 'ABN AMRO');
$ideal_issuers_arr[] = array('id' => 'ASNBANK', 'text' => 'ASN Bank');
$ideal_issuers_arr[] = array('id' => 'FRIESLAND', 'text' => 'Friesland Bank');
$ideal_issuers_arr[] = array('id' => 'ING', 'text' => 'ING');
$ideal_issuers_arr[] = array('id' => 'RABOBANK', 'text' => 'Rabobank');
$ideal_issuers_arr[] = array('id' => 'SNSBANK', 'text' => 'SNS Bank');
$ideal_issuers_arr[] = array('id' => 'SNSREGIOBANK', 'text' => 'SNS Regio Bank');
$ideal_issuers_arr[] = array('id' => 'TRIODOSBANK', 'text' => 'Triodos Bank');
$ideal_issuers_arr[] = array('id' => 'VANLANSCHOT', 'text' => 'Van Lanschot');
}
$dropdown = '<select name="ic_issuer" >';
foreach ($ideal_issuers_arr as $ideal_issuer) {
$dropdown .= '<option value="' . $ideal_issuer['id'] . '" >' . $ideal_issuer['text'] . '</option>';
}
$dropdown .= '</select>';
$create_iDeal_box = "<div style=\"margin-right:20px; display:block; float:left;\">" . Translate('Kies uw bank voor het afrekenen met iDEAL: ') . $dropdown . "</div>";
return $create_iDeal_box;
}
示例8: getLangStr
function getLangStr($str)
{
switch ($str) {
case "title":
return Translate('Betalen via automatische incasso');
break;
}
}
示例9: TranslateArray
function TranslateArray($arr)
{
$retarr = array();
for ($i = 0; $i < count($arr); $i++) {
array_push($retarr, Translate($arr[$i], 'en_to_hi'));
}
return $retarr;
}
示例10: t
function t($text, $context = '')
{
if ($context == '') {
return Translate($text, __CLASS__);
} else {
return Translate_With_GetText_Context($text, $context, __CLASS__);
}
}
示例11: t
public function t($text, $context = Null)
{
# Translates the string $text with context $context
if (empty($context)) {
return Translate($text, __CLASS__);
} else {
return Translate_With_GetText_Context($text, $context, __CLASS__);
}
}
示例12: index
function index()
{
//$this->load->library('translator');
$string = '';
if (isset($_POST['text']) && !empty($_POST['text'])) {
$string = Translate($_POST['text']);
}
echo $string;
}
示例13: ot_subtotal
function ot_subtotal()
{
$this->code = 'ot_subtotal';
$this->title = Translate('Subtotaal');
$this->description = MODULE_ORDER_TOTAL_SUBTOTAL_DESCRIPTION;
$this->enabled = MODULE_ORDER_TOTAL_SUBTOTAL_STATUS == 'true' ? true : false;
$this->sort_order = MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER;
$this->output = array();
}
示例14: ccerr
function ccerr()
{
global $order;
$this->code = 'ccerr';
$this->title = Translate('Credit Class Error');
$this->description = Translate('Credit Class Error, needed with Gift Voucher');
$this->sort_order = MODULE_PAYMENT_CCERR_SORT_ORDER;
$this->enabled = false;
}
示例15: getLangStr
function getLangStr($str)
{
switch ($str) {
case "title":
return Translate('Betalen met paysafecard');
break;
case "descr":
return Translate('The main ICEPAY module must be installed (does not have to be active) to use this payment method.');
break;
}
}