@zohodesk/i18n 1.0.0-beta.20 → 1.0.0-beta.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +89 -80
  2. package/es/components/DateTimeDiffFormat.js +2 -1
  3. package/es/components/HOCI18N.js +1 -1
  4. package/es/components/I18N.js +1 -0
  5. package/es/components/PluralFormat.js +1 -1
  6. package/es/components/__tests__/I18N.spec.js +1 -1
  7. package/es/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  8. package/es/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  9. package/es/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  10. package/es/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  11. package/es/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  12. package/es/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  13. package/es/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  14. package/lib/components/DateTimeDiffFormat.js +4 -3
  15. package/lib/components/FormatText.js +2 -2
  16. package/lib/components/HOCI18N.js +3 -3
  17. package/lib/components/I18N.js +3 -2
  18. package/lib/components/I18NProvider.js +2 -2
  19. package/lib/components/PluralFormat.js +3 -3
  20. package/lib/components/UserTimeDiffFormat.js +2 -2
  21. package/lib/components/__tests__/I18N.spec.js +1 -1
  22. package/lib/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  23. package/lib/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  24. package/lib/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  25. package/lib/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  26. package/lib/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  27. package/lib/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  28. package/lib/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  29. package/package.json +29 -29
  30. package/src/I18NContext.js +2 -2
  31. package/src/components/DateTimeDiffFormat.js +256 -256
  32. package/src/components/FormatText.js +14 -14
  33. package/src/components/HOCI18N.js +37 -37
  34. package/src/components/I18N.js +73 -72
  35. package/src/components/I18NProvider.js +110 -110
  36. package/src/components/PluralFormat.js +37 -37
  37. package/src/components/UserTimeDiffFormat.js +97 -97
  38. package/src/components/__tests__/DateTimeDiffFormat.spec.js +618 -618
  39. package/src/components/__tests__/FormatText.spec.js +26 -26
  40. package/src/components/__tests__/HOCI18N.spec.js +33 -33
  41. package/src/components/__tests__/I18N.spec.js +29 -29
  42. package/src/components/__tests__/I18NProvider.spec.js +65 -65
  43. package/src/components/__tests__/PluralFormat.spec.js +27 -27
  44. package/src/components/__tests__/UserTimeDiffFormat.spec.js +1076 -1076
  45. package/src/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  46. package/src/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  47. package/src/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  48. package/src/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  49. package/src/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  50. package/src/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  51. package/src/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  52. package/src/index.js +33 -33
  53. package/src/utils.js +527 -527
