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


PHP Translation::getTranslationEnvironments方法代码示例

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


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

示例1: getWorkspacesAvailable




$availableWorkspace = getWorkspacesAvailable ();



//Translations

//$Translations = G::getModel("Translation");  <-- ugly way to get a class

require_once "classes/model/Translation.php";

$Translations = new Translation();

$translationsTable = $Translations->getTranslationEnvironments();



$availableLangArray = array ();

$availableLangArray [] = array ('LANG_ID' => 'char', 'LANG_NAME' => 'char');



foreach ($translationsTable as $locale) {

    $aFields['LANG_ID'] = $locale['LOCALE'];

    if ($locale['COUNTRY'] != '.') {
开发者ID:nhenderson,项目名称:processmaker,代码行数:27,代码来源:sysLogin.php

示例2: getLanguagesList

 public function getLanguagesList()
 {
     $Translations = new Translation();
     $translationsTable = $Translations->getTranslationEnvironments();
     if (($languagesList = $this->memcache->get('languagesList')) === false) {
         $languagesList = array();
         foreach ($translationsTable as $locale) {
             $LANG_ID = $locale['LOCALE'];
             if ($locale['COUNTRY'] != '.') {
                 $LANG_NAME = $locale['LANGUAGE'] . ' (' . ucwords(strtolower($locale['COUNTRY'])) . ')';
             } else {
                 $LANG_NAME = $locale['LANGUAGE'];
             }
             $languagesList[] = array($LANG_ID, $LANG_NAME);
         }
         $this->memcache->set('languagesList', $languagesList, 1 * 3600);
     }
     return $languagesList;
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:19,代码来源:main.php

示例3: upgradeContent

 /**
  * Upgrade this workspace Content.
  */
 public function upgradeContent($workSpace = SYS_SYS)
 {
     $this->initPropel(true);
     require_once 'classes/model/Translation.php';
     $translation = new Translation();
     $information = $translation->getTranslationEnvironments();
     $arrayLang = array();
     foreach ($information as $key => $value) {
         $arrayLang[] = trim($value['LOCALE']);
     }
     require_once 'classes/model/Content.php';
     $regenerateContent = new Content();
     $regenerateContent->regenerateContent($arrayLang, $workSpace);
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:17,代码来源:class.wsTools.php

示例4: isset

<?php

$request = isset($_REQUEST['request']) ? $_REQUEST['request'] : null;
switch ($request) {
    case 'getLangList':
        $Translations = new Translation();
        $result = new stdClass();
        $result->rows = array();
        $langs = $Translations->getTranslationEnvironments();
        foreach ($langs as $lang) {
            $result->rows[] = array('LAN_ID' => $lang['LOCALE'], 'LAN_NAME' => $lang['LANGUAGE']);
        }
        $result->rows[] = array("LAN_ID" => "", "LAN_NAME" => G::LoadTranslation("ID_USE_LANGUAGE_URL"));
        print G::json_encode($result);
        break;
    case 'saveSettings':
        $memcache =& PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : '');
        G::LoadClass('configuration');
        $conf = new Configurations();
        $conf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
        $conf->aConfig['login_enableForgotPassword'] = isset($_REQUEST['forgotPasswd']);
        $conf->aConfig['login_enableVirtualKeyboard'] = isset($_REQUEST['virtualKeyboad']);
        $conf->aConfig['login_defaultLanguage'] = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en';
        $conf->saveConfig('ENVIRONMENT_SETTINGS', '');
        $lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en';
        //remove from memcache when this value is updated/created
        $memcache->delete('flagForgotPassword');
        $response = new stdclass();
        $response->success = true;
        $messEnableForgotPassword = isset($conf->aConfig["login_enableForgotPassword"]) && $conf->aConfig["login_enableForgotPassword"] == "1" ? G::LoadTranslation("ID_YES") : G::LoadTranslation("ID_NO");
        G::auditLog("UpdateLoginSettings", "DefaultLanguage-> " . $lang . " EnableForgotPassword-> " . $messEnableForgotPassword);
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:loginSettingsAjax.php

示例5: setLanguage

 /**
  * Set Language
  */
 public static function setLanguage()
 {
     $acceptLanguage = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : 'en';
     if (!defined('SYS_LANG')) {
         $Translations = new \Translation();
         $translationsTable = $Translations->getTranslationEnvironments();
         $inLang = false;
         foreach ($translationsTable as $locale) {
             if ($locale['LOCALE'] == $acceptLanguage) {
                 $inLang = true;
                 break;
             }
         }
         $lang = $inLang ? $acceptLanguage : 'en';
         define("SYS_LANG", $lang);
     }
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:20,代码来源:class.bootstrap.php

示例6: getConfiguration

    /**
     * Get configuration
     * @return mixed
     */
    public function getConfiguration()
    {
        $sysConf = \System::getSystemConfiguration( PATH_CONFIG . 'env.ini' );
        $offset = timezone_offset_get( new \DateTimeZone( $sysConf['time_zone'] ), new \DateTime() );
        $response['timeZone'] = sprintf( "GMT%s%02d:%02d", ( $offset >= 0 ) ? '+' : '-', abs( $offset / 3600 ), abs( ($offset % 3600) / 60 ) );
        $fields = \System::getSysInfo();
        $response['version'] = $fields['PM_VERSION'];

        $Translations = new \Translation;
        $translationsTable = $Translations->getTranslationEnvironments();
        $languagesList = array ();

        foreach ($translationsTable as $locale) {
            $LANG_ID = $locale['LOCALE'];
            if ($locale['COUNTRY'] != '.') {
                $LANG_NAME = $locale['LANGUAGE'] . ' (' . (ucwords( strtolower( $locale['COUNTRY'] ) )) . ')';
            } else {
                $LANG_NAME = $locale['LANGUAGE'];
            }
            $languages["L10n"] = $LANG_ID;
            $languages["label"] = $LANG_NAME;
            $languagesList[] = $languages;
        }
        $response['listLanguage'] = $languagesList;
        return $response;
    }
开发者ID:rrsc,项目名称:processmaker,代码行数:30,代码来源:Light.php

示例7: isoCountry

     die;
     if (isset($meta['LAN_ID']) && $meta['LAN_ID'] == $_POST['lang']) {
         echo 'The Setting was saved successfully!';
     } else {
         echo 'Some error occured while the setting was being save, try later please.';
     }
     break;
 case 'languagesList':
     require_once 'classes/model/Language.php';
     require_once 'classes/model/IsoCountry.php';
     require_once 'classes/model/Translation.php';
     G::loadClass('configuration');
     $isoCountry = new isoCountry();
     $translationRow = new Translation();
     $response = new stdClass();
     $translationsEnvList = $translationRow->getTranslationEnvironments();
     //print_r($translationsEnvList); die;
     $i = 0;
     foreach ($translationsEnvList as $locale => $translationRow) {
         $COUNTRY_ID = $translationRow['IC_UID'];
         if ($COUNTRY_ID != '') {
             $isoCountryRecord = $isoCountry->findById(strtoupper($COUNTRY_ID));
             $flag = strtolower($isoCountryRecord['IC_UID']);
             $countryName = $translationRow['HEADERS']['X-Poedit-Country'];
         } else {
             $flag = 'international';
             $countryName = G::LoadTranslation('ID_INTERNATIONAL');
         }
         G::LoadClass('configuration');
         $conf = new Configurations();
         $confCasesList = $conf->getConfiguration('casesList', 'todo');
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:language_Ajax.php

示例8: getConfiguration

 /**
  * Get configuration
  * @return mixed
  */
 public function getConfiguration()
 {
     $sysConf = \System::getSystemConfiguration('', '', SYS_SYS);
     $offset = timezone_offset_get(new \DateTimeZone($sysConf['time_zone']), new \DateTime());
     $response['timeZone'] = sprintf("GMT%s%02d:%02d", $offset >= 0 ? '+' : '-', abs($offset / 3600), abs($offset % 3600 / 60));
     $response['multiTimeZone'] = isset($sysConf['system_utc_time_zone']) && $sysConf['system_utc_time_zone'] ? true : false;
     $fields = \System::getSysInfo();
     $response['version'] = $fields['PM_VERSION'];
     $buildType = 'Community';
     /*----------------------------------********---------------------------------*/
     $response['buildType'] = $buildType;
     $conf = new \Configurations();
     $confEnvironment = $conf->getFormats();
     $response['environment'] = array();
     if (is_array($confEnvironment)) {
         $response['environment']['format'] = isset($confEnvironment['format']) ? $confEnvironment['format'] : '';
         $response['environment']['dateFormat'] = isset($confEnvironment['dateFormat']) ? $confEnvironment['dateFormat'] : '';
         $response['environment']['casesListDateFormat'] = isset($confEnvironment['casesListDateFormat']) ? $confEnvironment['casesListDateFormat'] : '';
     }
     $Translations = new \Translation();
     $translationsTable = $Translations->getTranslationEnvironments();
     $languagesList = array();
     foreach ($translationsTable as $locale) {
         $LANG_ID = $locale['LOCALE'];
         if ($locale['COUNTRY'] != '.') {
             $LANG_NAME = $locale['LANGUAGE'] . ' (' . ucwords(strtolower($locale['COUNTRY'])) . ')';
         } else {
             $LANG_NAME = $locale['LANGUAGE'];
         }
         $languages["L10n"] = $LANG_ID;
         $languages["label"] = $LANG_NAME;
         $languagesList[] = $languages;
     }
     $response['listLanguage'] = $languagesList;
     return $response;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:40,代码来源:Light.php


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