diff --git a/.flowconfig b/.flowconfig index bd4c0cf1e..25b1dc330 100644 --- a/.flowconfig +++ b/.flowconfig @@ -16,7 +16,7 @@ ; Ignore packages in node_modules which we (i.e. the jitsi-meet project) have ; seen to cause errors and we have chosen not to fix. -.*/node_modules/babel-core/.* +.*/node_modules/babel-.* .*/node_modules/bower/.* .*/node_modules/jsonlint/.* .*/node_modules/promise/index.js.flow diff --git a/react/features/base/i18n/constants.js b/react/features/base/i18n/constants.js deleted file mode 100644 index a5e692b72..000000000 --- a/react/features/base/i18n/constants.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * The available/supported languages. - * - * XXX The element at index zero is the default language. - * - * @public - * @type {Array} - */ -export const LANGUAGES = [ - 'en', // XXX The default language. - - 'bg', - 'de', - 'es', - 'fr', - 'hy', - 'it', - 'oc', - 'pl', - 'ptBR', - 'ru', - 'sk', - 'sl', - 'sv', - 'tr' -]; - -/** - * The default language. - * - * XXX The element at index zero of {@link LANGUAGES} is the default language. - * - * @public - * @type {string} The default language. - */ -export const DEFAULT_LANGUAGE = LANGUAGES[0]; diff --git a/react/features/base/i18n/i18next.js b/react/features/base/i18n/i18next.js index 780949446..bf86eedd3 100644 --- a/react/features/base/i18n/i18next.js +++ b/react/features/base/i18n/i18next.js @@ -4,11 +4,30 @@ import I18nextXHRBackend from 'i18next-xhr-backend'; import LANGUAGES_RESOURCES from '../../../../lang/languages.json'; import MAIN_RESOURCES from '../../../../lang/main.json'; -import { DEFAULT_LANGUAGE, LANGUAGES } from './constants'; import languageDetector from './languageDetector'; declare var interfaceConfig: Object; +/** + * The available/supported languages. + * + * XXX The element at index zero is the default language. + * + * @public + * @type {Array} + */ +export const LANGUAGES = Object.keys(LANGUAGES_RESOURCES); + +/** + * The default language. + * + * XXX The element at index zero of {@link LANGUAGES} is the default language. + * + * @public + * @type {string} The default language. + */ +export const DEFAULT_LANGUAGE = LANGUAGES[0]; + /** * The options to initialize i18next with. * diff --git a/react/features/base/i18n/index.js b/react/features/base/i18n/index.js index 49b25f87a..e74374c7e 100644 --- a/react/features/base/i18n/index.js +++ b/react/features/base/i18n/index.js @@ -1,8 +1,8 @@ -export * from './constants'; + export * from './functions'; // TODO Eventually (e.g. when the non-React Web app is rewritten into React), it // should not be necessary to export i18next. -export { default as i18next } from './i18next'; +export { default as i18next, DEFAULT_LANGUAGE, LANGUAGES } from './i18next'; import './middleware';