当前位置: 首页>>代码示例>>PHP>>正文


PHP Language::translate方法代码示例

本文整理汇总了PHP中Language::translate方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::translate方法的具体用法?PHP Language::translate怎么用?PHP Language::translate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Language的用法示例。


在下文中一共展示了Language::translate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load

 static function load($app_name)
 {
     $apps = self::getAppList();
     if (!isset($apps[$app_name])) {
         return;
     }
     $app_dir = $apps[$app_name];
     self::$activeAppName = strtolower($app_name);
     self::$activeAppDir = $app_dir;
     $route_file_name = String::glue($app_dir, DS, APP_CONFIG_DIR, DS, 'route.php');
     if (php_sapi_name() != 'cli') {
         try {
             Route::setActive(Route::getPath(), file_exists($route_file_name) ? include $route_file_name : array(), true);
         } catch (Exception $e) {
             self::parseError($e, $app_name);
         }
     }
     self::setDefaultParams();
     // Abort this code, but later
     if (!Auth::loged() && Core::isSecure(Request::get('module')) && Request::get('module') != 'login' && false) {
         if (php_sapi_name() == 'cli') {
             echo 'Auth Error';
             exit;
         }
         Request::redirect('/login/' . (Request::get(Route::$path) ? '&return=' . Request::get(Route::$path) : ''));
     }
     //
     Settings::load('core', CORE_CONFIG_DIR . DS);
     self::loadDependences($app_dir);
     Settings::load($app_name);
     App::startApp($app_name);
     try {
         Load::Action($app_dir . DS, Request::get('action'));
     } catch (Exception $e) {
         self::parseError($e, $app_name);
     }
     App::endApp($app_name);
     Language::translate(Language::getActiveLanguageISO());
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:39,代码来源:App.class.php

示例2: createView

 /**
  * Create view
  */
 private function createView()
 {
     $this->oView->addData('titre', Language::translate('PERMISSIONS_ADMIN_TABLE_TITLE'));
     $oTable = new TableGenerator();
     $oTable->setId(md5('Access'));
     $aRanks = Rank::getRanks();
     $oTable->addColumn('');
     foreach ($aRanks as $oRank) {
         $oTable->addColumn($oRank->getName());
     }
     $aModules = Permission::getModules();
     foreach ($aModules as $iId => $sName) {
         $aBuffer = array();
         $aBuffer[] = $sName;
         foreach ($aRanks as $oRank) {
             if ($oRank->checkAccess($sName)) {
                 $sIcon = 'fa-check';
                 $sStyle = 'success';
                 $sNewValue = 'false';
             } else {
                 $sIcon = 'fa-times';
                 $sStyle = 'danger';
                 $sNewValue = 'true';
             }
             $oLabel = new View('minibutton');
             $oLabel->addData('icon', $sIcon);
             $oLabel->addData('style', $sStyle);
             $oLabel->addData('link', 'index.php?p=adminpermissions&m=' . $iId . '&r=' . $oRank->getId() . '&v=' . $sNewValue);
             $oLabel->create();
             $aBuffer[] = $oLabel->getCode();
         }
         $oTable->addLine($aBuffer);
     }
     $oTable->setBottom('');
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->Create();
 }
开发者ID:Jatax,项目名称:TKS,代码行数:41,代码来源:adminpermissions.controller.php

示例3: __toString

 /**
  * Display the error
  * @return string
  */
 public function __toString()
 {
     $this->log();
     return Language::translate($this->message);
 }
开发者ID:Jatax,项目名称:TKS,代码行数:9,代码来源:error.class.php

示例4:

				   </select>
				   </div>
			   </div>
			   <div class="col-md-12 text-center">
			   <div class="form-group">
			   <label for="description"><?php 
echo Language::translate("LBL_HELPDESK_DESCRIPTION");
?>
</label>
			   <textarea name="description" id="description" class="form-control" rows="10"></textarea>
			   </div>
			   </div>
				</div>
				</div>
				<!-- /.panel-body -->
				<div class="panel-footer">
					<input type="submit" value="<?php 
echo Language::translate("LBL_NEW_TICKET");
?>
" class="btn btn-success btn-lg">
				</div>
				</form>
				<!-- /.panel-footer -->
			</div>
		</div>
		<!-- /.col-lg-6 -->
	</div>
	<!-- /.row -->
</div>
<!-- /#page-wrapper -->
开发者ID:Bergdahls,项目名称:YetiForcePortal,代码行数:30,代码来源:create.php

示例5: t

/**
 * Shorthand function to translate using the Language class. Gets domain
 * from the class passed in the backtrace. IF dgettext is not compiled into PHP
 * the arguments are just returned with sprintf.
 * @return string
 * @see Language::translate()
 */
function t()
{
    static $lang = null;
    $args = func_get_args();
    if (!function_exists('dgettext')) {
        if (count($args) > 1) {
            return call_user_func_array('sprintf', $args);
        } else {
            return $args[0];
        }
    }
    if (empty($lang)) {
        $lang = new \Language();
    }
    $r = debug_backtrace();
    $file_path = $r[0]['file'];
    if (strstr($file_path, 'mod/')) {
        $domain = preg_replace('|.*mod/([^/]+)/.*|', '\\1', $file_path);
    } else {
        $domain = 'core';
    }
    $lang->setDomain($domain);
    return $lang->translate($args);
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:31,代码来源:Functions.php

示例6:

									<input class="form-control" placeholder="<?php 
echo Language::translate("LBL_EMAIL");
?>
" title="<?php 
echo Language::translate("LBL_EMAIL");
?>
"  name="email" type="email" autofocus required>
									<input name="forgot" type="hidden" value="1" >
								</div>
								<!-- Change this to a button or input when using this as a form -->
								<button type="submit" class="btn btn-lg btn-success btn-block"><?php 
echo Language::translate("LBL_SEND_PASSWORD");
?>
</button>
								<a onclick="$('#forgotpanel').hide();$('#loginpanel').show();" class="btn btn-lg btn-warning btn-block"><?php 
echo Language::translate("LBL_LNK_HOME");
?>
</a>
							</fieldset>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
<script src="themes/<?php 
echo $currtheme;
?>
/assets/js/login.js"></script> 
<?php 
require_once "themes/default/footer.php";
开发者ID:Bergdahls,项目名称:YetiForcePortal,代码行数:31,代码来源:login.php

示例7: strtoupper

        echo $field['netPrice' . $count];
        ?>
</td>
					</tr>
					<?php 
    }
    ?>
				</tbody>
			</table>
		</div>
	</div>
	<?php 
} else {
    ?>
    
	<h2>
		<?php 
    $listTrans = "LBL_NO_" . strtoupper($module) . "_RECORDS_FOUND";
    if (Language::translate($listTrans) != $listTrans) {
        echo Language::translate($listTrans);
    } else {
        echo Language::translate("LBL_NO_RECORDS_FOUND") . ': ' . $GLOBALS["modulesNames"][$module];
    }
    ?>
	</h2>
	<?php 
}
?>
	</div>
