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

$domain =

[line 48]

Domain



Tags:

access:  private
static:  

Type:   string


[ Top ]

$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 203]

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 bind_textdomain_codeset [line 222]

string bind_textdomain_codeset( string $codeset)

Calls translator's bind_textdomain_codeset



Tags:

return:  codeset
access:  public
static:  


Parameters:

string   $codeset   codeset

[ Top ]

method getLocales [line 91]

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 231]

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 54]

I18nInterface guessI18nClass( )

Guess the I18nInterface class to use



Tags:

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


[ Top ]

method init [line 68]

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 260]

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 246]

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 128]

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 212]

string textdomain( string $domain)

Calls translator's textdomain



Tags:

return:  domain
access:  private
static:  


Parameters:

string   $domain   domain

[ Top ]


Documentation generated on Mon, 09 Sep 2013 13:30:57 +0200 by phpDocumentor 1.3.0RC3