Skip to content

Commit 7105557

Browse files
committed
WTF please work in dev !
1 parent eee3169 commit 7105557

32 files changed

+192
-13183
lines changed

LICENSE

100644100755
File mode changed.

README.md

100644100755
Lines changed: 36 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -3,80 +3,57 @@ Laravel Localization Helpers
33

44
[![Latest Stable Version](https://poser.pugx.org/potsky/laravel-localization-helpers/v/stable.svg)](https://packagist.org/packages/potsky/laravel-localization-helpers)
55
[![Latest Unstable Version](https://poser.pugx.org/potsky/laravel-localization-helpers/v/unstable.svg)](https://packagist.org/packages/potsky/laravel-localization-helpers)
6-
[![Build Status](https://travis-ci.org/potsky/laravel-localization-helpers.svg)](https://travis-ci.org/potsky/laravel-localization-helpers)
7-
[![Coverage Status](https://coveralls.io/repos/potsky/laravel-localization-helpers/badge.svg?branch=master&service=github)](https://coveralls.io/github/potsky/laravel-localization-helpers?branch=master)
86
[![Total Downloads](https://poser.pugx.org/potsky/laravel-localization-helpers/downloads.svg)](https://packagist.org/packages/potsky/laravel-localization-helpers)
97

10-
LLH is a set of tools to help you manage translations in your Laravel project. Run the `localization:missing` artisan command to automatically generate lang files according to your PHP sources.
118

12-
## Table of contents
139

14-
1. [Installation](#1-installation)
15-
1. [Configuration](#2-configuration)
16-
1. [Usage](#3-usage)
17-
1. [Support](#4-support)
18-
1. [Contribute](#5-contribute)
19-
1. [Change Log](#6-change-log)
10+
LLH is a set of tools to help you manage translations in your Laravel project.
2011

21-
## 1. Installation
12+
## Installation
2213

23-
- Add the following line in the `require-dev` array of the `composer.json` file :
24-
```
25-
"potsky/laravel-localization-helpers" : "~1"
26-
```
14+
1 - Add the following line in the `require-dev` array of the `composer.json` file :
15+
`"potsky/laravel-localization-helpers" : "~1.1"`
2716

28-
- Update your installation : `composer update`
29-
- Add the following line in the `providers` array of the `app/config/app.php` configuration file :
30-
```
31-
'Potsky\LaravelLocalizationHelpers\LaravelLocalizationHelpersServiceProvider'
32-
```
17+
2 - Update your installation : `composer update`
3318

34-
- Now execute `php artisan list` and you should view the new *localization* commands:
35-
```
36-
...
37-
localization
38-
localization:clear Remove lang backup files
39-
localization:find Display all files where the argument is used as a lemma
40-
localization:missing Parse all translations in app directory and build all lang files
41-
...
42-
```
19+
3 - Add one of the following lines in the `providers` array of the `app/config/app.php` configuration file :
4320

44-
You can add the facade in the Aliases if you need to manage translations in your code :
21+
Laravel 4: `'Potsky\LaravelLocalizationHelpers\LaravelLocalizationHelpersServiceProvider',`
22+
23+
Laravel 5: `'Potsky\LaravelLocalizationHelpers\LaravelLocalizationHelpersServiceProviderLaravel5',`
24+
25+
26+
Now execute `php artisan list` and you should view the new *localization* commands:
4527

4628
```
47-
'LocalizationHelpers' => 'Potsky\LaravelLocalizationHelpers\Facade\LocalizationHelpers'
29+
...
30+
key
31+
key:generate Set the application key
32+
localization
33+
localization:find Display all files where the argument is used as a lemma
34+
localization:missing Parse all translations in app directory and build all lang files
35+
migrate
36+
migrate:install Create the migration repository
37+
...
4838
```
4939

50-
## 2. Configuration
40+
## Configuration
5141

5242
To configure your fresh installed package, please create a configuration file by executing :
5343

54-
- Laravel 4: `php artisan config:publish potsky/laravel-localization-helpers`
55-
- Laravel 5: `php artisan vendor:publish`
44+
For Laravel 4: `php artisan config:publish potsky/laravel-localization-helpers`
5645

57-
Then you can modify the configuration in file :
46+
For Laravel 5: `php artisan vendor:publish`
5847

59-
- Laravel 4: `app/config/packages/potsky/laravel-localization-helpers/config.php`
60-
- Laravel 5: `app/config/laravel-localization-helpers.php`
48+
Then you can modify the configuration in file `app/config/packages/potsky/laravel-localization-helpers/config.php` (Laravel 4) or `app/config/laravel-localization-helpers.php` (Laravel 5).
6149

6250
Add new folders to search for, add your own lang methods or functions, ...
6351

64-
### Backup files
65-
66-
You should not include backup lang files in GIT or other versioning systems.
67-
68-
In your `laravel` folder, add this in `.gitignore` file :
69-
70-
```
71-
# Do not include backup lang files
72-
app/lang/*/[a-zA-Z]*.[0-9_]*.php
73-
```
74-
75-
## 3. Usage
52+
## Usage
7653

77-
### 3.1 Command `localization:missing`
54+
### Command `localization:missing`
7855

79-
This command parses all your code and generates according lang files in all `lang/XXX/` directories.
56+
This command parses all your code and generate according lang files in all `lang/XXX/` directories.
8057

8158
Use `php artisan help localization:missing` for more informations about options.
8259

@@ -121,11 +98,10 @@ php artisan localization:missing -d
12198
##### Generate all lang files and set new lemma values
12299

123100
3 commands below produce the same output:
124-
125101
```
126102
php artisan localization:missing
127103
php artisan localization:missing -l
128-
php artisan localization:missing -l "TODO: %LEMMA"
104+
php artisan localization:missing -l "%LEMMA"
129105
```
130106

131107
You can customize the default generated values for unknown lemmas.
@@ -136,13 +112,13 @@ The following command let new values empty:
136112
php artisan localization:missing -l ""
137113
```
138114

139-
The following command prefixes all lemma values with "Please translate this : "
115+
The following command prefixes all lemmas values with "Please translate this : "
140116

141117
```
142118
php artisan localization:missing -l "Please translate this : %LEMMA"
143119
```
144120

145-
The following command set all lemma values to "Please translate this !"
121+
The following command prefixes all lemmas values with "Please translate this !"
146122

147123
```
148124
php artisan localization:missing -l 'Please translate this !'
@@ -179,13 +155,7 @@ You can edit the editor path in your configuration file. By default, editor is *
179155
'editor_command_line' => '/Applications/Sublime\\ Text.app/Contents/SharedSupport/bin/subl'
180156
```
181157

182-
For *PHPStorm* on *Mac OS X*:
183-
184-
```
185-
'editor_command_line' => '/usr/local/bin/phpstorm'
186-
```
187-
188-
### 3.2 Command `localization:find`
158+
### Command `localization:find`
189159

190160
This command will search in all your code for the argument as a lemma.
191161

@@ -220,63 +190,15 @@ php artisan localization:find -s -r "/.*me$/"
220190

221191
> PCRE functions are used
222192
223-
### 3.3 Command `localization:clear`
224-
225-
This command will remove all backup lang files.
226-
227-
Use `php artisan help localization:clear` for more informations about options.
228-
229-
#### *Examples*
230-
231-
##### Remove all backups
232-
233-
```
234-
php artisan localization:clear
235-
```
236-
237-
##### Remove backups older than 7 days
238-
239-
```
240-
php artisan localization:clear -d 7
241-
```
242-
243-
## 4. Support
244-
245-
Use the [github issue tool](https://github.com/potsky/laravel-localization-helpers/issues) to open an issue or ask for something.
246-
247-
## 5. Contribute
248-
249-
1. Fork it
250-
2. Create your feature branch (`git checkout -b my-new-feature`)
251-
3. Commit your changes (`git commit -am 'Added some feature'`)
252-
4. Push to the branch (`git push origin my-new-feature`)
253-
5. Create new Pull Request
254-
255-
Tests are in `tests`. To run the tests: `vendor/bin/phpunit`.
256-
257-
Coverage cannot decrease next a merge. To track file coverage, run `vendor/bin/phpunit --coverage-html coverage` and open `coverage/index.html` to check uncovered lines of code.
258-
259-
## 6. Change Log
260-
261-
### v1.4
262-
263-
- new command `localization:clear` to remove backups
264-
- new command `localization:translate` to translate a sentence with Bing Translator
265-
- new options to specify output formatting
266-
- new option to let the command translate sentences for you with Bing Translator
267-
- new lemma are now marked with the `TODO:` prefix by default (*if you ran two times the missing artisan command without translating lemma next to the first run, your missing translation were lost in the lang file. Now by default, just search for TODO in your lang file!*)
268-
- simplified service provider, no need to load distinct providers according to Laravel version
193+
## Support
269194

270-
Internally :
195+
Use the github issue system to open a issue and ask for something.
271196

272-
- totally refactored
273-
- unit tests
274-
- test coverage
275-
- facade to let you use localization helpers in your code
197+
## Change Log
276198

277199
### v1.3.2
278200

279-
- fix incompatibility with Laravel 5.2 ([#16](https://github.com/potsky/laravel-localization-helpers/issues/16))
201+
- fix incompatibility with Laravel 5.2 [#16](https://github.com/potsky/laravel-localization-helpers/issues/16)
280202

281203
### v1.3.1
282204

0 commit comments

Comments
 (0)