Skip to content

Commit

Permalink
replace xhr backend with new http backend
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Apr 14, 2020
1 parent 2252592 commit 84b2130
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion example/razzle-ssr/package.json
Expand Up @@ -18,6 +18,6 @@
"i18next-browser-languagedetector": "3.0.0",
"i18next-express-middleware": "1.7.1",
"i18next-node-fs-backend": "2.1.1",
"i18next-xhr-backend": "2.0.0"
"i18next-http-backend": "1.0.0"
}
}
8 changes: 4 additions & 4 deletions example/razzle-ssr/src/i18n.js
@@ -1,6 +1,6 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import XHR from 'i18next-xhr-backend';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';

const options = {
Expand All @@ -24,12 +24,12 @@ const options = {
wait: process && !process.release,
};

// for browser use xhr backend to load translations and browser lng detector
// for browser use http backend to load translations and browser lng detector
if (process && !process.release) {
i18n
.use(XHR)
.use(Backend)
.use(initReactI18next)
.use(LanguageDetector)
.use(LanguageDetector);
}

// initialize if not already initialized
Expand Down
2 changes: 1 addition & 1 deletion example/react-icu/package.json
Expand Up @@ -9,7 +9,7 @@
"i18next": "^19.3.3",
"i18next-browser-languagedetector": "^4.0.2",
"i18next-icu": "^1.3.0",
"i18next-xhr-backend": "^3.2.2",
"i18next-http-backend": "1.0.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-i18next": "^11.3.4",
Expand Down
2 changes: 1 addition & 1 deletion example/react-icu/src/i18n.js
@@ -1,5 +1,5 @@
import i18n from 'i18next';
import Backend from 'i18next-xhr-backend';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';

Expand Down
4 changes: 2 additions & 2 deletions example/react/package.json
Expand Up @@ -3,9 +3,9 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"i18next": "19.3.4",
"i18next": "19.4.1",
"i18next-browser-languagedetector": "4.0.2",
"i18next-xhr-backend": "3.2.2",
"i18next-http-backend": "1.0.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-i18next": "11.3.4",
Expand Down
6 changes: 3 additions & 3 deletions example/react/src/i18n.js
@@ -1,11 +1,11 @@
import i18n from 'i18next';
import Backend from 'i18next-xhr-backend';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';

i18n
// load translation using xhr -> see /public/locales
// learn more: https://github.com/i18next/i18next-xhr-backend
// load translation using http -> see /public/locales
// learn more: https://github.com/i18next/i18next-http-backend
.use(Backend)
// detect user language
// learn more: https://github.com/i18next/i18next-browser-languageDetector
Expand Down
2 changes: 1 addition & 1 deletion example/storybook/package.json
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"i18next": "^15.0.7",
"i18next-browser-languagedetector": "3.0.0",
"i18next-xhr-backend": "2.0.0",
"i18next-http-backend": "1.0.0",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-i18next": "^10.5.2",
Expand Down
6 changes: 3 additions & 3 deletions example/storybook/src/i18n.js
@@ -1,11 +1,11 @@
import i18n from 'i18next';
import Backend from 'i18next-xhr-backend';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';

i18n
// load translation using xhr -> see /public/locales
// learn more: https://github.com/i18next/i18next-xhr-backend
// load translation using http -> see /public/locales
// learn more: https://github.com/i18next/i18next-http-backend
.use(Backend)
// detect user language
// learn more: https://github.com/i18next/i18next-browser-languageDetector
Expand Down
2 changes: 1 addition & 1 deletion example/test-jest/package.json
Expand Up @@ -7,7 +7,7 @@
"enzyme-adapter-react-16": "^1.1.1",
"i18next": "14.1.1",
"i18next-browser-languagedetector": "2.2.4",
"i18next-xhr-backend": "1.5.1",
"i18next-http-backend": "1.0.0",
"raf": "3.4.1",
"react": "16.8.1",
"react-dom": "16.8.1",
Expand Down
2 changes: 1 addition & 1 deletion example/test-jest/src/i18n.js
@@ -1,5 +1,5 @@
import i18n from 'i18next';
import Backend from 'i18next-xhr-backend';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';

Expand Down
2 changes: 1 addition & 1 deletion example/v9.x.x/dat/package.json
Expand Up @@ -6,7 +6,7 @@
"i18next": "8.4.2",
"i18next-browser-languagedetector": "2.0.0",
"i18next-locize-backend": "1.0.0",
"i18next-xhr-backend": "1.4.2",
"i18next-http-backend": "1.0.0",
"react": "15.6.1",
"react-dom": "15.6.1",
"react-i18next": "4.6.1",
Expand Down
4 changes: 2 additions & 2 deletions example/v9.x.x/dat/src/i18n.js
@@ -1,6 +1,6 @@
import i18n from 'i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import XHR from 'i18next-xhr-backend';
import Backend from 'i18next-http-backend';
import LocizeBackend from 'i18next-locize-backend';
import whichBackend from './whichBackend';

Expand Down Expand Up @@ -38,7 +38,7 @@ switch (whichBackend()) {
options.backend = {
loadPath: '/locales/{{lng}}/{{ns}}.json',
};
i18n.use(XHR);
i18n.use(Backend);
break;

case 'memory':
Expand Down
2 changes: 1 addition & 1 deletion example/v9.x.x/preact/package.json
Expand Up @@ -6,7 +6,7 @@
"@just-boris/preact-scripts": "1.0.7",
"i18next": "8.4.3",
"i18next-browser-languagedetector": "2.0.0",
"i18next-xhr-backend": "1.4.2",
"i18next-http-backend": "1.0.0",
"preact": "8.2.1",
"preact-compat": "3.16.0",
"react-i18next": "8.0.6"
Expand Down
2 changes: 1 addition & 1 deletion example/v9.x.x/preact/src/i18n.js
@@ -1,5 +1,5 @@
import i18n from 'i18next';
import Backend from 'i18next-xhr-backend';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { reactI18nextModule } from 'react-i18next';

Expand Down
2 changes: 1 addition & 1 deletion example/v9.x.x/razzle-ssr/package.json
Expand Up @@ -27,6 +27,6 @@
"i18next-browser-languagedetector": "2.2.2",
"i18next-express-middleware": "1.2.0",
"i18next-node-fs-backend": "1.2.1",
"i18next-xhr-backend": "1.5.1"
"i18next-http-backend": "1.0.0"
}
}
6 changes: 3 additions & 3 deletions example/v9.x.x/razzle-ssr/src/i18n.js
@@ -1,5 +1,5 @@
const i18n = require('i18next');
const XHR = require('i18next-xhr-backend');
const Backend = require('i18next-http-backend');
const LanguageDetector = require('i18next-browser-languagedetector');

