Class Localization

Description

Localization class

This class will set up PHP environment to mach locale settings (using setlocale() function) and import apropriate set of words from language folder. Properties of this class are used by some other system classes for outputing data in correct format (for instance DateTimeValueLib).

  • version: 1.0

Located in /environment/classes/localization/Localization.class.php (line 14)


	
			
Method Summary
static Localization instance (string $locale)
Localization __construct (string $language_dir_path, string $local)
string formatDate (DateTimeValue $date, [float $timezone = 0])
string formatDateTime (DateTimeValue $date, [float $timezone = 0])
string formatDescriptiveDate (DateTimeValue $date, [float $timezone = 0])
string formatTime (DateTimeValue $date, [float $timezone = 0])
string getDateFormat (null 0)
string getDateTimeFormat (null 0)
string getLanguageDirPath (null 0)
string getLocale (null 0)
string getTimeFormat (null 0)
string lang (string $name, [mixed $default = null])
Container langs (void 0)
null loadSettings (string $locale,  $languages_dir, string $language_dir)
null setDateFormat (string $value)
null setDateTimeFormat (string $value)
null setLanguageDirPath (string $value)
boolean setLocale (string $value)
null setTimeFormat (string $value)
Methods
static method instance (line 366)

Return localization instance

  • access: public
static Localization instance (string $locale)
  • string $locale: Localization code
Constructor __construct (line 83)

Construct the Localization

  • access: public
Localization __construct (string $language_dir_path, string $local)
  • string $language_dir_path: Path to the language dir
  • string $local
formatDate (line 177)

Return formated date

  • access: public
string formatDate (DateTimeValue $date, [float $timezone = 0])
formatDateTime (line 203)

Return formated datetime

  • access: public
string formatDateTime (DateTimeValue $date, [float $timezone = 0])
formatDescriptiveDate (line 191)

* Descriptive date format is string used in date() function that will autput date in such a way that it tells as much as it can: with day it is and when it is.

This one is used for such things as milestones and tasks where you need to see as much info about due date as you can from a simple, short string

string formatDescriptiveDate (DateTimeValue $date, [float $timezone = 0])
formatTime (line 215)

Return fromated time

  • access: public
string formatTime (DateTimeValue $date, [float $timezone = 0])
getDateFormat (line 274)

Get date format

  • access: public
string getDateFormat (null 0)
  • null 0
getDateTimeFormat (line 252)

Get datetime format

  • access: public
string getDateTimeFormat (null 0)
  • null 0
getLanguageDirPath (line 230)

Get language_dir_path

  • access: public
string getLanguageDirPath (null 0)
  • null 0
getLocale (line 318)

Get locale

  • access: public
string getLocale (null 0)
  • null 0
getTimeFormat (line 296)

Get time format

  • access: public
string getTimeFormat (null 0)
  • null 0
lang (line 94)

Return lang by name

string lang (string $name, [mixed $default = null])
  • string $name
  • mixed $default: Default value that will be returned if lang is not found
langs (line 355)

Interface to langs container

  • access: public
Container langs (void 0)
  • void 0
loadSettings (line 111)

Load language settings

  • throws: DirDnxError If language dir does not exists
  • throws: FileDnxError If language settings file for this local settings does not exists in lanuage dir
  • access: public
null loadSettings (string $locale,  $languages_dir, string $language_dir)
  • string $locale: Locale code
  • string $language_dir: Path to directory where we have all languages defined
  • $languages_dir
setDateFormat (line 285)

Set date format value

  • access: public
null setDateFormat (string $value)
  • string $value
setDateTimeFormat (line 263)

Set datetime foramt value

  • access: public
null setDateTimeFormat (string $value)
  • string $value
setLanguageDirPath (line 241)

Set language_dir_path value

  • access: public
null setLanguageDirPath (string $value)
  • string $value
setLocale (line 329)

Set locale value

  • access: public
boolean setLocale (string $value)
  • string $value
setTimeFormat (line 307)

Set time format value

  • access: public
null setTimeFormat (string $value)
  • string $value

Documentation generated on Wed, 23 Jan 2008 01:58:49 +0000 by phpDocumentor 1.4.0