Skip to content

Commit a142916

Browse files
committed
Translation locations
1 parent 9fcbd90 commit a142916

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/RapidezServiceProvider.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,14 @@ protected function bootPublishables(): self
118118
__DIR__ . '/../resources/views' => resource_path('views/vendor/rapidez'),
119119
], 'views');
120120

121-
$this->publishes([
122-
__DIR__ . '/../lang/vendor/rapidez' => lang_path('vendor/rapidez'),
123-
], 'translations');
121+
// We're so explicit here as otherwise the json translations will also be published.
122+
// That will publish to /lang/vendor/rapidez/nl.json where it will not be loaded
123+
// by default and; you should keep everyting in one place: /lang/nl.json
124+
foreach (['en', 'nl'] as $lang) {
125+
$this->publishes([
126+
__DIR__ . '/../lang/' . $lang . '/frontend.php' => lang_path('vendor/rapidez/' . $lang .'/frontend.php'),
127+
], 'rapidez-translations');
128+
}
124129

125130
$this->publishes([
126131
__DIR__ . '/../resources/payment-icons' => public_path('payment-icons'),
@@ -235,7 +240,7 @@ protected function bootMiddleware(): self
235240

236241
protected function bootTranslations(): self
237242
{
238-
$this->loadTranslationsFrom(__DIR__ . '/../lang/vendor/rapidez', 'rapidez');
243+
$this->loadTranslationsFrom(__DIR__ . '/../lang', 'rapidez');
239244
$this->loadJsonTranslationsFrom(__DIR__ . '/../lang');
240245

241246
return $this;

0 commit comments

Comments
 (0)