Comments: on this page. Click to read or post your own.
Base-class for storage and retrieval of translated entities.
Most common use is translation of the CMS-interface through the _t()-method (in controller/model) and the <% _t() %> template variable.
File-based i18n-translations always have a "locale" (e.g. 'en_US'). Common language names (e.g. 'en') are mainly used in {Translatable} for database-entities.
Features a "textcollector-mode" that parses all files with a certain extension (currently *.php and *.ss) for new translatable strings. Textcollector will write updated string-tables to their respective folders inside the module, and automatically namespace entities to the classes/templates they are found in (e.g. $lang['en_US']['AssetAdmin']['UPLOADFILES']).
Caution: Does not apply any character-set conversion, it is assumed that all content is stored and represented in UTF-8 (Unicode). Please make sure your files are created with the correct character-set, and your HTML-templates render UTF-8.
Caution: The language file has to be stored in the same module path as the "filename namespaces" on the entities. So an entity stored in $lang['en_US']['AssetAdmin']['DETAILSTAB'] has to in the language file cms/lang/en_US.php, as the referenced file (AssetAdmin.php) is stored in the "cms" module.
Please see the {Translatable} DataObjectDecorator for managing translations of database-content.
Located in /sapphire/core/i18n.php (line 33)
Object | --i18n
An exhaustive list of possible locales (code => language and country)
A list of commonly used languages, in the form
langcode => array( EnglishName, NativeName)
This static variable is used to store the current defined locale.
This is the locale in which generated language files are (we assume US English)
Inherited from Object
Object::$builtInMethods
Object::$class
Object::$classConstructed
Object::$extensions
Object::$extension_instances
Object::$extraMethods
Object::$extraStatics
Object::$statics
Object::$static_cached
Get default language (proxy for Translatable::default_lang())
Disable the multilingual content feature (proxy for Translatable::disable())
Enables the multilingual content feature (proxy for Translatable::enable())
Get a list of commonly used languages
Get a list of languages with at least one element translated in (including the default language)
Searches the root-directory for module-directories (identified by having a _config.php on their first directory-level).
Returns all found locales.
Get a code from an English language name
Get a name from a language code
Get the current locale
Get a list of locales (code => language and country)
Get a name from a locale code (xx_YY)
Given a file name (a php class name, without the .php ext, or a template name, including the .ss extension) this helper function determines the module where this file is located
Get the current tinyMCE language
Searches the root-directory for module-directories (identified by having a _config.php on their first directory-level and a language-file with the default locale in the /lang-subdirectory).
Given a class name (a "locale namespace"), will search for its module and, if available, will load the resources for the currently defined locale.
If not available, the original English resource will be loaded instead (to avoid blanks)
Includes all available language files for a certain defined locale
Include a locale file determined by module name and locale
Set default language (proxy for Translatable::set_default_lang())
Set the current locale See http://unicode.org/cldr/data/diff/supplemental/languages_and_territories.html for a list of possible locales
This is the main translator function. Returns the string defined by $class and $entity according to the currently set locale.
This method will delete every SiteTree instance in the given language
Inherited From Object
Object::__construct()
Object::addMethodsFrom()
Object::addStaticVars()
Object::addWrapperMethod()
Object::add_extension()
Object::allMethodNames()
Object::buildMethodList()
Object::cacheToFile()
Object::cacheToFileWithArgs()
Object::create()
Object::createMethod()
Object::defineMethods()
Object::exists()
Object::extend()
Object::extInstance()
Object::getCustomClass()
Object::hasExtension()
Object::hasMethod()
Object::invokeWithExtensions()
Object::is_a()
Object::loadCache()
Object::parentClass()
Object::sanitiseCachename()
Object::saveCache()
Object::set_stat()
Object::set_uninherited()
Object::stat()
Object::strong_create()
Object::uninherited()
Object::useCustomClass()
Object::__call()
Object::__toString()
Documentation generated on Sun, 19 Oct 2008 06:42:14 +1300 by phpDocumentor 1.3.2