Thule - 0.9.6
  • Welcome
  • Introduction
  • - MVC(Model-View-Controller)
    - Architecture of Framework
    - Flow Chart of Application
    - Services In One Server
    - Developing Guide
    - Features
  • Installation
  • Getting Started
  • - Direct Access HTTP
    - Router Access HTTP
    - Router Direct Access HTTP
    - Reserved Function
    - Convention
    - Bootstrap
    - Pack Javascript , CSS
  • Basic Modules
  • - Model
    - View
    - Controller
  • Libraries
  • - Router
    - Config
    - Response
    - Request
    - Database
    - Query
    - Cache
    - Debug
    - Log
    - Unit Test
    - Registry
    - Profile
  • Helper
  • - Auth
    - Calendar
    - Date
    - Error page
    - Email
    - Form
    - GeoIP
    - Google
    - Html Element
    - Html
    - Http
    - I18n
    - Image
    - Json
    - Jquery
    - Login
    - Layout
    - Locale
    - PHP to Javascript
    - Paging
    - Payflow
    - Soap
    - Text
    - Table
    - Uri
    - Upload
    - Validation
  • Plugins
  • - Smarty Template Engine
  • History
  • Home >I18n

    This helper for mulit-language support, you can make the multi-language site very easily with this helper

    How to configure for helper.

    you need to configure in the gate.php when you want to change the default path of i18n

    define('I18N_PATH',ROOT_DIR.'/text'); // i18n directory

    How to set the language

    Set the langugae code for i18n in dev_config.php file.

    $config['language']='en';

    Sometimes you need to change the language code for support of mulit-language on your site.

    $FE->I18n->setLang("language-code");

    How to make the file for multi-language.

    default directory is /text and you can put the file to the directory.File name will be language-code.

    For example /text/en , /text/fr , /text/de, /text/kr , /text/jp,,,

    the format is below.

    { // start the file
      "Hello" : "Hi", // "text will be translated : translated text "
      "How are you ?" : "How r u ?",
      "Nice" : "Good",
      "Text $a" : "Good $a"
    } // end the file

    How to use in frontend

    $Frontend->I18n->t("Hello");

    Sometime you need to put the variable to the i18n such as "Hello user-name" .

    { // start the file
      "Hello $user" : "Hi $user"
    } // end the file

    How to pass the variable to the i18n

    Below is for example to explain how to pass the variable

    $Frontend->I18n->t("Text \$a",array("a"=>1));