Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lorenzo/cakephp-lokalise
A CakePHP utility shell to upload translation templates to Lokalise.co and download the translated strings
https://github.com/lorenzo/cakephp-lokalise
cakephp cakephp-plugin cakephp3 i18n lokalise translations
Last synced: 19 days ago
JSON representation
A CakePHP utility shell to upload translation templates to Lokalise.co and download the translated strings
- Host: GitHub
- URL: https://github.com/lorenzo/cakephp-lokalise
- Owner: lorenzo
- Created: 2017-02-14T12:12:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T14:03:32.000Z (almost 8 years ago)
- Last Synced: 2024-10-11T06:33:25.343Z (about 1 month ago)
- Topics: cakephp, cakephp-plugin, cakephp3, i18n, lokalise, translations
- Language: PHP
- Size: 8.79 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CakePHP Plugin for Lokalise.co
[Lokalise](https://lokalise.co) is a service that helps you translated your application strings and keep a track of how those translations
change. The idea of this plugin is that you can upload the translation strings to this services, then after
translating them, download the translations and put them in the right directories for each locale.## Installation
First add the plugin to composer
```sh
composer require lorenzo/lokalise
```Then activate the plugin
```
bin/cake plugin load Lokalise
```Finally add your project id and lokalise API token to `app.php`
```php
// config/app.php
...'Lokalise' => [
'project' => 'your project id',
'api_token' => 'the api token as provided by lokalise'
]
```## Usage
You first need to run the `i18n extract` that is provided by CakePHP. This task will find all call for the
`__()` of functions and generate at least one `.pot` file in the `src/Locale` folder```sh
bin/cake i18n extract
```Once this process is done, you can push your translations to lokalise. You need to be explicit about the locales
you want to create/update in lokalise:```sh
bin/cake lokalise push --locales en_US,fr_FR,pt_BR
```You can now go to your lokalise dashboard and translated all the strings. In order to see the tranlated strings in
your applicaiton, you need to download them back:```sh
bin/cake lokalise pull
```