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


PHP QApplication::CountryCode方法代码示例

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


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

示例1: InitializeI18n

 /**
  * Method will setup Internationalization.
  * NOTE: This method has been INTENTIONALLY left incomplete.
  * @return void
  */
 public static function InitializeI18n()
 {
     if (isset($_SESSION)) {
         if (array_key_exists('country_code', $_SESSION)) {
             QApplication::$CountryCode = $_SESSION['country_code'];
         }
         if (array_key_exists('language_code', $_SESSION)) {
             QApplication::$LanguageCode = $_SESSION['language_code'];
         }
     }
     /*
      * NOTE: This is where you would implement code to do Language Setting discovery, as well, for example:
      *   Checking against $_GET['language_code']
      *   checking against session (example provided below)
      *   Checking the URL
      *   etc.
      * Options to do this are left to the developer.
      */
     // Initialize I18n if QApplication::$LanguageCode is set
     if (QApplication::$LanguageCode) {
         QI18n::Initialize();
     } else {
         // QApplication::$CountryCode = 'us';
         // QApplication::$LanguageCode = 'en';
         // QI18n::Initialize();
     }
 }
开发者ID:jdellinger,项目名称:tracmor,代码行数:32,代码来源:QApplication.class.php

示例2: setCustomTranslatorClass

 private function setCustomTranslatorClass()
 {
     require_once __DOCROOT__ . __EXAMPLES__ . '/communication/sample_translator.class.php';
     // let's change translation class
     QI18n::$DefaultTranslationClass = 'QSampleTranslation';
     // Set default language to French
     QApplication::$LanguageCode = 'fr';
     QApplication::$CountryCode = null;
     QI18n::Initialize();
 }
开发者ID:tomVertuoz,项目名称:framework,代码行数:10,代码来源:QI18nTests.php

示例3: Form_Create

 protected function Form_Create()
 {
     // let's change translation class
     require_once 'sample_translator.class.php';
     QI18n::$DefaultTranslationClass = 'QSampleTranslation';
     // Set default language to French
     QApplication::$LanguageCode = 'fr';
     QApplication::$CountryCode = null;
     QI18n::Initialize();
 }
开发者ID:tomVertuoz,项目名称:framework,代码行数:10,代码来源:advanced_intl.php

示例4:

    // Start Session Handler (if required)
    /////////////////////////////
    //session_set_cookie_params(2);
    session_start();
    //////////////////////////////////////////////
    // Setup Internationalization and Localization (if applicable)
    // Note, this is where you would implement code to do Language Setting discovery, as well, for example:
    // * Checking against $_GET['language_code']
    // * checking against session (example provided below)
    // * Checking the URL
    // * etc.
    // TODO: options to do this are left to the developer
    //////////////////////////////////////////////
    if (isset($_SESSION)) {
        if (array_key_exists('country_code', $_SESSION)) {
            QApplication::$CountryCode = $_SESSION['country_code'];
        }
        if (array_key_exists('language_code', $_SESSION)) {
            QApplication::$LanguageCode = $_SESSION['language_code'];
        }
    }
    QApplication::$LanguageCode = 'zh_cn';
    // Initialize I18n if QApplication::$LanguageCode is set
    if (QApplication::$LanguageCode) {
        QI18n::Initialize();
    } else {
        // QApplication::$CountryCode = 'us';
        // QApplication::$LanguageCode = 'en';
        // QI18n::Initialize();
    }
}
开发者ID:heshuai64,项目名称:einv2,代码行数:31,代码来源:prepend.inc.php

示例5:

    /////////////////////////////
    if (strstr($_SERVER['SCRIPT_NAME'], 'codegen.php') === false) {
        /////////////////////////////
        // Start Session Handler (if required)
        /////////////////////////////
        require_once 'Zend/Session.php';
        Zend_Session::setOptions(array('cookie_lifetime' => 31 * 24 * 3600, 'gc_maxlifetime' => 31 * 24 * 3600));
        require_once 'Zend/Session/Namespace.php';
        $objSession = new Zend_Session_Namespace('SubmitWord');
        QApplication::$User = $objSession->User;
    }
    //////////////////////////////////////////////
    // Setup Internationalization and Localization (if applicable)
    // Note, this is where you would implement code to do Language Setting discovery, as well, for example:
    // * Checking against $_GET['language_code']
    // * checking against session (example provided below)
    // * Checking the URL
    // * etc.
    // TODO: options to do this are left to the developer
    //////////////////////////////////////////////
    QApplication::$CountryCode = 'ro';
    QApplication::$LanguageCode = 'ro';
    // Initialize I18n if QApplication::$LanguageCode is set
    if (QApplication::$LanguageCode) {
        QI18n::Initialize();
    } else {
        // QApplication::$CountryCode = 'us';
        // QApplication::$LanguageCode = 'en';
        // QI18n::Initialize();
    }
}
开发者ID:Jobava,项目名称:diacritice-meta-repo,代码行数:31,代码来源:prepend.inc.php


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