Uses languages.json to obtain supported languages.
This commit is contained in:
parent
1fae0ee780
commit
9778aabe98
|
@ -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
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
/**
|
||||
* The available/supported languages.
|
||||
*
|
||||
* XXX The element at index zero is the default language.
|
||||
*
|
||||
* @public
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
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];
|
|
@ -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<string>}
|
||||
*/
|
||||
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.
|
||||
*
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue