I18n Class Reference

Inheritance diagram for I18n:

Object List of all members.

Public Member Functions

 __bindTextDomain ($domain)
 __destruct ()
 __loadMo ($file, $domain)
 __loadPo ($file, $domain)
 __pluralGuess ($header, $n)
getInstance ()
 translate ($singular, $plural=null, $domain=null, $category=6, $count=null)

Public Attributes

 $__cache = false
 $__categories
 $__domains = array()
 $__lang = null
 $__noLocale = false
 $category = 'LC_MESSAGES'
 $domain = null
 $l10n = null

Detailed Description

Definition at line 39 of file i18n.php.


Constructor & Destructor Documentation

I18n::__destruct (  ) 

Object destructor

Write cache file if changes have been made to the $__map or $__paths private

Definition at line 445 of file i18n.php.

References Cache::write().


Member Function Documentation

I18n::__bindTextDomain ( domain  ) 

Binds the given domain to a file in the specified directory.

Parameters:
string $domain Domain to bind
Returns:
string Domain binded private

Definition at line 252 of file i18n.php.

References $domain, __loadMo(), __loadPo(), Configure::listObjects(), Set::pushDiff(), Configure::read(), and underscore().

I18n::__loadMo ( file,
domain 
)

Loads the binary .mo file for translation and sets the values for this translation in the var I18n::__domains

Parameters:
resource $file Binary .mo file to load
string $domain Domain where to load file in private

Definition at line 337 of file i18n.php.

References $domain.

Referenced by __bindTextDomain().

I18n::__loadPo ( file,
domain 
)

Loads the text .po file for translation and sets the values for this translation in the var I18n::__domains

Parameters:
resource $file Text .po file to load
string $domain Domain to load file in
Returns:
array Binded domain elements private

Definition at line 377 of file i18n.php.

References $domain.

Referenced by __bindTextDomain().

I18n::__pluralGuess ( header,
n 
)

Attempts to find the plural form of a string.

Parameters:
string $header Type
integrer $n Number
Returns:
integer plural match private

Definition at line 204 of file i18n.php.

& I18n::getInstance (  ) 

Return a static instance of the I18n class

Returns:
object I18n public

Definition at line 106 of file i18n.php.

Referenced by TranslateBehavior::_getLocale(), and translate().

I18n::translate ( singular,
plural = null,
domain = null,
category = 6,
count = null 
)

Used by the translation functions in basics.php Can also be used like I18n::translate(); but only if the App::import('I18n'); has been used to load the class.

Parameters:
string $singular String to translate
string $plural Plural string (if any)
string $domain Domain
string $category Category
integer $count Count
Returns:
string translated strings. public

Definition at line 126 of file i18n.php.

References $category, $domain, getInstance(), Cache::read(), and Configure::read().

Referenced by __(), __c(), __d(), __dc(), __dcn(), __dn(), and __n().


Member Data Documentation

I18n::$__cache = false

Definition at line 89 of file i18n.php.

I18n::$__categories

Initial value:

 array(
         'LC_ALL', 'LC_COLLATE', 'LC_CTYPE', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME', 'LC_MESSAGES'
    )

Definition at line 97 of file i18n.php.

I18n::$__domains = array()

Definition at line 74 of file i18n.php.

I18n::$__lang = null

Definition at line 67 of file i18n.php.

I18n::$__noLocale = false

Definition at line 82 of file i18n.php.

I18n::$category = 'LC_MESSAGES'

Definition at line 60 of file i18n.php.

Referenced by translate().

I18n::$domain = null

Definition at line 53 of file i18n.php.

Referenced by __bindTextDomain(), __loadMo(), __loadPo(), and translate().

I18n::$l10n = null

Definition at line 46 of file i18n.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:56 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7