Skip to content

Commit

Permalink
fix: add Instruction in README file for usage of localization
Browse files Browse the repository at this point in the history
  • Loading branch information
uluumbch committed Jul 31, 2024
1 parent 71b0f0a commit 1fcd6d3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,27 @@ Additionally, you can also pass [any property that the Filepond component accept
<x-filepond::upload wire:model="file" max-files="5" />
```

Localization automatically works based on the current locale. If you want to customize the language, you can publish the language file using:

```bash
php artisan vendor:publish --tag="livewire-filepond-translations"
```

If you want to change your locale you can do so by change the `.env` file:

```env
APP_LOCALE=id # change to Indonesian for example
```

or by setting the locale using laravel's `App` facade:

```php
use Illuminate\Support\Facades\App;

App::setLocale('id'); // change to Indonesian for example
```
The last method can be used to change the locale on the fly. Like when a user changes the language (You need to implement this yourself).

## Publishing assets

Livewire Filepond automatically loads the scripts through an endpoint. If you want to serve the assets directly, you can publish them:
Expand Down

0 comments on commit 1fcd6d3

Please sign in to comment.