</div>
开发者ID:tsolucio,项目名称:coreBOSMYCCP,代码行数:30,代码来源:detail.php

示例8:

 * The content of this file is subject to the MYC Vtiger Customer Portal license.
 * ("License"); You may not use this file except in compliance with the License
 * The Initial Developer of the Original Code is Proseguo s.l. - MakeYourCloud
 * Portions created by Proseguo s.l. - MakeYourCloud are Copyright(C) Proseguo s.l. - MakeYourCloud
 * All Rights Reserved.
 * Contributor(s): YetiForce.com
 * ****************************************************************************** */
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title><?php 
echo Language::translate($title = $module ? $module : 'LBL_CUSTOMER_PORTAL');
?>
</title>
	<link rel="SHORTCUT ICON" href="<?php 
echo $currtheme;
?>
/images/favicon.ico">
	<!-- Bootstrap Core CSS -->
	<link href="themes/<?php 
echo $currtheme;
?>
/assets/css/bootstrap.min.css" rel="stylesheet">
	<!-- MetisMenu CSS -->
	<link href="themes/<?php 
echo $currtheme;
?>
开发者ID:Bergdahls,项目名称:YetiForcePortal,代码行数:31,代码来源:header.php

示例9: loadDataTable

    public static function loadDataTable()
    {
        echo '<script>
			$(document).ready(function() {
				$(".dataTablesContainer").dataTable( {
					"language": {
						"lengthMenu": "' . Language::translate("LBL_RECORDS_PER_PAGE") . '",
						"zeroRecords": "' . Language::translate("LBL_NOTHING_FOUND") . '",
						"info": "' . Language::translate("LBL_SHOWING_PAGE") . '",
						"infoEmpty": "",
						"infoPostFix": "",
						"url": "",
						"infoFiltered": "' . Language::translate("LBL_FILTERED_TOTAL_RECORDS") . '",
						"processing": "' . Language::translate("LBL_PROCESSING") . '",
						"search": "' . Language::translate("LBL_SEARCH") . ' ",
						"paginate": {
							"first": "' . Language::translate("LBL_FIRST") . '",
							"previous": "' . Language::translate("LBL_PREVIOUS") . '",
							"next": "' . Language::translate("LBL_NEXT") . '",
							"last": "' . Language::translate("LBL_LAST") . '"
						}
					}
				} );
			});
			</script>';
    }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:26,代码来源:portal.php

