瀏覽代碼

Refactor i18n calendar formatter

master
zbettenbuk 7 年之前
父節點
當前提交
c86c7beb24

react/features/base/util/dateUtil.js → react/features/base/i18n/dateUtil.js 查看文件

2
 
2
 
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 
4
 
5
-import { i18next } from '../i18n';
5
+import i18next from './i18next';
6
 
6
 
7
 // MomentJS uses static language bundle loading, so in order to support dynamic
7
 // MomentJS uses static language bundle loading, so in order to support dynamic
8
 // language selection in the app we need to load all bundles that we support in
8
 // language selection in the app we need to load all bundles that we support in
9
 // the app.
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
 require('moment/locale/bg');
10
 require('moment/locale/bg');
13
 require('moment/locale/de');
11
 require('moment/locale/de');
14
 require('moment/locale/eo');
12
 require('moment/locale/eo');
32
 
30
 
33
 /**
31
 /**
34
  * Returns a localized date formatter initialized with a specific {@code Date}
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
  * @private
35
  * @private
38
  * @param {Date | number} dateOrTimeStamp - The date or unix timestamp (ms)
36
  * @param {Date | number} dateOrTimeStamp - The date or unix timestamp (ms)

+ 1
- 1
react/features/base/i18n/index.js 查看文件

1
-
1
+export * from './dateUtil';
2
 export * from './functions';
2
 export * from './functions';
3
 
3
 
4
 // TODO Eventually (e.g. when the non-React Web app is rewritten into React), it
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
-export * from './dateUtil';
2
 export * from './helpers';
1
 export * from './helpers';
3
 export * from './loadScript';
2
 export * from './loadScript';
4
 export * from './randomUtil';
3
 export * from './randomUtil';

+ 1
- 2
react/features/calendar-sync/components/ConferenceNotification.native.js 查看文件

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

+ 1
- 2
react/features/calendar-sync/components/MeetingList.native.js 查看文件

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

+ 4
- 4
react/features/recent-list/components/RecentList.native.js 查看文件

3
 import { connect } from 'react-redux';
3
 import { connect } from 'react-redux';
4
 
4
 
5
 import { appNavigate } from '../../app';
5
 import { appNavigate } from '../../app';
6
-import { translate } from '../../base/i18n';
7
-import { NavigateSectionList } from '../../base/react';
8
 import {
6
 import {
9
     getLocalizedDateFormatter,
7
     getLocalizedDateFormatter,
10
     getLocalizedDurationFormatter,
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
  * The type of the React {@code Component} props of {@link RecentList}
15
  * The type of the React {@code Component} props of {@link RecentList}

Loading…
取消
儲存