From 65df4c3a3383c8ee02aa0cd0940a705ddd08ca16 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 11 Jun 2015 18:45:31 +0930 Subject: [PATCH] Add English locale template to extension stub --- framework/core/stubs/extension/locale/en.yml | 2 ++ .../core/stubs/extension/src/ServiceProvider.php | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 framework/core/stubs/extension/locale/en.yml diff --git a/framework/core/stubs/extension/locale/en.yml b/framework/core/stubs/extension/locale/en.yml new file mode 100644 index 000000000..7d28ca184 --- /dev/null +++ b/framework/core/stubs/extension/locale/en.yml @@ -0,0 +1,2 @@ +{{name}}: + # hello_world: Hello, world! diff --git a/framework/core/stubs/extension/src/ServiceProvider.php b/framework/core/stubs/extension/src/ServiceProvider.php index 5b11546d8..e62608409 100644 --- a/framework/core/stubs/extension/src/ServiceProvider.php +++ b/framework/core/stubs/extension/src/ServiceProvider.php @@ -2,6 +2,8 @@ use Flarum\Support\ServiceProvider; use Flarum\Extend\ForumAssets; +use Flarum\Extend\Locale; +use Flarum\Extend\ForumTranslations; class {{classPrefix}}ServiceProvider extends ServiceProvider { @@ -16,7 +18,14 @@ class {{classPrefix}}ServiceProvider extends ServiceProvider new ForumAssets([ __DIR__.'/../js/dist/extension.js', __DIR__.'/../less/extension.less' - ]) + ]), + + (new Locale('en'))->translations(__DIR__.'/../locale/en.yml'), + + new ForumTranslations([ + // Add the keys of translations you would like to be available + // for use by the JS client application. + ]), ); }