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

Class: I18Nv2

Source Location: /I18Nv2-0.7.1/I18Nv2.php

Class Overview


I18Nv2 - Internationalization v2


Author(s):

Version:

  • $Revision: 1.16 $

Methods


Inherited Variables

Inherited Methods


Class Details

[line 38]
I18Nv2 - Internationalization v2
  • Author: Michael Wallner <mike@php.net>
  • Version: $Revision: 1.16 $
  • Access: public


[ Top ]


Method Detail

autoConv   [line 219]

mixed autoConv( [string $ocs = 'UTF-8'], [string $ics = 'ISO-8859-1'])

Automatically transform output between character sets

This method utilizes ob_iconv_handler(), so you should call it at the beginning of your script (prior to output)

  1.    <?php
  2.    require_once('I18Nv2.php');
  3.    I18Nv2::autoConv('iso-8859-1''utf-8');
  4.    print('...')// some utf-8 stuff gets converted to iso-8859-1
  5.    // ...
  6.    ?>

  • Return: Returns &true; on success or <classname>PEAR_Error</classname> on failure.
  • Access: public

Parameters:

string   $ocs   —  desired output character set
string   $ics   —  current intput character set

[ Top ]

countryOf   [line 319]

string countryOf( string $locale)

Get country code of locale
  • Access: public

Parameters:

string   $locale   — 

[ Top ]

createLocale   [line 176]

object I18Nv2_Locale &createLocale( [string $locale = null])

Create a Locale object
  • Access: public

Parameters:

string   $locale   — 

[ Top ]

createNegotiator   [line 191]

object I18Nv2_Negotiator &createNegotiator( [string $defLang = 'en'], [string $defCharset = 'iso-8859-1'])

Create a Negotiator object
  • Access: public

Parameters:

string   $defLang   —  default language
string   $defCharset   —  default character set

[ Top ]

getInfo   [line 162]

mixed getInfo( [string $part = null])

Get several locale specific information

Parameters:

string   $part   — 

[ Top ]

getStaticProperty   [line 332]

mixed &getStaticProperty( string $property)

Get access to static property
  • Return: Returns a reference to a static property
  • Access: public

Parameters:

string   $property   —  the static property

[ Top ]

l2l   [line 278]

string l2l( string $localeOrLanguage)

Locale to language or language to locale
  • Access: public

Parameters:

string   $localeOrLanguage   — 

[ Top ]

langs2locales   [line 265]

array langs2locales( array $languages)

Traverse languages to locales

Returns en_US, de_DE from en-US and de-DE

  • Access: public

Parameters:

array   $languages   — 

[ Top ]

languageOf   [line 306]

string languageOf( $locale)

Get language code of locale
  • Access: public

Parameters:

   $locale   — 

[ Top ]

lastLocale   [line 140]

string lastLocale( [int $prior = 0], [bool $full = false])

Get current/prior Locale

This only works, if I18Nv2::setLocale() has already been called

  • Return: last locale
  • Access: public

Parameters:

int   $prior   —  if 0, the current otherwise n prior current
bool   $full   —  wheter to return the array with locale, language and actually used system locale

[ Top ]

locales2langs   [line 250]

array locales2langs( array $locales)

Traverse locales to languages

Returns en-US, de-DE from en_US and de_DE

  • Access: public

Parameters:

array   $locales   — 

[ Top ]

setLocale   [line 54]

mixed setLocale( [string $locale = null], [int $cat = LC_ALL])

Set Locale

Example:

  1.  I18Nv2::setLocale('en_GB');

  • Return: &type.string; used locale or false on failure
  • Access: public

Parameters:

string   $locale   —  a valid locale like en_US or de_DE
int   $cat   —  the locale category - usually LC_ALL

[ Top ]

splitLocale   [line 293]

array splitLocale( string $locale)

Split locale code

Splits locale codes into its language and country part

  • Access: public

Parameters:

string   $locale   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:54:50 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.