Преглед изворни кода

Uses languages.json to obtain supported languages.

master
damencho пре 8 година
родитељ
комит
9778aabe98

+ 1
- 1
.flowconfig Прегледај датотеку

@@ -16,7 +16,7 @@
16 16
 
17 17
 ; Ignore packages in node_modules which we (i.e. the jitsi-meet project) have
18 18
 ; seen to cause errors and we have chosen not to fix.
19
-.*/node_modules/babel-core/.*
19
+.*/node_modules/babel-.*
20 20
 .*/node_modules/bower/.*
21 21
 .*/node_modules/jsonlint/.*
22 22
 .*/node_modules/promise/index.js.flow

+ 0
- 36
react/features/base/i18n/constants.js Прегледај датотеку

@@ -1,36 +0,0 @@
1
-/**
2
- * The available/supported languages.
3
- *
4
- * XXX The element at index zero is the default language.
5
- *
6
- * @public
7
- * @type {Array<string>}
8
- */
9
-export const LANGUAGES = [
10
-    'en', // XXX The default language.
11
-
12
-    'bg',
13
-    'de',
14
-    'es',
15
-    'fr',
16
-    'hy',
17
-    'it',
18
-    'oc',
19
-    'pl',
20
-    'ptBR',
21
-    'ru',
22
-    'sk',
23
-    'sl',
24
-    'sv',
25
-    'tr'
26
-];
27
-
28
-/**
29
- * The default language.
30
- *
31
- * XXX The element at index zero of {@link LANGUAGES} is the default language.
32
- *
33
- * @public
34
- * @type {string} The default language.
35
- */
36
-export const DEFAULT_LANGUAGE = LANGUAGES[0];

+ 20
- 1
react/features/base/i18n/i18next.js Прегледај датотеку

@@ -4,11 +4,30 @@ import I18nextXHRBackend from 'i18next-xhr-backend';
4 4
 import LANGUAGES_RESOURCES from '../../../../lang/languages.json';
5 5
 import MAIN_RESOURCES from '../../../../lang/main.json';
6 6
 
7
-import { DEFAULT_LANGUAGE, LANGUAGES } from './constants';
8 7
 import languageDetector from './languageDetector';
9 8
 
10 9
 declare var interfaceConfig: Object;
11 10
 
11
+/**
12
+ * The available/supported languages.
13
+ *
14
+ * XXX The element at index zero is the default language.
15
+ *
16
+ * @public
17
+ * @type {Array<string>}
18
+ */
19
+export const LANGUAGES = Object.keys(LANGUAGES_RESOURCES);
20
+
21
+/**
22
+ * The default language.
23
+ *
24
+ * XXX The element at index zero of {@link LANGUAGES} is the default language.
25
+ *
26
+ * @public
27
+ * @type {string} The default language.
28
+ */
29
+export const DEFAULT_LANGUAGE = LANGUAGES[0];
30
+
12 31
 /**
13 32
  * The options to initialize i18next with.
14 33
  *

+ 2
- 2
react/features/base/i18n/index.js Прегледај датотеку

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

Loading…
Откажи
Сачувај