# CMS Internationalisation * TOC

Overview

The Seagull CMS generates a range of content that can be displayed in any language of your choice. The content be either * text content of a pre-defined type * navigation items * category items

Controlling the display language

  • The lang URL param is used to set the content language for site users
  • The cLang param is used by admins to control language of content being edited, eg you can edit articles or navigation in Spanish while still maintaining the Seagull interface in English.

If module/action params are already present in your url, you can invoke a target language with a URL like

http://example.com/cms/contentview/lang/zh-TW/

If you want to specify the language when no URL params exist do it as follows

http://example.com?lang=zh-TW

SGL_Translation3

The SGL_Translation3 library is responsible for * initializing the framework language by detecting the admins preferences, browser lang accept string, country code of the current domain, etc * initializing the content language * storing the content dictionaries - a dictionary is a collection of language key/value pairs, examples of dictionaries are navigation, categories, the default module, etc.

Example Usage

//  sets default language for framework, checks for lang param used to set user lang
$trans = SGL_Translation3::singleton('array');
try {
    $trans->loadDefaultDictionaries();
} catch (Exception $e) {
    SGL::raiseError($e->getMessage(), SGL_ERROR_NOFILE);
}