Просмотр исходного кода

Refactor i18n calendar formatter

master
zbettenbuk 7 лет назад
Родитель
Сommit
c86c7beb24

react/features/base/util/dateUtil.js → react/features/base/i18n/dateUtil.js Просмотреть файл

@@ -2,13 +2,11 @@
2 2
 
3 3
 import moment from 'moment';
4 4
 
5
-import { i18next } from '../i18n';
5
+import i18next from './i18next';
6 6
 
7 7
 // MomentJS uses static language bundle loading, so in order to support dynamic
8 8
 // language selection in the app we need to load all bundles that we support in
9 9
 // the app.
10
-// FIXME: If we decide to support MomentJS in other features as well we may need
11
-// to move this import and the lenient matcher to the i18n feature.
12 10
 require('moment/locale/bg');
13 11
 require('moment/locale/de');
14 12
 require('moment/locale/eo');
@@ -32,7 +30,7 @@ require('moment/locale/zh-cn');
32 30
 
33 31
 /**
34 32
  * Returns a localized date formatter initialized with a specific {@code Date}
35
- * or time stamp ({@code number}).
33
+ * or timestamp ({@code number}).
36 34
  *
37 35
  * @private
38 36
  * @param {Date | number} dateOrTimeStamp - The date or unix timestamp (ms)

+ 1
- 1
react/features/base/i18n/index.js Просмотреть файл

@@ -1,4 +1,4 @@
1
-
1
+export * from './dateUtil';
2 2
 export * from './functions';
3 3
 
4 4
 // TODO Eventually (e.g. when the non-React Web app is rewritten into React), it

+ 0
- 1
react/features/base/util/index.js Просмотреть файл

@@ -1,4 +1,3 @@
1
-export * from './dateUtil';
2 1
 export * from './helpers';
3 2
 export * from './loadScript';
4 3
 export * from './randomUtil';

+ 1
- 2
react/features/calendar-sync/components/ConferenceNotification.native.js Просмотреть файл

@@ -9,10 +9,9 @@ import { connect } from 'react-redux';
9 9
 
10 10
 import { appNavigate } from '../../app';
11 11
 import { getURLWithoutParams } from '../../base/connection';
12
-import { translate } from '../../base/i18n';
12
+import { getLocalizedDateFormatter, translate } from '../../base/i18n';
13 13
 import { Icon } from '../../base/font-icons';
14 14
 import { ASPECT_RATIO_NARROW } from '../../base/responsive-ui';
15
-import { getLocalizedDateFormatter } from '../../base/util';
16 15
 
17 16
 import styles from './styles';
18 17
 

+ 1
- 2
react/features/calendar-sync/components/MeetingList.native.js Просмотреть файл

@@ -5,9 +5,8 @@ import { connect } from 'react-redux';
5 5
 import { refreshCalendarEntryList } from '../actions';
6 6
 
7 7
 import { appNavigate } from '../../app';
8
-import { translate } from '../../base/i18n';
8
+import { getLocalizedDateFormatter, translate } from '../../base/i18n';
9 9
 import { NavigateSectionList } from '../../base/react';
10
-import { getLocalizedDateFormatter } from '../../base/util';
11 10
 
12 11
 type Props = {
13 12
 

+ 4
- 4
react/features/recent-list/components/RecentList.native.js Просмотреть файл

@@ -3,13 +3,13 @@ import React, { Component } from 'react';
3 3
 import { connect } from 'react-redux';
4 4
 
5 5
 import { appNavigate } from '../../app';
6
-import { translate } from '../../base/i18n';
7
-import { NavigateSectionList } from '../../base/react';
8 6
 import {
9 7
     getLocalizedDateFormatter,
10 8
     getLocalizedDurationFormatter,
11
-    parseURIString
12
-} from '../../base/util';
9
+    translate
10
+} from '../../base/i18n';
11
+import { NavigateSectionList } from '../../base/react';
12
+import { parseURIString } from '../../base/util';
13 13
 
14 14
 /**
15 15
  * The type of the React {@code Component} props of {@link RecentList}

Загрузка…
Отмена
Сохранить