From 7e8488bc669975e671ef13d278fbe3d52228ed13 Mon Sep 17 00:00:00 2001 From: Adriano Raiano Date: Sat, 5 Jun 2021 16:23:03 +0200 Subject: [PATCH] example with http-backend --- examples/{ => basic}/app.js | 0 examples/{ => basic}/index.html | 2 +- examples/http-backend/app.js | 92 +++++++++++++++++++ examples/http-backend/index.html | 28 ++++++ .../http-backend/locales/de/translation.json | 8 ++ .../http-backend/locales/en/translation.json | 8 ++ webpack.config.js | 4 +- 7 files changed, 139 insertions(+), 3 deletions(-) rename examples/{ => basic}/app.js (100%) rename examples/{ => basic}/index.html (92%) create mode 100644 examples/http-backend/app.js create mode 100644 examples/http-backend/index.html create mode 100644 examples/http-backend/locales/de/translation.json create mode 100644 examples/http-backend/locales/en/translation.json diff --git a/examples/app.js b/examples/basic/app.js similarity index 100% rename from examples/app.js rename to examples/basic/app.js diff --git a/examples/index.html b/examples/basic/index.html similarity index 92% rename from examples/index.html rename to examples/basic/index.html index 5a33f69..d38f99c 100644 --- a/examples/index.html +++ b/examples/basic/index.html @@ -5,7 +5,7 @@ vue-i18next Example - + + + +
+ +
+ + + diff --git a/examples/http-backend/locales/de/translation.json b/examples/http-backend/locales/de/translation.json new file mode 100644 index 0000000..7af50d5 --- /dev/null +++ b/examples/http-backend/locales/de/translation.json @@ -0,0 +1,8 @@ +{ + "message": { + "hello": "Hallo!! - DE" + }, + "tos": "Nutzungsbedingungen", + "term": "Ich akzeptiere {{0}}. {{1}}", + "loadbundle": "Bundle Laden {{lang}}" +} diff --git a/examples/http-backend/locales/en/translation.json b/examples/http-backend/locales/en/translation.json new file mode 100644 index 0000000..656b130 --- /dev/null +++ b/examples/http-backend/locales/en/translation.json @@ -0,0 +1,8 @@ +{ + "message": { + "hello": "Hello!! - EN" + }, + "tos": "Term of Service", + "term": "I accept {{1}} {{0}}.", + "loadbundle": "Load Bundle {{lang}}" +} diff --git a/webpack.config.js b/webpack.config.js index e101c08..bfc76e2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -31,8 +31,8 @@ module.exports = { devServer: { historyApiFallback: { rewrites: [ - { from: /^\/$/, to: '/examples/index.html' }, - { from: 'app.js', to: '/examples/app.js' }, + { from: /^\/$/, to: '/examples/basic/index.html' }, + { from: 'app.js', to: '/examples/basic/app.js' }, ], }, noInfo: true,