Ejemplo n.º 1
0
 /**
  * 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();
     }
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 4
0
    // 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();
    }
}
Ejemplo n.º 5
0
    /////////////////////////////
    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();
    }
}