Uses languages.json to obtain supported languages.

This commit is contained in:
damencho 2017-07-27 10:19:48 -05:00 committed by Дамян Минков
parent 1fae0ee780
commit 9778aabe98
4 changed files with 23 additions and 40 deletions

View File

@ -16,7 +16,7 @@
; Ignore packages in node_modules which we (i.e. the jitsi-meet project) have ; 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. ; seen to cause errors and we have chosen not to fix.
.*/node_modules/babel-core/.* .*/node_modules/babel-.*
.*/node_modules/bower/.* .*/node_modules/bower/.*
.*/node_modules/jsonlint/.* .*/node_modules/jsonlint/.*
.*/node_modules/promise/index.js.flow .*/node_modules/promise/index.js.flow

View File

@ -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];

View File

@ -4,11 +4,30 @@ import I18nextXHRBackend from 'i18next-xhr-backend';
import LANGUAGES_RESOURCES from '../../../../lang/languages.json'; import LANGUAGES_RESOURCES from '../../../../lang/languages.json';
import MAIN_RESOURCES from '../../../../lang/main.json'; import MAIN_RESOURCES from '../../../../lang/main.json';
import { DEFAULT_LANGUAGE, LANGUAGES } from './constants';
import languageDetector from './languageDetector'; import languageDetector from './languageDetector';
declare var interfaceConfig: Object; 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. * The options to initialize i18next with.
* *

View File

@ -1,8 +1,8 @@
export * from './constants';
export * from './functions'; export * from './functions';
// TODO Eventually (e.g. when the non-React Web app is rewritten into React), it // TODO Eventually (e.g. when the non-React Web app is rewritten into React), it
// should not be necessary to export i18next. // should not be necessary to export i18next.
export { default as i18next } from './i18next'; export { default as i18next, DEFAULT_LANGUAGE, LANGUAGES } from './i18next';
import './middleware'; import './middleware';