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


PHP LanguageManager::getLanguage方法代码示例

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


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

示例1: generateHeader

 function generateHeader()
 {
     $this->content .= '<!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="' . LanguageManager::getLanguage() . '" >
        <head>
            <title>' . _("Perroquet — Listening comprehension tutor — ") . $this->title . '</title>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
         <link rel="stylesheet" media="screen" type="text/css" title="Design" href="/style/default.css" />
         <link rel="icon" type="image/png" href="/ressources/style/favicon.png" />
        </head>
        <body>';
 }
开发者ID:niavok,项目名称:perroquet-website,代码行数:12,代码来源:HtmlPage.php

示例2: generateContent

 function generateContent()
 {
     $content = '
     <h1>' . _('Select language') . '</h1>';
     $langs = Config::getLanguagelist();
     $content .= '<form action="' . RessourceManager::getInnerUrl('special/language/select') . '" method="GET">';
     $content .= '
             <label for="language">' . _('Choose the new language : ') . '</label>
             <select name="language" id="language">';
     foreach ($langs as $lang) {
         if ($lang['choosable']) {
             $content .= '
             <option value="' . $lang['code'] . '" ' . ($lang['code'] == LanguageManager::getLanguage() ? 'selected="selected"' : '') . '>' . $lang['label'] . '</option>';
         }
     }
     $content .= '</select><br /><input type="submit" value="' . _("Select") . '"></form>';
     return $content;
 }
开发者ID:niavok,项目名称:perroquet-website,代码行数:18,代码来源:choose.php

示例3: lang

 /**
  * get the language parameters
  *
  * @param string $lang
  * @return array|bool
  */
 public function lang($lang = '')
 {
     return $this->languageManager->getLanguage($lang);
 }
开发者ID:AnonymPHP,项目名称:Anonym-View,代码行数:10,代码来源:View.php

示例4: serializeAttributes

// loading 'sticky' attributes values from session for this fuseaction
getStickyAttributes($oFuseaction->getName(), $oFuseaction->getStickyAttributes());
// these attributes are not needed to identify current page
$exceptAttributes = array_merge($ogFuseaction->getStickyAttributes(), $oFuseaction->getStickyAttributes());
$exceptAttributes[] = "fusebox.password";
$exceptAttributes[] = "fuseaction";
$exceptAttributes[] = "messages";
// variable to identify current page
$here = $self . "?" . serializeAttributes($exceptAttributes);
// LanguageManager initialization
$oLanguageManager = new LanguageManager($oDB, $fusebox['tableLanguages']);
if (!$oLanguageManager->initialize()) {
    _throw("FNoLanguagesTable", "There is no languages table called \"{$fusebox['tableLanguages']}\" present in DB");
}
// trying to get default language, adding it if not exists
if (!($oLanguage = $oLanguageManager->getLanguage($fusebox['defaultLanguage'], true))) {
    _throw("FCannotSetDefaultLanguage", "Cannot set default language \"{$fusebox['defaultLanguage']}\"");
}
// setting language of the site content
if (isset($attributes['language'])) {
    // trying to get given language, but not adding it automatically
    if ($otmpLanguage = $oLanguageManager->getLanguage($attributes['language'])) {
        $oLanguage = $otmpLanguage;
    } else {
        _bye("ERROR [FCannotSetGivenLanguage] " . "Cannot set given language \"{$attributes['language']}\"");
    }
    unset($otmpLanguage);
}
$oContentManager = new ContentManager($oDB, $oFuseaction, $oLanguage, $fusebox['tableContentTokens'], $fusebox['tableContent'], $fusebox['tableContentComments'], false);
$ogContentManager = new ContentManager($oDB, $ogFuseaction, $oLanguage, $fusebox['tableContentTokens'], $fusebox['tableContent'], $fusebox['tableContentComments'], false);
if (!$oContentManager->initialize() || !$ogContentManager->initialize()) {
开发者ID:rodionbykov,项目名称:zCMS,代码行数:31,代码来源:myGlobals.php

示例5: getExternUrl

 static function getExternUrl($key)
 {
     return 'http://' . $_SERVER["SERVER_NAME"] . '/' . LanguageManager::getLanguage() . '/' . $key;
 }
开发者ID:niavok,项目名称:perroquet-website,代码行数:4,代码来源:RessourceManager.php

示例6: displayLanguages

 /**
  * Affiche les langues parlées par un utilisateur et son niveau.
  * @param User $user
  *
  **/
 public function displayLanguages($userId)
 {
     // On récupère les langues parlées par un utilisateur dans un array.
     $language_manager = new LanguageManager($db);
     $languages = self::getUsersLanguages($userId);
     foreach ($languages as $language) {
         var_dump($language);
         $level = $language->levelId();
         echo '<h1>' . $language_manager->getLanguage($language->languageId()) . '<h1>';
         Form::level_form($level);
     }
 }
开发者ID:MarionCrp,项目名称:Projet,代码行数:17,代码来源:SpokenLanguageManager.php


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