contenido\includes\functions.i18n.php
Description: Contenido i18n Functions
Requirements:
- Author
- Timo A. Hummel
- Con_php_req
- 5.0
- Copyright
- four for business AG
- License
- http://www.contenido.org/license/LIZENZ.txt
- Link
- http://www.4fb.de
- Link
- http://www.contenido.org
- Package
- Contenido Backend includes
- Since
- file available since contenido release <= 4.6 {@internal created 2003-07-03 modified 2008-06-26, Frederic Schneider, add security fix modified 2012-01-17, Mischa Holz, removed hessisch $Id: functions.i18n.php 1780 2012-01-17 11:08:24Z mischa.holz $: }}
- Version
- 1.2.8
Functions

i18n( $string, $domain = "contenido") : string
i18n($string)
gettext wrapper (for future extensions). Usage: i18n("Your text which has to be translated");
Name | Type | Description |
---|---|---|
$string | string The string to translate | |
$domain | string The domain to look up |
Type | Description |
---|---|
string | Returns the translation |

i18nEmulateGettext( $string, $domain = "contenido") : string
i18nEmulateGettext()
Emulates GNU gettext
Name | Type | Description |
---|---|---|
$string | string The string to translate | |
$domain | string The domain to look up |
Type | Description |
---|---|
string | Returns the translation |

i18nGetAvailableLanguages() : array
i18nGetAvailableLanguages()
Returns the available_languages array to prevent globals.
Type | Description |
---|---|
array | All available languages |

i18nInit( $localePath, $langCode) : string
i18nInit()
Initializes the i18n stuff.
Name | Type | Description |
---|---|---|
$localePath | string Path to the locales | |
$langCode | string Language code to set |
Type | Description |
---|---|
string | Returns the translation |

i18nMatchBrowserAccept( $accept) : string
i18nMatchBrowserAccept($accept)
Tries to match the language given by $accept to one of the languages in the system.
Name | Type | Description |
---|---|---|
$accept |
Type | Description |
---|---|
string | The locale key for the given accept string |

i18nRegisterDomain( $domain, $localePath) : string
i18nRegisterDomain()
Registers a new i18n domain.
Name | Type | Description |
---|---|---|
$domain | string Domain to bind to | |
$localePath | string Path to the locales |
Type | Description |
---|---|
string | Returns the translation |

i18nStripAcceptLanguages( $accept) : array
i18nStripAcceptLanguages($accept)
Strips all unnecessary information from the $accept string. Example: de,nl;q=0.7,en-us;q=0.3 would become an array with de,nl,en-us
Name | Type | Description |
---|---|---|
$accept |
Type | Description |
---|---|
array | Array with the short form of the accept languages |