Skip to content
This repository was archived by the owner on Aug 7, 2022. It is now read-only.

Commit 65af63b

Browse files
committed
Update README.md
1 parent b6b9b86 commit 65af63b

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,19 @@ composer require luisprmat/laravel-lang-installer --dev
2424

2525
## Usage
2626

27-
After install a new laravel application with `Laravel >= 5.5` the package autodiscover system will register the new command `lang:add`.
27+
### Add new language
28+
After install a new laravel application with `Laravel >= 5.5` the package autodiscover system will register the new command `lang:add` and you can call with
2829

29-
This command can take a unique argument (or none) that will be the short name of the language according to **ISO 15897**.
30+
```bash
31+
php artisan lang:add <locale>
32+
```
33+
where `<locale>` refers to the short name of any of the [supported languages](README.md#supported-languages)
34+
> ### *Warnings*
35+
> - **Add lang** action overwrites the language files so that you already had custom translations you could lose them.
36+
> - When adding a language this package first consults the `composer.json` file to copy only the translations of the supported packages that are installed ([Laravel Breeze](https://laravel.com/docs/8.x/starter-kits#laravel-breeze), [Laravel Cashier](https://laravel.com/docs/8.x/billing), [Laravel Fortify](https://laravel.com/docs/8.x/fortify) and [Laravel Jetstream](https://jetstream.laravel.com/2.x/introduction.html) are supported) `resources/lang/<locale>.json`. So it is good that you first install the supported packages that you will use and then run the command `php artisan lang:add <locale>`
37+
> - If this command does not receive arguments, the Spanish language [`es`] will be installed by default.
3038
31-
If this command does not receive arguments, the Spanish language [`es`] will be installed by default.
39+
This command can take a unique argument (or none) that will be the short name of the language according to **ISO 15897**.
3240

3341
This command also modifies the key `locale` in the `config/app.php` file to set the default language as passed through the parameter.
3442

@@ -63,7 +71,14 @@ php artisan lang:add pt_BR --no-default
6371
php artisan lang:add ar --inline
6472
```
6573

66-
74+
## Supported languages
75+
`af`, `ar`, `az`, `be`, `bg`, `bn`, `bs`, `ca`, `cs`, `cy`, `da`, `de`, `de_CH`
76+
, `el`, `es`, `et`, `eu`, `fa`, `fi`, `fil`, `fr`, `gl`, `he`, `hi`, `hr`, `hu`,
77+
`hy`, `id`, `is`, `it`, `ja`, `ka`, `kk`, `km`, `kn`, `ko`, `lt`, `lv`, `mk`, `
78+
mn`, `mr`, `ms`, `nb`, `ne`, `nl`, `nn`, `oc`, `pl`, `ps`, `pt`, `pt_BR`, `ro`,
79+
`ru`, `sc`, `si`, `sk`, `sl`, `sq`, `sr_Cyrl`, `sr_Latn`, `sr_Latn_ME`, `sv`, `s
80+
w`, `tg`, `th`, `tk`, `tl`, `tr`, `ug`, `uk`, `ur`, `uz_Cyrl`, `uz_Latn`, `vi`,
81+
`zh_CN`, `zh_HK`, `zh_TW`
6782

6883
## Contributing
6984
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
@@ -72,3 +87,8 @@ This package does not modify the translations, only copies them from [`laravel-l
7287

7388
## License
7489
[MIT](LICENSE.md)
90+
91+
## Todo
92+
93+
- [ ] Allow merge translations instead of overwrite them.
94+
- [ ] Add Command `lang:update` to update translations and detect new installed packages to update their translations.

0 commit comments

Comments
 (0)