omcrn / yii2-i18ncontent
There is no license information available for the latest version (v2.0.3) of this package.
Show text widgets, pages, articles in chosen language
v2.0.3
2018-09-19 08:02 UTC
Requires
- php: >=5.4.0
- omcrn/yii2-base: ~0.2
- omcrn/yii2-imperavi-redactor: ^0.0.4
- trntv/yii2-aceeditor: ^2.0
- trntv/yii2-datetime-widget: ^1.0.0
- trntv/yii2-file-kit: ^1.0.0
- wbraganca/yii2-tagsinput: ^1.0
- yiisoft/yii2: ~2.0.0
- dev-master
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.18
- 1.1.17
- 1.1.16
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-dbmenu
This package is not auto-updated.
Last update: 2024-11-10 00:13:43 UTC
README
yii2-i18ncontent is yii2 module for creating several types of contents in different languages. It support creating the following contents:
- Translatable article categories and articles
- Translatable Pages
- Carousels with translatable caption texts
- Translatable portions of text.
- Menu contents (Non translatable yet)
Installation
- Run
composer require omcrn/yii2-i18ncontent
or add"omcrn/yii2-i18ncontent": "~2.0.0"
in your projectscomposer.json
. - Make sure you have
user
table in your database with primary keyid
. - Run migrations to create tables by
php console/yii migrate --migrationPath=@yii/i18n/migrations
from projects root directory - Run migrations to create tables by
php console/yii migrate --migrationPath=@vendor/omcrn/yii2-i18ncontent/migrations
from projects root directory
Configuration
Add the following code in projects configuration file under modules
section
'i18ncontent' => [ 'class' => 'centigen\i18ncontent\Module', 'defaultLayout' => '/admin', //Default layout which will be used for rendering i18ncontent pages ],
Add the following code in project's configuration file under components
section
"i18n" => [ "translations" => [ '...', 'i18ncontent' => [ 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@vendor/omcrn/yii2-i18ncontent/messages', ], ] ] 'formatter' => [ 'class' => 'centigen\base\i18n\Formatter' ], 'i18ncontent' => [ 'class' => 'centigen\i18ncontent\I18nContent', 'userClass' => 'common\models\User', //User model class. If you do not have user model, generate it from user table. Make sure this models extends \yii\db\ActiveRecord class 'mediaUrlPrefix' => null, //In texts which may contain <img> or other media object tags (texts which come from WYSIWYG editors) // `$mediaUrlPrefix` strings are replaced with `$mediaUrlReplacement` string when calling `Html::encodeMediaItemUrls` // and vice versa when calling `Html::decodeMediaItemUrls` 'mediaUrlReplacement' => '{{media_item_url_prefix}}' //See `$mediaUrlPrefix` ],
Add availableLocales
array to application configuration params
array.
For each language listed here tab will be displayed to provide content.
'params' => [ '...', 'availableLocales' => [ 'en-US' => 'English', 'ru-RU' => 'Русский' ... ], ]
Urls for administration
Append the following urls to the domain to see administration pages