Skip to content

Commit

Permalink
Updated readme + changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasss93 committed Aug 29, 2020
1 parent 69c6016 commit d058569
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v1.5 - 2020-08-29
### Added
- Added **--include** option to `larex:export` command
- Added **--exclude** option to `larex:export` command

## v1.4 - 2020-08-28
### Added
- Added `larex:insert` command
Expand Down
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This step *can be skipped* if package auto-discovery is enabled.
* key (the array key)
* en (the language code)
* other language codes...

2. Open the *project-root/resources/lang/localization.csv* file and edit it as you see fit.

3. Finally, you can use `php artisan larex:export` to translate your entries from the csv file to the laravel php files.
Expand All @@ -52,19 +52,23 @@ This step *can be skipped* if package auto-discovery is enabled.
* Be careful when using the `php artisan larex:export` command! It will overwrite all files named with the group names inside the CSV.
* Be careful when using the **dot notation**! Only the **last** entry will override the value.
* You can use `php artisan larex:insert` to add new items via CLI too!
* You can use `php artisan larex:export --include=en,it` to export only _"en"_ and _"it"_ columns.
* You can use `php artisan larex:export --exclude=it` to export only _"en"_ column.

### Example
1. Run `php artisan larex:init` command
2. Edit the *project-root/resources/lang/localization.csv* file

| group | key | en | it |
|---|---|---|---|
| app | hello | Hello | Ciao |
| app | list.developers | Developers | Sviluppatori |
| app | list.teachers | Teachers | Insegnanti |

| group | key | en | it |
| ----- | --------------- | ---------- | ------------ |
| app | hello | Hello | Ciao |
| app | list.developers | Developers | Sviluppatori |
| app | list.teachers | Teachers | Insegnanti |

3. Run `php artisan larex:export` command

4. You'll get the following files:

```php
//project-root/resources/lang/en/app.php

Expand All @@ -77,7 +81,9 @@ This step *can be skipped* if package auto-discovery is enabled.
'teachers' => 'Teachers',
]
];
```

```php
//project-root/resources/lang/it/app.php

<?php
Expand All @@ -92,12 +98,15 @@ This step *can be skipped* if package auto-discovery is enabled.
```

## Testing

```bash
composer test
```

## Changelog

Please see the [CHANGELOG.md](https://github.com/Lukasss93/laravel-larex/blob/master/CHANGELOG.md) for more information on what has changed recently.

## License

Please see the [LICENSE.md](https://github.com/Lukasss93/laravel-larex/blob/master/LICENSE.md) file for more information.

0 comments on commit d058569

Please sign in to comment.