Client
[ class tree: Client ] [ index: Client ] [ all elements ]

Class: I18n

Source Location: /client/Internationalization.php

Class Overview


Translator selection


Variables

Methods



Class Details

[line 30]
Translator selection

The translator is selected using client.ini's I18nClass.




[ Top ]


Class Variables

$i18n =

[line 36]

Translator



Tags:

access:  private
static:  

Type:   I18nInterface


[ Top ]

$langList =

[line 42]

Order and restrict lang list



Tags:

access:  private
static:  

Type:   string


[ Top ]



Class Methods


method bindtextdomain [line 196]

string bindtextdomain( string $domain, string $path)

Calls translator's bindtextdomain



Tags:

return:  full path
access:  private
static:  


Parameters:

string   $domain   domain
string   $path   path to tranlsations

[ Top ]

method getLocales [line 84]

array getLocales( )

Returns available locales

Looks for two-characters directories in locale directory.




Tags:

return:  array of locales (two-characters strings)
access:  public
static:  


[ Top ]

method gt [line 214]

string gt( string $text)

Calls translator's gettext



Tags:

return:  tranlated text
access:  public
static:  


Parameters:

string   $text   text to translate

[ Top ]

method guessI18nClass [line 48]

I18nInterface guessI18nClass( )

Guess the I18nInterface class to use



Tags:

return:  The i18n interface to use.
access:  private
static:  


[ Top ]

method init [line 62]

void init( ClientConfig $config, ClientProjectHandler $project)

Initializes locales

Default language is set in configuration file (parameter defaultLang).




Tags:

access:  public
static:  


Parameters:

ClientConfig   $config  
ClientProjectHandler   $project  

[ Top ]

method localesSort [line 243]

array localesSort( array $locales)

Sort locales array accordingly to reference array



Tags:

return:  sorted locales language
access:  private
static:  


Parameters:

array   $locales   list of locales language

[ Top ]

method ngt [line 229]

string ngt( string $text, string $plural, int $count)

Calls translator's ngettext



Tags:

return:  translated text
access:  public
static:  


Parameters:

string   $text   text to translate
string   $plural   text to translate (plural)
int   $count   count

[ Top ]

method setLocale [line 121]

void setLocale( string $defaultLang)

Sets the locale depending on URL, browser or config

Looks for language in:

  • $_SERVER['LANG']
  • Cookie
  • $_SERVER['HTTP_ACCEPT_LANGUAGE']
If no language is found, default language is set.




Tags:

access:  public
static:  


Parameters:

string   $defaultLang   default language

[ Top ]

method textdomain [line 205]

string textdomain( string $domain)

Calls translator's textdomain



Tags:

return:  domain
access:  private
static:  


Parameters:

string   $domain   domain

[ Top ]


Documentation generated on Fri, 21 Sep 2007 13:30:49 +0200 by phpDocumentor 1.3.0RC3