https://github.com/thecodingmachine/utils.i18n.fine.db-translator
Fine is a PHP internationalisation package. It will help you provide applications that support several languages. FINE means: Fine is not english :). This package provides a DB mapper that stores translations in database.
https://github.com/thecodingmachine/utils.i18n.fine.db-translator
Last synced: 12 months ago
JSON representation
Fine is a PHP internationalisation package. It will help you provide applications that support several languages. FINE means: Fine is not english :). This package provides a DB mapper that stores translations in database.
- Host: GitHub
- URL: https://github.com/thecodingmachine/utils.i18n.fine.db-translator
- Owner: thecodingmachine
- License: mit
- Created: 2015-07-07T15:07:02.000Z (almost 11 years ago)
- Default Branch: 4.0
- Last Pushed: 2016-07-08T10:26:38.000Z (almost 10 years ago)
- Last Synced: 2025-06-30T03:09:39.562Z (12 months ago)
- Language: PHP
- Size: 162 KB
- Stars: 0
- Watchers: 14
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
FINE: database storage for translations
=======================================
[](https://scrutinizer-ci.com/g/thecodingmachine/utils.i18n.fine.db-translator/?branch=4.0)
[](https://scrutinizer-ci.com/g/thecodingmachine/utils.i18n.fine.db-translator/?branch=4.0)
Fine is Mouf's PHP internationalisation package. It will help you develop applications that support several languages.
Most of the time, you will use Fine with the FileTranslator that stores translations in PHP mapping files.
This package contains one *alternative translator* that stores translations in database rather than in files.
Why?
----
Use this **DbTranslator** if you want to make translations editable by your users. You can then directly write
the translations in the `message_translations` table that is created by this package.
Dependencies
------------
Fine comes as a *Composer* package and requires the "Mouf" framework to run.
The first step is therefore to [install Mouf](http://www.mouf-php.com/).
Once Mouf is installed, you can process to the Fine and DbTranslator installation.
Installation
------------
A typical *composer.json* file might look like this:
```json
{
"require": {
"mouf/mouf" : "~2.0.0",
"mouf/utils.i18n.fine.common" : "~4.0",
"mouf/utils.i18n.fine.db-translator" : "~4.0",
"mouf/utils.i18n.fine.manage.bo" : "~4.0"
},
"minimum-stability": "dev"
}
```
*mouf/utils.i18n.fine.db-translator* refers to this package and *mouf/utils.i18n.fine.manage.bo* is package that
contains the user interface in Mouf to view/edit translations.
To install the dependency, run:
```bash
composer update
```
Now, go to the Mouf UI (http://[your_server]/[your_app]/vendor/mouf/mouf) and process to the package installation by
clicking the "Run installation tasks" button.
You can now edit your translations directly using the "HTML > Fine" menu.
Behind the scenes, the Mouf installer has created a `dbTranslatorService` instance and binded it to the `defaultTranslatorService`.
You can keep using Fine is you would usually do (using the `defaultTranslatorService`) and the `dbTranslatorService`
will automatically be called.