diff --git a/frontend/src/global/i18n.ts b/frontend/src/global/i18n.ts index e1700f31..1a8094e1 100644 --- a/frontend/src/global/i18n.ts +++ b/frontend/src/global/i18n.ts @@ -1,8 +1,10 @@ +import { constant } from 'lodash'; import * as i18next from 'i18next'; import * as languageDetector from 'i18next-browser-languagedetector'; import * as english from '../i18n/en/translation.json'; import * as french from '../i18n/fr/translation.json'; +import channel from '../i18n/radio'; const i18nPromise = new Promise(function(resolve, reject) { i18next.use( @@ -26,4 +28,6 @@ const i18nPromise = new Promise(function(resolve, reject) { }); }); +channel.reply('i18next', constant(i18nPromise)); + export { i18nPromise, i18next }; diff --git a/frontend/src/i18n/radio.ts b/frontend/src/i18n/radio.ts new file mode 100644 index 00000000..13829f3a --- /dev/null +++ b/frontend/src/i18n/radio.ts @@ -0,0 +1,5 @@ +import { channel } from 'backbone.radio'; + +export const channelName = 'readit-i18n'; + +export default channel(channelName);