diff --git a/src/3.x/package-development.md b/src/3.x/package-development.md index ffac21d..13d99d1 100644 --- a/src/3.x/package-development.md +++ b/src/3.x/package-development.md @@ -124,4 +124,17 @@ return redirect('/')->with(['notification' => [ ]]); ``` -By default, there are 4 types: `info`, `success`, `warning`, and `error`. The style differences are defined in the [frontend config](https://github.com/rapidez/core/blob/master/config/rapidez/frontend.php), everything else is in the [Blade template](https://github.com/rapidez/core/blob/master/resources/views/components/notifications.blade.php). \ No newline at end of file +By default, there are 4 types: `info`, `success`, `warning`, and `error`. The style differences are defined in the [frontend config](https://github.com/rapidez/core/blob/master/config/rapidez/frontend.php), everything else is in the [Blade template](https://github.com/rapidez/core/blob/master/resources/views/components/notifications.blade.php). + +## Frontend translations +Rapidez adds some [frontend translations](theming.md#translations) by default. Your package might need to have some translations within Javascript. If you register a frontend.php translations file within a rapidez namespace, it wil automaticly be included in the frontend translations. + +```php +$this->loadTranslationsFrom(__DIR__ . '/../lang', 'rapidez-statamic'); +``` + +You can use them by referencing it by package name. For example within the [Rapidez Statamic](https://github.com/rapidez/statamic) package: + +```js +window.config.translations.packages.statamic +``` \ No newline at end of file