Download the PHP package novembit/i18n without Composer
On this page you can find all versions of the php package novembit/i18n. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download novembit/i18n
More information about novembit/i18n
Files in novembit/i18n
Informations about the package i18n
NovemBit i18n - Internationalization framework library
Table of Contents
- Arrays
- arrayWalkWithRoute
- arrayMergeRecursiveDistinct
- DataMapper
- getDB
- DB
- __construct
- commonInit
- isCli
- getLogger
- setLogger
- getRuntimeDir
- setRuntimeDir
- setCachePool
- getCachePool
- defaultConfig
- getConnection
- setConnection
- DB
- __construct
- commonInit
- isCli
- getLogger
- setLogger
- getRuntimeDir
- setRuntimeDir
- setCachePool
- getCachePool
- defaultConfig
- getConnection
- getConnectionParams
- Dummy
- Exception
- Google
- mainInit
- HTML
- get
- saveTranslations
- getDB
- HTML
- defaultConfig
- getParserType
- setParserType
- buildToTranslateFields
- replaceTranslatedFields
- getHelperAttributes
- setHelperAttributes
- addBeforeParseCallback
- addAfterParseCallback
- getBeforeParseCallbacks
- getAfterParseCallbacks
- HTMLFragment
- defaultConfig
- getParserType
- setParserType
- buildToTranslateFields
- replaceTranslatedFields
- getHelperAttributes
- setHelperAttributes
- addBeforeParseCallback
- addAfterParseCallback
- getBeforeParseCallbacks
- getAfterParseCallbacks
- JSON
- get
- saveTranslations
- getDB
- LanguageException
- Method
- get
- saveTranslations
- getDB
- MethodException
- Module
- __construct
- commonLateInit
- mainInit
- isCli
- getLogger
- setLogger
- getRuntimeDir
- setRuntimeDir
- setCachePool
- getCachePool
- defaultConfig
- start
- instance
- RequestException
- Rest
- __construct
- isCli
- getLogger
- setLogger
- getRuntimeDir
- setRuntimeDir
- setCachePool
- getCachePool
- defaultConfig
- start
- actionTranslate
- actionIndex
- actionRestrict
- Rest
- getLanguagesConfig
- Strings
- getStringsDifference
- Text
- get
- saveTranslations
- getDB
- Translation
- getDB
- get
- saveTranslations
- TranslationException
- URL
- get
- saveTranslations
- getDB
- rules
- URL
- addQueryVars
- removeQueryVars
- buildUrl
- XML
- defaultConfig
- getParserType
- setParserType
- buildToTranslateFields
- replaceTranslatedFields
- getHelperAttributes
- setHelperAttributes
- addBeforeParseCallback
- addAfterParseCallback
- getBeforeParseCallbacks
- getAfterParseCallbacks
- XML
- get
- saveTranslations
- getDB
Arrays
- Full name: \NovemBit\i18n\system\helpers\Arrays
arrayWalkWithRoute
Recursive array walk with callback and route
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$arr |
array | Main array |
$callback |
callable | Callback function with 3 params (key/val/route) |
$route |
\NovemBit\i18n\system\helpers\Strings | Parent route |
$separator |
\NovemBit\i18n\system\helpers\Strings | Route separator |
arrayMergeRecursiveDistinct
array_merge_recursive does indeed merge arrays, but it converts values with duplicate keys to arrays rather than overwriting the value in the first array with the duplicate value in the second array, as array_merge does. I.e., with array_merge_recursive, this happens (documented behavior):
array_merge_recursive(array('key' => 'org value'), array('key' => 'new value')); => array('key' => array('org value', 'new value'));
array_merge_recursive_distinct does not change the datatypes of the values in the arrays. Matching keys' values in the second array overwrite those in the first array, as is the case with array_merge, i.e.:
array_merge_recursive_distinct(array('key' => 'org value'), array('key' => 'new value')); => array('key' => array('new value'));
Parameters are passed by reference, though only for performance reasons. They're not altered by this function.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array1 |
array | |
$array2 |
array |
DataMapper
ActiveRecord class. Child of Yii ActiveRecord library
- Full name: \NovemBit\i18n\models\DataMapper
See Also:
getDB
- This method is static.
DB
DB component
Its simple but provides very useful functionality Module class
- Full name: \NovemBit\i18n\system\component\DB
- Parent class: \NovemBit\i18n\system\Component
See Also:
__construct
Component constructor.
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
array | Configuration array |
$context |
null|\NovemBit\i18n\system\Component | Context (parent) Component |
commonInit
{@inheritdoc} Init method of component.
Setting default connection of DB
isCli
Check if script running on CLI
getLogger
setLogger
Parameters:
Parameter | Type | Description |
---|---|---|
$logger |
\Psr\Log\LoggerInterface |
getRuntimeDir
setRuntimeDir
Parameters:
Parameter | Type | Description |
---|---|---|
$runtime_dir |
string |
setCachePool
Parameters:
Parameter | Type | Description |
---|---|---|
$cache_pool |
\Psr\SimpleCache\CacheInterface |
getCachePool
defaultConfig
- This method is static.
getConnection
Get connection of DB
setConnection
Set connection of DB
Parameters:
Parameter | Type | Description |
---|---|---|
$_connection |
\yii\db\Connection | Yii2 db connection |
DB
DB component
Its simple but provides very useful functionality Module class
- Full name: \NovemBit\i18n\component\db\DB
- Parent class: \NovemBit\i18n\system\Component
See Also:
__construct
Component constructor.
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
array | Configuration array |
$context |
null|\NovemBit\i18n\system\Component | Context (parent) Component |
commonInit
{@inheritdoc} Init method of component.
Setting default connection of DB
isCli
Check if script running on CLI
getLogger
setLogger
Parameters:
Parameter | Type | Description |
---|---|---|
$logger |
\Psr\Log\LoggerInterface |
getRuntimeDir
setRuntimeDir
Parameters:
Parameter | Type | Description |
---|---|---|
$runtime_dir |
string |
setCachePool
Parameters:
Parameter | Type | Description |
---|---|---|
$cache_pool |
\Psr\SimpleCache\CacheInterface |
getCachePool
defaultConfig
- This method is static.
getConnection
Get connection of DB
getConnectionParams
Connection params getter
Dummy
Dummy method of translation
- Full name: \NovemBit\i18n\component\translation\method\Dummy
- Parent class: \NovemBit\i18n\component\translation\method\Method
See Also:
Exception
System Exception class
- Full name: \NovemBit\i18n\system\exception\Exception
- Parent class:
- This class implements: \NovemBit\i18n\system\exception\FriendlyExceptionInterface
See Also:
Google Translate method of translation
- Full name: \NovemBit\i18n\component\translation\method\Google
- Parent class: \NovemBit\i18n\component\translation\method\Method
See Also:
mainInit
{@inheritdoc}
HTML
ActiveRecord class. Child of Yii ActiveRecord library
- Full name: \NovemBit\i18n\component\translation\type\models\HTML
- Parent class: \NovemBit\i18n\component\translation\models\Translation
See Also:
get
Main method to get translations from DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$texts |
array | Texts array to translate |
$from_language |
string | From language |
$to_languages |
array | To languages list |
$reverse |
boolean | Use translate column as source (ReTranslate) |
saveTranslations
Main method to save translations in DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$from_language |
string | From language |
$translations |
array | Translations of texts |
$level |
integer | Level of translation |
$overwrite |
boolean | Overwrite or not |
$result |
array |
getDB
- This method is static.
HTML
HTML type for translation component
- Full name: \NovemBit\i18n\component\translation\type\HTML
- Parent class: \NovemBit\i18n\component\translation\type\XML
- This class implements: \NovemBit\i18n\component\translation\type\interfaces\HTML
See Also:
defaultConfig
{@inheritDoc}
- This method is static.
getParserType
setParserType
Parameters:
Parameter | Type | Description |
---|---|---|
$parser_type |
integer |
buildToTranslateFields
Parameters:
Parameter | Type | Description |
---|---|---|
$node |
\DOMNode | |
$params |
array | |
$data |
array |
replaceTranslatedFields
Parameters:
Parameter | Type | Description |
---|---|---|
$node |
\DOMNode | |
$params |
array | |
$data |
array |
getHelperAttributes
{@inheritDoc}
setHelperAttributes
{@inheritDoc}
Parameters:
Parameter | Type | Description |
---|---|---|
$status |
boolean | If true then |
html translation including additional attributes |
addBeforeParseCallback
Parameters:
Parameter | Type | Description |
---|---|---|
$callback |
callable |
addAfterParseCallback
Parameters:
Parameter | Type | Description |
---|---|---|
$callback |
callable |
getBeforeParseCallbacks
getAfterParseCallbacks
HTMLFragment
HTML type for translation component
- Full name: \NovemBit\i18n\component\translation\type\HTMLFragment
- Parent class: \NovemBit\i18n\component\translation\type\HTML
- This class implements: \NovemBit\i18n\component\translation\type\interfaces\HTMLFragment
See Also:
defaultConfig
{@inheritDoc}
- This method is static.
getParserType
setParserType
Parameters:
Parameter | Type | Description |
---|---|---|
$parser_type |
integer |
buildToTranslateFields
Parameters:
Parameter | Type | Description |
---|---|---|
$node |
\DOMNode | |
$params |
array | |
$data |
array |
replaceTranslatedFields
Parameters:
Parameter | Type | Description |
---|---|---|
$node |
\DOMNode | |
$params |
array | |
$data |
array |
getHelperAttributes
{@inheritDoc}
setHelperAttributes
{@inheritDoc}
Parameters:
Parameter | Type | Description |
---|---|---|
$status |
boolean | If true then |
html translation including additional attributes |
addBeforeParseCallback
Parameters:
Parameter | Type | Description |
---|---|---|
$callback |
callable |
addAfterParseCallback
Parameters:
Parameter | Type | Description |
---|---|---|
$callback |
callable |
getBeforeParseCallbacks
getAfterParseCallbacks
JSON
ActiveRecord class. Child of Yii ActiveRecord library
- Full name: \NovemBit\i18n\component\translation\type\models\JSON
- Parent class: \NovemBit\i18n\component\translation\models\Translation
See Also:
get
Main method to get translations from DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$texts |
array | Texts array to translate |
$from_language |
string | From language |
$to_languages |
array | To languages list |
$reverse |
boolean | Use translate column as source (ReTranslate) |
saveTranslations
Main method to save translations in DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$from_language |
string | From language |
$translations |
array | Translations of texts |
$level |
integer | Level of translation |
$overwrite |
boolean | Overwrite or not |
$result |
array |
getDB
- This method is static.
LanguageException
Language Component Exception file
- Full name: \NovemBit\i18n\component\languages\exceptions\LanguageException
- Parent class: \NovemBit\i18n\system\exception\Exception
See Also:
Method
ActiveRecord class. Child of Yii ActiveRecord library
- Full name: \NovemBit\i18n\component\translation\method\models\Method
- Parent class: \NovemBit\i18n\component\translation\models\Translation
See Also:
get
Main method to get translations from DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$texts |
array | Texts array to translate |
$from_language |
string | From language |
$to_languages |
array | To languages list |
$reverse |
boolean | Use translate column as source (ReTranslate) |
saveTranslations
Main method to save translations in DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$from_language |
string | From language |
$translations |
array | Translations of texts |
$level |
integer | Level of translation |
$overwrite |
boolean | Overwrite or not |
$result |
array |
getDB
- This method is static.
MethodException
Language Component Exception file
- Full name: \NovemBit\i18n\component\translation\method\exceptions\MethodException
- Parent class: \NovemBit\i18n\system\exception\Exception
See Also:
Module
Module class Main instance of i18n library. Should be used for any external connection Provides component system. There have some required components, DBAL (RDMS) configurations, Request handlers, Translation abstraction layer,
Its simple but provides very useful functionality Module class
- Full name: \NovemBit\i18n\Module
- Parent class: \NovemBit\i18n\system\Component
See Also:
__construct
Component constructor.
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
array | Configuration array |
$context |
null|\NovemBit\i18n\system\Component | Context (parent) Component |
commonLateInit
Load Yii framework container to use some libraries that not Allowed to use standalone
mainInit
Component init method Non CLI Running after child component initialization
isCli
Check if script running on CLI
getLogger
setLogger
Parameters:
Parameter | Type | Description |
---|---|---|
$logger |
\Psr\Log\LoggerInterface |
getRuntimeDir
setRuntimeDir
Parameters:
Parameter | Type | Description |
---|---|---|
$runtime_dir |
string |
setCachePool
Parameters:
Parameter | Type | Description |
---|---|---|
$cache_pool |
\Psr\SimpleCache\CacheInterface |
getCachePool
defaultConfig
Default component configuration
- This method is static.
start
Start request translation
instance
Creating module main instance
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$config |
null|array | Main configuration array |
RequestException
Request Exception class
- Full name: \NovemBit\i18n\component\request\exceptions\RequestException
- Parent class: \NovemBit\i18n\system\exception\Exception
See Also:
Rest
Rest component
Its simple but provides very useful functionality Module class
- Full name: \NovemBit\i18n\component\rest\Rest
- Parent class: \NovemBit\i18n\system\Component
- This class implements: \NovemBit\i18n\component\rest\interfaces\Rest
See Also:
__construct
Component constructor.
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
array | Configuration array |
$context |
null|\NovemBit\i18n\system\Component | Context (parent) Component |
isCli
Check if script running on CLI
getLogger
setLogger
Parameters:
Parameter | Type | Description |
---|---|---|
$logger |
\Psr\Log\LoggerInterface |
getRuntimeDir
setRuntimeDir
Parameters:
Parameter | Type | Description |
---|---|---|
$runtime_dir |
string |
setCachePool
Parameters:
Parameter | Type | Description |
---|---|---|
$cache_pool |
\Psr\SimpleCache\CacheInterface |
getCachePool
defaultConfig
- This method is static.
start
Start rest request
actionTranslate
Translate Action method
actionIndex
Index Action method
actionRestrict
Restrict Action method
Rest
Rest Translate method of translation
- Full name: \NovemBit\i18n\component\translation\method\Rest
- Parent class: \NovemBit\i18n\component\translation\method\Method
See Also:
getLanguagesConfig
Get languages configuration from main module instance $config
Strings
- Full name: \NovemBit\i18n\system\helpers\Strings
getStringsDifference
Get string difference
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$before |
string | Initial type of string |
$after |
string | Final type of string |
$prefix |
string|null | Referenced variable to receive difference prefix |
$suffix |
string|null | Referenced variable to receive difference suffix |
Text
ActiveRecord class. Child of Yii ActiveRecord library
- Full name: \NovemBit\i18n\component\translation\type\models\Text
- Parent class: \NovemBit\i18n\component\translation\models\Translation
See Also:
get
Main method to get translations from DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$texts |
array | Texts array to translate |
$from_language |
string | From language |
$to_languages |
array | To languages list |
$reverse |
boolean | Use translate column as source (ReTranslate) |
saveTranslations
Main method to save translations in DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$from_language |
string | From language |
$translations |
array | Translations of texts |
$level |
integer | Level of translation |
$overwrite |
boolean | Overwrite or not |
$result |
array |
getDB
- This method is static.
Translation
ActiveRecord class. Child of Yii ActiveRecord library
- Full name: \NovemBit\i18n\component\translation\models\Translation
- Parent class: \NovemBit\i18n\models\DataMapper
- This class implements: \NovemBit\i18n\component\translation\models\interfaces\Translation
See Also:
getDB
- This method is static.
get
Main method to get translations from DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$texts |
array | Texts array to translate |
$from_language |
string | From language |
$to_languages |
array | To languages list |
$reverse |
boolean | Use translate column as source (ReTranslate) |
saveTranslations
Main method to save translations in DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$from_language |
string | From language |
$translations |
array | Translations of texts |
$level |
integer | Level of translation |
$overwrite |
boolean | Overwrite or not |
$result |
array |
TranslationException
Request Exception class
- Full name: \NovemBit\i18n\component\translation\exceptions\TranslationException
- Parent class: \NovemBit\i18n\system\exception\Exception
See Also:
URL
ActiveRecord class. Child of Yii ActiveRecord library
- Full name: \NovemBit\i18n\component\translation\type\models\URL
- Parent class: \NovemBit\i18n\component\translation\models\Translation
See Also:
get
Main method to get translations from DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$texts |
array | Texts array to translate |
$from_language |
string | From language |
$to_languages |
array | To languages list |
$reverse |
boolean | Use translate column as source (ReTranslate) |
saveTranslations
Main method to save translations in DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$from_language |
string | From language |
$translations |
array | Translations of texts |
$level |
integer | Level of translation |
$overwrite |
boolean | Overwrite or not |
$result |
array |
getDB
- This method is static.
rules
{@inheritdoc}
URL
Helper class for some actions with URLs
- Full name: \NovemBit\i18n\system\helpers\URL
See Also:
addQueryVars
Adding query parameters to URL
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
string | Initial url |
$name |
string | Parameter name (key) |
$value |
string | Value of parameter |
removeQueryVars
Remove Query parameter from URL
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
string | Initial url |
$paramName |
string | Parameter name (key) |
buildUrl
Build url from parts Same as reversed parse_url
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$parts |
array | Parts of url |
XML
HTML type for translation component
- Full name: \NovemBit\i18n\component\translation\type\XML
- Parent class: \NovemBit\i18n\component\translation\type\Type
See Also:
defaultConfig
{@inheritDoc}
- This method is static.
getParserType
setParserType
Parameters:
Parameter | Type | Description |
---|---|---|
$parser_type |
integer |
buildToTranslateFields
Parameters:
Parameter | Type | Description |
---|---|---|
$node |
\DOMNode | |
$params |
array | |
$data |
array |
replaceTranslatedFields
Parameters:
Parameter | Type | Description |
---|---|---|
$node |
\DOMNode | |
$params |
array | |
$data |
array |
getHelperAttributes
{@inheritDoc}
setHelperAttributes
{@inheritDoc}
Parameters:
Parameter | Type | Description |
---|---|---|
$status |
boolean | If true then |
html translation including additional attributes |
addBeforeParseCallback
Parameters:
Parameter | Type | Description |
---|---|---|
$callback |
callable |
addAfterParseCallback
Parameters:
Parameter | Type | Description |
---|---|---|
$callback |
callable |
getBeforeParseCallbacks
getAfterParseCallbacks
XML
ActiveRecord class. Child of Yii ActiveRecord library
- Full name: \NovemBit\i18n\component\translation\type\models\XML
- Parent class: \NovemBit\i18n\component\translation\models\Translation
See Also:
get
Main method to get translations from DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$texts |
array | Texts array to translate |
$from_language |
string | From language |
$to_languages |
array | To languages list |
$reverse |
boolean | Use translate column as source (ReTranslate) |
saveTranslations
Main method to save translations in DB
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$from_language |
string | From language |
$translations |
array | Translations of texts |
$level |
integer | Level of translation |
$overwrite |
boolean | Overwrite or not |
$result |
array |
getDB
- This method is static.
This document was automatically generated from source code comments on 2019-12-03 using phpDocumentor and cvuorinen/phpdoc-markdown-public
All versions of i18n with dependencies
ext-dom Version *
ext-libxml Version *
ext-pdo Version *
ext-json Version *
ext-curl Version *
ext-simplexml Version *
ext-mbstring Version *
psr/cache Version *
psr/log Version *
google/cloud-translate Version *
masterminds/html5 Version ^2.7
cache/cache Version *
monolog/monolog Version *
doctrine/dbal Version *