示例10:

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title><?php 
if (isset($GLOBALS['portal_title'])) {
    echo $GLOBALS['portal_title'] . " - ";
}
echo Language::translate(isset($module) ? $module : 'MYC Vtiger Customer Portal');
?>
</title>

    <!-- Bootstrap Core CSS -->
    <link href="themes/default/assets/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="themes/default/assets/css/plugins/metisMenu/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="themes/default/assets/css/sb-admin-2.css" rel="stylesheet">
    
    <link href="themes/default/assets/css/plugins/dataTables.bootstrap.css" rel="stylesheet">

    <!-- Custom Fonts -->
开发者ID:tsolucio,项目名称:coreBOSMYCCP,代码行数:31,代码来源:header.php

示例11:

                        <?php 
if ($data['ticket_status'] != "Closed") {
    ?>
                        <div class="panel-footer">
                        <form name="comments" action="index.php" method="post">
		   <input type="hidden" name="module" value="HelpDesk">
		   <input type="hidden" name="action" value="index">
		   <input type="hidden" name="fun" value="updatecomment">
		   <input type="hidden" name="ticketid" value='<?php 
    echo $data['ticketid'];
    ?>
'>
		   <textarea name="comments" rows="5" class="form-control input-sm" ></textarea>
		   <br>
		   <input class="btn btn-warning btn-sm" title="Send Comment" accesskey="S"  name="submit" value="<?php 
    echo Language::translate("Send Comment");
    ?>
" type="submit" onclick="if(trim(this.form.comments.value) != '') return true; else return false;" />
		   </form>
                        
                        </div>
                        <!-- /.panel-footer -->
                        <?php 
}
?>
                    </div>
                  
                </div>
                <!-- /.col-lg-6 -->
                
                
开发者ID:tsolucio,项目名称:coreBOSMYCCP,代码行数:29,代码来源:detail.php

示例12: structure

				  <div class="form-group">
				    <label for="default_language">Default Language</label>
				    <p class="help-block">Set the default language for your portal, the selected will be the first shown in the login picklist. To add a new language to the customer portal you just need to create a new file following the other languages files structure (presents in the language directory) and put it in the language directory with the name your_language.lang.php (replacing your_language with yout language code)</p>				    
				    <select name="default_language" id="default_language" class="form-control" >
				    <?php 
