Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SIWECOS
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cI18n

Functions

  • i18n
  • i18nEmulateGettext
  • i18nGetAvailableLanguages
  • i18nInit
  • i18nMatchBrowserAccept
  • i18nRegisterDomain
  • i18nStripAcceptLanguages
  • mi18n
  • trans
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cI18n

Internationalization (i18n) class.

Package: Core\I18N
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Murat Purc <murat@purc.de>
Located at classes/class.i18n.php
Methods summary
public static
# init( string $localePath, string $langCode, string $domain = 'contenido' )

Initializes the i18n.

Initializes the i18n.

Parameters

$localePath
string
$localePath Path to the locales
$langCode
string
$langCode Language code to set
$domain
string
$domain [optional] Language domain
public static string
# __( string $string, string $domain = 'contenido' )

Returns translation of a specific text, wrapper for translate().

Returns translation of a specific text, wrapper for translate().

Parameters

$string
string
$string The string to translate
$domain
string
$domain [optional] The domain to look up

Returns

string
Returns the translation

Throws

cException
public static string
# translate( string $string, string $domain = 'contenido' )

Returns translation of a specific text

Returns translation of a specific text

Parameters

$string
string
$string The string to translate
$domain
string
$domain [optional] The domain to look up

Returns

string
Returns the translation

Throws

cException
if this is the backend mode and the $belang is not set
public static string|false
# getLanguage( )

Returns the current language (if already defined)

Returns the current language (if already defined)

Returns

string|false
public static array
# getDomains( )

Returns list of registered domains

Returns list of registered domains

Returns

array
public static array
# getFiles( )

Returns list of cached tranlation files

Returns list of cached tranlation files

Returns

array
public static array
# getCache( )

Returns list of cached tranlations

Returns list of cached tranlations

Returns

array
public static
# reset( )

Resets cached translation data (language, domains, files, and cache)

Resets cached translation data (language, domains, files, and cache)

public static string
# emulateGettext( string $string, string $domain = 'contenido' )

Emulates GNU gettext

Emulates GNU gettext

Parameters

$string
string
$string The string to translate
$domain
string
$domain [optional] The domain to look up

Returns

string
Returns the translation

Throws

cInvalidArgumentException
public static
# registerDomain( string $domain, string $localePath )

Registers a new i18n domain.

Registers a new i18n domain.

Parameters

$domain
string
$domain Domain to bind to
$localePath
string
$localePath Path to the locales
protected static string
# _loadTranslationFile( string $translationFile )

Loads gettext translation and file does some operations like stripping comments on the content.

Loads gettext translation and file does some operations like stripping comments on the content.

Parameters

$translationFile
string
$translationFile

Returns

string
The preparend translation file content

Throws

cInvalidArgumentException
Properties summary
protected static array $_i18nData array( 'language' => NULL, 'domains' => array(), 'files' => array(), 'cache' => array() )
#

i18n related assoziative data cache.

i18n related assoziative data cache.

CMS CONTENIDO 4.10.1 API documentation generated by ApiGen 2.8.0