Skip to content

Firefly III: a personal finances manager

Expand config for localisation

James Colee77a1e403f10
diff --git a/config/app.php b/config/app.php
index 1c45157c18..db1afeefea 100644
--- a/config/app.php
+++ b/config/app.php
@@ -78,6 +78,7 @@ return [
// own stuff:
TwigBridge\ServiceProvider::class,
PragmaRX\Google2FALaravel\ServiceProvider::class,
+ Mariuzzo\LaravelJsLocalization\LaravelJsLocalizationServiceProvider::class,
/*
diff --git a/config/localization-js.php b/config/localization-js.php
new file mode 100644
index 0000000000..14d3a4c57e
--- /dev/null
+++ b/config/localization-js.php
@@ -0,0 +1,23 @@
+<?php
+
+return [
+
+ /*
+ * Set the names of files you want to add to generated javascript.
+ * Otherwise all the files will be included.
+ *
+ * 'messages' => [
+ * 'validation',
+ * 'forum/thread',
+ * ],
+ */
+ 'messages' => [
+ 'components',
+ 'list',
+ ],
+
+ /*
+ * The default path to use for the generated javascript.
+ */
+ 'path' => public_path('messages.js'),
+];
diff --git a/webpack.mix.js b/webpack.mix.js
index 72fdbb16d6..657ef38a3c 100644
--- a/webpack.mix.js
+++ b/webpack.mix.js
@@ -11,5 +11,16 @@ let mix = require('laravel-mix');
|
*/
+const WebpackShellPlugin = require('webpack-shell-plugin');
+
+// Add shell command plugin configured to create JavaScript language file
+mix.webpackConfig({
+ plugins:
+ [
+ new WebpackShellPlugin({onBuildStart:['php artisan lang:js resources/assets/js/messages.js --no-lib --quiet'], onBuildEnd:[]})
+ ]
+ });
+
+
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');