$result = array();
$themesdir = "../languages";
$cdir = scandir($themesdir);
foreach ($cdir as $key => $value) {
    if (!in_array($value, array(".", "..")) && strpos($value, '.lang.php') !== false) {
        $value = str_replace(".lang.php", "", $value);
        $selected = "";
        if ($value == $config['default_language']) {
            $selected = " selected";
        }
        $label = Language::translate($value, $value);
        echo "<option value='{$value}' {$selected}>{$label}</option>";
    }
}
?>
				    </select>				    
				  </div>
				  
				   
			   	
			
				  			   	
				<hr>
				  <b><em>You should set here your api credentials to enable the api-related functionalities of MYC Customer Portal, for example the Events Calendar</em></b><br><br>
						     <div class="form-group">
							    <label for="api_user">vTiger WS Api Username</label>
开发者ID:tsolucio,项目名称:coreBOSMYCCP,代码行数:31,代码来源:editor.php

示例13:

?>
</a></li>
		<li><a href="" data-toggle="modal" data-target="#changePassModal"><span class="glyphicon glyphicon-user"></span> <?php 
echo Language::translate("LBL_BTN_CHANGE_PASSWORD");
?>
</a><li>
	</ul>
	<!-- /.navbar-top-links -->
	<div class="navbar-default sidebar" role="navigation">
		<div class="sidebar-nav navbar-collapse">
			<ul class="nav" id="side-menu"> 
			<?php 
if ($GLOBALS['show_summary_tab']) {
    ?>
				<li><a href="index.php?module=Home&action=index"><?php 
    echo Language::translate("LBL_DASHBOARD");
    ?>
</a></li>
			<?php 
}
?>
			<?php 
foreach ($GLOBALS["avmod"] as $mod) {
    $active = '';
    if ($mod['name'] == $GLOBALS['targetmodule']) {
        $active = ' class="active"';
    }
    if (!in_array($mod['name'], $GLOBALS['hiddenmodules'])) {
        echo '<li><a href="index.php?module=' . $mod['name'] . '&action=index"' . $active . '>' . $mod['translated_name'] . '</a></li>';
    }
}
开发者ID:Bergdahls,项目名称:YetiForcePortal,代码行数:31,代码来源:menu.php

示例14:

						</form>
					</div>
				</div>
				<div class="login-panel " id="forgotpanel">
					<div class="panel-heading">
						<h3 class="panel-title"><?php echo Language::translate("LBL_RESET_PASSWORD"); ?></h3>
					</div>
					<div class="panel-body">
						<div class="row">
							<img alt="Logo" class="center-block cp-logo" title="Logo" src="<?php echo "themes/".$currtheme; ?>/images/logo.png"/>
						</div>
						<form role="form" method="post" >
							<fieldset>
								<div class="form-group">
									<input class="form-control" placeholder="<?php echo Language::translate("LBL_EMAIL"); ?>" title="<?php echo Language::translate("LBL_EMAIL"); ?>"  name="email" type="email" autofocus required>
									<input name="forgot" type="hidden" value="1" >
								</div>
								<!-- Change this to a button or input when using this as a form -->
								<button type="submit" class="btn btn-lg btn-success btn-block"><?php echo Language::translate("LBL_SEND_PASSWORD"); ?></button>
								<a onclick="$('#forgotpanel').hide();$('#loginpanel').show();" class="btn btn-lg btn-warning btn-block"><?php echo Language::translate("LBL_LNK_HOME"); ?></a>
							</fieldset>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
<script src="themes/<?php echo $currtheme; ?>/assets/js/login.js"></script> 
<?php require_once("themes/default/footer.php"); ?>

开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:29,代码来源:login.php

示例15:

<p><?php 
echo Language::translate("EMAILS_ACCOUNT_RECOVERY_EMAIL_TEXT");
?>
</p>
<p>
    <a href="<?php 
echo Url::site("login/restore/" . $hash);
?>
" target="_blank">
        <?php 
echo Language::translate("EMAILS_ACCOUNT_RECOVERY_EMAIL_LINK");
?>
    </a>
</p>
开发者ID:flafuente,项目名称:parrillas,代码行数:14,代码来源:accountRecovery.view.php


注:本文中的Language::translate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。