const options = {
Expand Down Expand Up @@ -28,10 +28,10 @@ const options = {
wait: process && !process.release,
};

// for browser use xhr backend to load translations and browser lng detector
// for browser use http backend to load translations and browser lng detector
if (process && !process.release) {
i18n
.use(XHR)
.use(Backend)
// .use(Cache)
.use(LanguageDetector);
}
Expand Down
2 changes: 1 addition & 1 deletion example/v9.x.x/react-icu/package.json
Expand Up @@ -6,7 +6,7 @@
"i18next": "11.2.2",
"i18next-browser-languagedetector": "2.1.0",
"i18next-icu": "0.3.0",
"i18next-xhr-backend": "1.5.0",
"i18next-http-backend": "1.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-i18next": "8.0.6",
Expand Down
2 changes: 1 addition & 1 deletion example/v9.x.x/react-icu/src/i18n.js
@@ -1,5 +1,5 @@
import i18n from 'i18next';
import Backend from 'i18next-xhr-backend';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { reactI18nextModule } from 'react-i18next';

Expand Down
2 changes: 1 addition & 1 deletion example/v9.x.x/react/package.json
Expand Up @@ -6,7 +6,7 @@
"i18next": "13.1.5",
"i18next-browser-languagedetector": "2.2.4",
"i18next-locize-backend": "^1.7.1",
"i18next-xhr-backend": "1.5.1",
"i18next-http-backend": "1.0.0",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-i18next": "9.0.6",
Expand Down
6 changes: 3 additions & 3 deletions example/v9.x.x/react/src/i18n.js
@@ -1,11 +1,11 @@
import i18n from 'i18next';
import Backend from 'i18next-xhr-backend';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { reactI18nextModule } from 'react-i18next';

i18n
// load translation using xhr -> see /public/locales
// learn more: https://github.com/i18next/i18next-xhr-backend
// load translation using http -> see /public/locales
// learn more: https://github.com/i18next/i18next-http-backend
.use(Backend)
// detect user language
// learn more: https://github.com/i18next/i18next-browser-languageDetector
Expand Down
2 changes: 1 addition & 1 deletion example/v9.x.x/test-jest/package.json
Expand Up @@ -7,7 +7,7 @@
"enzyme-adapter-react-16": "^1.1.1",
"i18next": "11.3.2",
"i18next-browser-languagedetector": "2.2.0",
"i18next-xhr-backend": "1.5.1",
"i18next-http-backend": "1.0.0",
"raf": "3.4.0",
"react": "16.3.2",
"react-dom": "16.3.2",
Expand Down
2 changes: 1 addition & 1 deletion example/v9.x.x/test-jest/src/i18n.js
@@ -1,5 +1,5 @@
import i18n from 'i18next';
import Backend from 'i18next-xhr-backend';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { reactI18nextModule } from 'react-i18next';

Expand Down

0 comments on commit 84b2130

Please sign in to comment.