Class TGlobalization
TGlobalization contains settings for Culture, Charset and TranslationConfiguration.
TGlobalization can be subclassed to change how the Culture, Charset are determined. See TGlobalizationAutoDetect for example of setting the Culture based on browser settings.
- TComponent
-
TApplicationComponent
-
TModule implements IModule
-
TGlobalization
Direct known subclasses
TGlobalizationAutoDetectCopyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo<weizhuo[at]gmail[dot]com>
Version: $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
Since: 3.0
Located at I18N/TGlobalization.php
public
|
#
init( mixed $config )
Initialize the Culture and Charset for this application. You should override this method if you want a different way of setting the Culture and/or Charset for your application. If you override this method, call parent::init($xml) first. |
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
|
|
protected
|
#
setTranslationConfiguration(
Sets the translation configuration. Example configuration: $config['type'] = 'XLIFF'; //XLIFF, gettext, Database or MySQL (deprecated) $config['source'] = 'Path.to.directory'; // for types XLIFF and gettext $config['source'] = 'connectionId'; // for type Database $config['source'] = 'mysql://user:pw@host/db'; // for type MySQL (deprecated) $config['catalogue'] = 'messages'; //default catalog $config['autosave'] = 'true'; //save untranslated message $config['cache'] = 'true'; //cache translated message $config['marker'] = '@@'; // surround untranslated text with '@@' Throws exception is source is not found. |
public
string
|
|
public
|
|
public
array
|
#
getCultureVariants( string $culture = null )
Gets all the variants of a specific culture. If the parameter $culture is null, the current culture is used. |
public
array
|
#
getLocalizedResource( string $file, string $culture = null )
Returns a list of possible localized files. Example $files = $app->getLocalizedResource("path/to/Home.page","en_US"); will return array 0 => 'path/to/en_US/Home.page' 1 => 'path/to/en/Home.page' 2 => 'path/to/Home.en_US.page' 3 => 'path/to/Home.en.page' 4 => 'path/to/Home.page' Note that you still need to verify the existance of these files. |
getID(),
setID()
|
getApplication(),
getRequest(),
getResponse(),
getService(),
getSession(),
getUser(),
publishAsset(),
publishFilePath()
|
GLOBAL_RAISE_EVENT_LISTENER
|