Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
Adds react-i18next and its provider to react.
damenchoe3d4152e32a1
diff --git a/package.json b/package.jsonindex cb475b7aec..9d7e0840d0 100644--- a/package.json+++ b/package.json@@ -35,6 +35,7 @@"postis": "^2.2.0","react": "15.4.2","react-dom": "15.4.2",+ "react-i18next": "2.2.0","react-native": "0.41.2","react-native-background-timer": "1.0.0","react-native-immersive": "0.0.4",diff --git a/react/features/app/components/AbstractApp.js b/react/features/app/components/AbstractApp.jsindex 6fbd2c3ef4..fc2791b4ce 100644--- a/react/features/app/components/AbstractApp.js+++ b/react/features/app/components/AbstractApp.js@@ -5,6 +5,9 @@ import { Provider } from 'react-redux';import { compose, createStore } from 'redux';import Thunk from 'redux-thunk';+import { I18nextProvider } from 'react-i18next';+import { i18n } from '../../base/translation';+import {localParticipantJoined,localParticipantLeft@@ -134,11 +137,13 @@ export class AbstractApp extends Component {if (route) {return (- <Provider store = { this._getStore() }>- {- this._createElement(route.component)- }- </Provider>+ <I18nextProvider i18n = { i18n }>+ <Provider store = { this._getStore() }>+ {+ this._createElement(route.component)+ }+ </Provider>+ </I18nextProvider>);}diff --git a/react/features/base/translation/functions.js b/react/features/base/translation/functions.jsnew file mode 100644index 0000000000..25bee46068--- /dev/null+++ b/react/features/base/translation/functions.js@@ -0,0 +1,12 @@+import { translate as reactTranslate } from 'react-i18next';++/**+ * Wrap a translatable component.+ *+ * @param {Component} component - the component to wrap+ * @returns {Component} the wrapped component.+ */+export function translate(component) {+ // use the default list of namespaces+ return reactTranslate([ 'main', 'languages' ], { wait: true })(component);+}diff --git a/react/features/base/translation/index.js b/react/features/base/translation/index.jsindex 2bab553a8e..b3517eb353 100644--- a/react/features/base/translation/index.js+++ b/react/features/base/translation/index.js@@ -1,2 +1,3 @@export { default as i18n } from './Translation';export * from './constants';+export * from './functions';