aranytoth / yii2-general-translate
This is an experiment project to translate contents without modify its tables. It connects localized rows by relation table
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-06-05 18:42:20 UTC
README
This is an experimental project far from done
General multilanguage managemenet for Yii 2
Introduction
This modul tries to give a general multilanguage solution for existing projects.
Installation
Via Composer
composer require aranytoth/yii2-general-translate
Or manually add to composer.json
"aranytoth/yii2-general-translate": "dev-master"
Migration
Run the following command in Terminal for database migration:
yii migrate --migrationPath=@aranytoth/Yii2GeneralTranslate/migrations
Configuration
YiiGeneralTranslate registers it's own module to http://your-site/translate. If you want to register manually, set 'createLangModule' => false in your params.php. Default translate module can't be reach in advanced template's frontend.
Usage
Current languages can be create/edit at translate/language. You can enable/disable/edit existing languages or create new.
If you like to enable multilanguage on your model:
- change your model class extend from \yii\db\ActiveRecord to \aranytoth\Yii2GeneralTranslate\models\LangModel
- Place aranytoth\Yii2GeneralTranslate\components\LangWidget::widget(['model' => $model]) widget to create / update form. This enables a buttons with active languages