PHPackages                             mmelcor/yii2-babelfish - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. mmelcor/yii2-babelfish

ActiveLibrary[Database &amp; ORM](/categories/database)

mmelcor/yii2-babelfish
======================

A translation manager for Yii2.

1.1(8y ago)243MITPHP

Since Mar 7Pushed 8y ago3 watchersCompare

[ Source](https://github.com/mmelcor/yii2-babelfish)[ Packagist](https://packagist.org/packages/mmelcor/yii2-babelfish)[ Docs](https://github.com/mmelcor/yii2-babelfish)[ RSS](/packages/mmelcor-yii2-babelfish/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (8)Versions (22)Used By (0)

Yii2 Babel Fish
===============

[](#yii2-babel-fish)

The Yii2 Babelfish symbiote is a portal to edit and update translations.

Key Features
------------

[](#key-features)

- Uses it's own database for RBAC and user identities that can be shared across multiple instances of babelfish, allowing for easy translator management for several applications in one spot.
- Properly escapes tags and special syntax so the tranlator doesn't need to know how to do so.
- Uses AdminLTE and Redactor for an intuitive user experience
- Intended to be used with Yii2 Advanced Template

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist mmelcor/yii2-babelfish "*"
```

or add

```
"mmelcor/yii2-babelfish": "*"
```

to the require section of your `composer.json` file.

Configuration
-------------

[](#configuration)

Once the extension is installed :

**Dependency Configuration**

Follow configuration for [oorrwullie\\yii2-babelfishfood](https://github.com/oorrwullie/yii2-babelfishfood). Once this has been completed continue configuring the remaining dependencies:

**Filesystem Configuration**Configure your file system component. This package comes with `creocoder\flysystem\AwsS3FileSystem` by default as that is what we use. You may use any of those supported by [trntv/yii2-file-kit](https://github.com/trntv/yii2-file-ki). Place the following in the `common/config/main.php` file, or similar depending on your file system.

```
'components' => [
	'awss3Fs' => [
		'class' => 'creocoder\flysystem\AwsS3Filesystem',
		'key' => '[AWS key]',
		'secret' => '[AWS Secret]',
		'region' => '[region]',
		'bucket' => '[bucket name]',
		'prefix' => '[prefix folder path]',
		'baseUrl' => '[S3 base url path]'
	],
	'...',
],
```

for additional information or options checkout [creocoder\\Flysystem](https://github.com/creocoder/yii2-flysystem). Feel free to use any of the other file system options they support.

Configure `babelFileStorage` place the following also in `common/config/main.php`. The file storage step is required to follow the file system set up as it uses the file system as the route for storing the uploaded files. File storage is required to support the uploading of users' avatars, and potential future features.

```
'components' => [
	'...',
	'babelFileStorage' => [ //this must be the component name, as it is being used in the module.
		'class' => 'trntv\filekit\Storage',
		'filesystemComponent' => 'awss3Fs', //or whichever file system you are using.
		'baseUrl' => '[Your base url path]'
	],
	'...',
],
```

If you have trouble see [trntv/yii2-file-kit](https://github.com/trntv/yii2-file-kit) documentation.

**Module Configuration**

1. Create a new database to house babelfish specific RBAC and Users.
2. Add babelfishDb to `common/config/main-local.php`. This component *must* be named `babelfishDb` as that is the component the module will be looking for.

    ```
    'components' => [
    	'. . .',
    	'babelfishDb' => [
    		'class' => 'yii\db\Connection',
    		'dsn' => 'mysql:host=localhost;dbname=[database name],
    		'username' => '[username]',
    		'password' => '[password]',
    		'charset' => 'utf8',
    	],
    ],
    ```
3. Config Init module by setting up the Module and bootstrapping it in `console/config/main.php`. This module will be used to install database migrations and setup the initial super user for the module. Example setup:

    ```
        'bootstrap' => ['log', 'babelfish-init'],
    	'modules' => [
    		'babelfish-init' => 'mmelcor\babelfish\Init',
    	],
    ```
4. Config babelfish module in `frontend/config/main.php` by placing the following in the modules section:

    ```
    'modules' => [
    	'babel' => [
    		'class' => 'mmelcor\babelfish\Module',
    		'cookieValidationKey' => '[CSRF Key]', //you will need to generate a unique validation key.
    	],
    ],
    ```

**Run console commands**

Once the configuration has been completed next run the following console commands:

1. `./yii babelfish-init` This creates the RBAC tables and users table in the babelfish users.
2. `./yii babelfish-init/load-rbac` This will load the RBAC roles and rules into the database.
3. `./yii babelfish-init/signup` This will create the initial super user for administration.

**Add Translation Hooks**

Add the following babelfish necessary translation hooks to the `common/config/main.php` i18n section:

```
'i18n' => [
	'translations' => [
		'. . .',
		'base*' => [
			'class' => 'yii\i18n\GettextMessageSource',
			'useMoFile' => false,
			'basePath' => '@common/messages',
		],
		'babelfish*' => [
			'class' => 'yii\i18n\GettextMessageSource',
			'useMoFile' => false,
			'basePath' => '@common/messages',
		],
	],
],
```

Implementation
--------------

[](#implementation)

Once this has all been completed you should be able to navigate to yourdomain.com/babel. If everything has been installed and configured correctly you should see the following screen:

[![babelfish login screenshot](login.png)](login.png)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 81.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Recently: every ~12 days

Total

21

Last Release

3283d ago

Major Versions

0.6.5 → 1.02017-03-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2bfbc1074f32e3646cdf5b5a875cdb84a03838cbe081b738b9d23f756cde143?d=identicon)[mmelcor](/maintainers/mmelcor)

---

Top Contributors

[![mmelcor](https://avatars.githubusercontent.com/u/6663917?v=4)](https://github.com/mmelcor "mmelcor (44 commits)")[![oorrwullie](https://avatars.githubusercontent.com/u/13438995?v=4)](https://github.com/oorrwullie "oorrwullie (10 commits)")

---

Tags

translationsdatabasepoguimanageryii2multi-site

### Embed Badge

![Health badge](/badges/mmelcor-yii2-babelfish/health.svg)

```
[![Health](https://phpackages.com/badges/mmelcor-yii2-babelfish/health.svg)](https://phpackages.com/packages/mmelcor-yii2-babelfish)
```

###  Alternatives

[johnitvn/yii2-ajaxcrud

Gii CRUD template for Single Page Ajax Administration for yii2

97209.6k16](/packages/johnitvn-yii2-ajaxcrud)[dmstr/yii2-db

Database extensions

19618.8k6](/packages/dmstr-yii2-db)[mg-code/yii2-helpers

A collection of useful helper classes for Yii framework 2.0

2022.5k5](/packages/mg-code-yii2-helpers)[spanjeta/yii2-backup

Database Backup and Restore functionality

285.0k1](/packages/spanjeta-yii2-backup)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
