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

Class: I18N_Negotiator

Source Location: /I18N-1.0.0/Negotiator.php

Class Overview


//instantiate Locale_Negotiator $negotiator = & new I18N_Negotiator();


Methods


Inherited Variables

Inherited Methods


Class Details

[line 44]
//instantiate Locale_Negotiator $negotiator = & new I18N_Negotiator();

//define which language[s] your site supports :: optional $supportLangs = array('fr','jp');

//find first matched language $lang = $negotiator->getLanguageMatch($supportedLangs);

//define which countries your site supports :: optional $supportCountries = array('gb','us');

//find first matched Country $countryCode = $negotiator->getCountryMatch($lang,$supportCountries);

echo 'Language Code: '.$lang.' Language Name: '.$negotiator->getLanguageName($lang).' Country Code: '.$countryCode.' Country Name: '.$negotiator->getCountryName($countryCode);



[ Top ]


Method Detail

I18N_Negotiator (Constructor)   [line 84]

I18N_Negotiator I18N_Negotiator( [: $defaultLanguage = "en"], [: $defaultCharset = "ISO-8859-1"], [: $defaultCountry = ""])

Find language code, country code, charset code, and dialect or variant of Locale setting in user's browser from $HTTP_ACCEPT_LANGUAGE, $LANGUAGE_ACCEPT_CHARSET

Parameters:

:   $defaultLanguage   —  string Default Language
:   $defaultCharset   —  string Default Charset
:   $defaultCountry   —  string Default Country

[ Top ]

getCharsetMatch   [line 204]

void getCharsetMatch( [: $chasets = ''])

Find Charset match

Parameters:

:   $chasets   —  array

[ Top ]

getCountryMatch   [line 168]

void getCountryMatch( [: $lang = ''], [: $countries = ''])

Find Country Match

Parameters:

:   $lang   —  string
:   $countries   —  array

[ Top ]

getCountryName   [line 263]

void getCountryName( : $code)

Find Country name for country code passed

Parameters:

:   $code   —  string country code

[ Top ]

getLanguageMatch   [line 221]

void getLanguageMatch( [: $langs = ''])

Find Language match

Parameters:

:   $langs   —  array

[ Top ]

getLanguageName   [line 277]

void getLanguageName( : $code)

Find Country name for country code passed

Parameters:

:   $code   —  string country code

[ Top ]

getVariantInfo   [line 188]

void getVariantInfo( : $lang)

Return variant info for passed parameter.

Parameters:

:   $lang   —  string

[ Top ]


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