Class Core_I18n
Package: HostCMS\Core
Copyright:
© 2005-2021 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru
Author:
Hostmake LLC
Version:
6.x
Located at core/i18n.php
Methods summary
public
Core_I18n
|
#
setLng( string $lng )
Set target language
Parameters
Returns
|
public
|
|
protected
|
|
public static
object
|
#
instance( )
Register an existing instance as a singleton.
Register an existing instance as a singleton.
Returns
object
|
public
Core_I18n
|
#
expandLng( string $className, array $value, mixed $lng = NULL )
Expand LNG
Parameters
- $className
- class name
- $value
- $lng
- language
Returns
|
public
Core_I18n
|
#
loadLng( mixed $lng, string $className )
Load LNG into cache
Parameters
- $lng
- language
- $className
- class name
Returns
|
public
boolean
|
#
check( string $key, mixed $lng = NULL )
Check if text for key exists
Check if text for key exists
Parameters
- $key
- module name dot key name, e.g. 'Constant.menu'
- $lng
- language, default NULL
Returns
boolean
|
public
string
|
#
get( string $key, mixed $lng = NULL, mixed $count = NULL )
Get text for key
$value = Core_I18n::instance()->get('Constant.menu');
$value = Core_I18n::instance()->get('Constant.menu', 'en');
Be careful when using short alias, function Core::_() has different parameters.
$value = Core::_('Constant.menu');
Parameters
- $key
- module name dot key name, e.g. 'Constant.menu'
- $lng
- language, default NULL
- $count
- default NULL
Returns
string
|
public
array
|
#
getLngFile( string $className, string $lng )
Include lng file
Parameters
- $className
- class name
- $lng
- language name
Returns
array
|
Properties summary
protected
string
|
$_lng
|
|
protected
string
|
$_defaultLng
|
|
protected static
mixed
|
$_instance
|
|
protected
array
|
$_cache
|
|