package/README.md CHANGED
@@ -1,80 +1,89 @@
1
- # i18n
2
-
3
- # 1.0.0-beta.20
4
-
5
- - Date field issue fixed in UserTimeDiffFormat component
6
-
7
- # 1.0.0-beta.19
8
-
9
- - In this version we have made changes in i18n provider to call user date format function only if the time zone data is available.
10
- # 1.0.0-beta.18
11
-
12
- - Localization feature added and incorporated into getI18NValue Method.
13
-
14
- # 1.0.0-beta.17
15
-
16
- - There was some i18n changes done in live before moving the date format build to live. Since we need these changes we have published it as new version.
17
-
18
- # 1.0.0-beta.16
19
-
20
- - DatePattern and dateTimePattern key has been changed for the date format build.
21
-
22
- # 1.0.0-beta.15.1
23
-
24
- - Zoho security version updated.
25
-
26
- # 1.0.0-beta.15
27
-
28
- - When working on date format build we have published I18n. Also, before moving date format build to master we had a emergency fix that need to be sent, so when publishing I18n we have published the date format changes with the next version.
29
-
30
- # 1.0.0-beta.14
31
-
32
- - Issue fixed in enable current year.
33
-
34
- # 1.0.0-beta.13
35
-
36
- - Issue fixed in due date.
37
-
38
- # 1.0.0-beta.12
39
-
40
- - Issue fixed in date Format Pattern.
41
-
42
- # 1.0.0-beta.11
43
-
44
- - Date Format Changes
45
-
46
- # 1.0.0-beta.10
47
-
48
- - Date Format Issue Fixes
49
-
50
- # 1.0.0-beta.9
51
-
52
- - Date Format Changes
53
-
54
- # 1.0.0-beta.8
55
-
56
- - ES Module Support Changes
57
-
58
- # 1.0.0-beta.7
59
-
60
- - 'userDateFormat' util method - 'others' function fix
61
-
62
- # 1.0.0-beta.6
63
-
64
- - Added new prop 'isNeedTime' for DateTimeDiffFormat Component
65
-
66
- # 1.0.0-beta.5
67
-
68
- - Timezone logic moved to @zohodesk/datetimejs
69
-
70
- # 1.0.0-beta.4
71
-
72
- - Added new prop 'page' for DateTimeDiffFormat Component
73
-
74
- # 1.0.0-beta.3
75
-
76
- - Added support for exact times along with relative times in format() function
77
-
78
- # 1.0.0-beta.0
79
-
80
- - Test Publish
1
+ # i18n
2
+
3
+ # 1.0.0-beta.22
4
+
5
+ - Data test id added for I18N.js
6
+
7
+ # 1.0.0-beta.21
8
+
9
+ - Data test id added for dateTimedifformat.js
10
+
11
+ # 1.0.0-beta.20
12
+
13
+ - Date field issue fixed in UserTimeDiffFormat component
14
+
15
+ # 1.0.0-beta.19
16
+
17
+ - In this version we have made changes in i18n provider to call user date format function only if the time zone data is available.
18
+
19
+ # 1.0.0-beta.18
20
+
21
+ - Localization feature added and incorporated into getI18NValue Method.
22
+
23
+ # 1.0.0-beta.17
24
+
25
+ - There was some i18n changes done in live before moving the date format build to live. Since we need these changes we have published it as new version.
26
+
27
+ # 1.0.0-beta.16
28
+
29
+ - DatePattern and dateTimePattern key has been changed for the date format build.
30
+
31
+ # 1.0.0-beta.15.1
32
+
33
+ - Zoho security version updated.
34
+
35
+ # 1.0.0-beta.15
36
+
37
+ - When working on date format build we have published I18n. Also, before moving date format build to master we had a emergency fix that need to be sent, so when publishing I18n we have published the date format changes with the next version.
38
+
39
+ # 1.0.0-beta.14
40
+
41
+ - Issue fixed in enable current year.
42
+
43
+ # 1.0.0-beta.13
44
+
45
+ - Issue fixed in due date.
46
+
47
+ # 1.0.0-beta.12
48
+
49
+ - Issue fixed in date Format Pattern.
50
+
51
+ # 1.0.0-beta.11
52
+
53
+ - Date Format Changes
54
+
55
+ # 1.0.0-beta.10
56
+
57
+ - Date Format Issue Fixes
58
+
59
+ # 1.0.0-beta.9
60
+
61
+ - Date Format Changes
62
+
63
+ # 1.0.0-beta.8
64
+
65
+ - ES Module Support Changes
66
+
67
+ # 1.0.0-beta.7
68
+
69
+ - 'userDateFormat' util method - 'others' function fix
70
+
71
+ # 1.0.0-beta.6
72
+
73
+ - Added new prop 'isNeedTime' for DateTimeDiffFormat Component
74
+
75
+ # 1.0.0-beta.5
76
+
77
+ - Timezone logic moved to @zohodesk/datetimejs
78
+
79
+ # 1.0.0-beta.4
80
+
81
+ - Added new prop 'page' for DateTimeDiffFormat Component
82
+
83
+ # 1.0.0-beta.3
84
+
85
+ - Added support for exact times along with relative times in format() function
86
+
87
+ # 1.0.0-beta.0
88
+
89
+ - Test Publish
@@ -195,7 +195,8 @@ export default class DateTimeDiffFormat extends React.Component {
195
195
  return text ? /*#__PURE__*/React.createElement("span", {
196
196
  className: className,
197
197
  "data-title": title,
198
- "data-id": dataId
198
+ "data-id": dataId,
199
+ "data-test-id": dataId
199
200
  }, text) : /*#__PURE__*/React.createElement(FormatText, {
200
201
  i18NKey: isSuffixEnable && suffix !== '' ? `${key}.${suffix}` : key,
201
202
  values: values,
@@ -1,4 +1,4 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import React, { Children } from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -44,6 +44,7 @@ export default class I18N extends React.Component {
44
44
 
45
45
  if (this.props.dataId) {
46
46
  props['data-id'] = this.props.dataId;
47
+ props['data-test-id'] = this.props.dataId;
47
48
  }
48
49
 
49
50
  if (this.props.isHtml) {
@@ -1,4 +1,4 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import I18N from '../I18N';
4
4
  import I18NProvider from '../I18NProvider';