@aws-amplify/core 6.0.1-console-preview.0bbe168.0 → 6.0.1-console-preview.4b7d177.0
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.
- package/lib/I18n/I18n.d.ts +2 -18
- package/lib/I18n/I18n.js +5 -20
- package/lib/I18n/index.d.ts +2 -14
- package/lib/I18n/index.js +0 -12
- package/lib/I18n/types.d.ts +1 -4
- package/lib/I18n/types.js +5 -8
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/singleton/types.d.ts +2 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/I18n/I18n.d.ts +2 -18
- package/lib-esm/I18n/I18n.js +5 -20
- package/lib-esm/I18n/index.d.ts +2 -14
- package/lib-esm/I18n/index.js +0 -12
- package/lib-esm/I18n/types.d.ts +1 -4
- package/lib-esm/I18n/types.js +4 -7
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/singleton/types.d.ts +2 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/I18n/I18n.ts +4 -20
- package/src/I18n/index.ts +2 -14
- package/src/I18n/types.ts +1 -4
- package/src/Platform/version.ts +1 -1
- package/src/singleton/types.ts +2 -1
package/lib-esm/I18n/I18n.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I18nConfig } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Language translation utility.
|
|
4
|
-
*
|
|
5
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
6
4
|
*/
|
|
7
5
|
export declare class I18n {
|
|
8
6
|
/**
|
|
9
7
|
* @private
|
|
10
8
|
*/
|
|
11
|
-
_options:
|
|
9
|
+
_options: I18nConfig | null;
|
|
12
10
|
/**
|
|
13
11
|
* @private
|
|
14
12
|
*/
|
|
@@ -21,22 +19,16 @@ export declare class I18n {
|
|
|
21
19
|
* @constructor
|
|
22
20
|
* Initialize with configurations
|
|
23
21
|
* @param {Object} options
|
|
24
|
-
*
|
|
25
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
26
22
|
*/
|
|
27
23
|
constructor();
|
|
28
24
|
/**
|
|
29
25
|
* Sets the default language from the configuration when required.
|
|
30
|
-
*
|
|
31
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
32
26
|
*/
|
|
33
27
|
setDefaultLanguage(): void;
|
|
34
28
|
/**
|
|
35
29
|
* @method
|
|
36
30
|
* Explicitly setting language
|
|
37
31
|
* @param {String} lang
|
|
38
|
-
*
|
|
39
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
40
32
|
*/
|
|
41
33
|
setLanguage(lang: string): void;
|
|
42
34
|
/**
|
|
@@ -44,8 +36,6 @@ export declare class I18n {
|
|
|
44
36
|
* Get value
|
|
45
37
|
* @param {String} key
|
|
46
38
|
* @param {String} defVal - Default value
|
|
47
|
-
*
|
|
48
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
49
39
|
*/
|
|
50
40
|
get(key: string, defVal?: string | undefined): any;
|
|
51
41
|
/**
|
|
@@ -54,8 +44,6 @@ export declare class I18n {
|
|
|
54
44
|
* @param {String} key
|
|
55
45
|
* @param {String} language - Specified langurage to be used
|
|
56
46
|
* @param {String} defVal - Default value
|
|
57
|
-
*
|
|
58
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
59
47
|
*/
|
|
60
48
|
getByLanguage(key: string, language: string, defVal?: string | null): any;
|
|
61
49
|
/**
|
|
@@ -63,8 +51,6 @@ export declare class I18n {
|
|
|
63
51
|
* Add vocabularies for one language
|
|
64
52
|
* @param {String} language - Language of the dictionary
|
|
65
53
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
66
|
-
*
|
|
67
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
68
54
|
*/
|
|
69
55
|
putVocabulariesForLanguage(language: string, vocabularies: Record<string, any>): void;
|
|
70
56
|
/**
|
|
@@ -72,8 +58,6 @@ export declare class I18n {
|
|
|
72
58
|
* Add vocabularies for one language
|
|
73
59
|
* @param {Object} vocabularies - Object that has language as key,
|
|
74
60
|
* vocabularies of each language as value
|
|
75
|
-
*
|
|
76
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
77
61
|
*/
|
|
78
62
|
putVocabularies(vocabularies: Record<string, any>): void;
|
|
79
63
|
}
|
package/lib-esm/I18n/I18n.js
CHANGED
|
@@ -12,19 +12,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
return __assign.apply(this, arguments);
|
|
13
13
|
};
|
|
14
14
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
15
|
+
import { Amplify } from '../singleton';
|
|
15
16
|
var logger = new Logger('I18n');
|
|
16
17
|
/**
|
|
17
18
|
* Language translation utility.
|
|
18
|
-
*
|
|
19
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
20
19
|
*/
|
|
21
20
|
var I18n = /** @class */ (function () {
|
|
22
21
|
/**
|
|
23
22
|
* @constructor
|
|
24
23
|
* Initialize with configurations
|
|
25
24
|
* @param {Object} options
|
|
26
|
-
*
|
|
27
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
28
25
|
*/
|
|
29
26
|
function I18n() {
|
|
30
27
|
/**
|
|
@@ -42,14 +39,12 @@ var I18n = /** @class */ (function () {
|
|
|
42
39
|
}
|
|
43
40
|
/**
|
|
44
41
|
* Sets the default language from the configuration when required.
|
|
45
|
-
*
|
|
46
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
47
42
|
*/
|
|
48
43
|
I18n.prototype.setDefaultLanguage = function () {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
this._lang = i18nConfig
|
|
52
|
-
}
|
|
44
|
+
if (!this._lang) {
|
|
45
|
+
var i18nConfig = Amplify.getConfig().I18n;
|
|
46
|
+
this._lang = i18nConfig === null || i18nConfig === void 0 ? void 0 : i18nConfig.language;
|
|
47
|
+
}
|
|
53
48
|
// Default to window language if not set in config
|
|
54
49
|
if (!this._lang &&
|
|
55
50
|
typeof window !== 'undefined' &&
|
|
@@ -63,8 +58,6 @@ var I18n = /** @class */ (function () {
|
|
|
63
58
|
* @method
|
|
64
59
|
* Explicitly setting language
|
|
65
60
|
* @param {String} lang
|
|
66
|
-
*
|
|
67
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
68
61
|
*/
|
|
69
62
|
I18n.prototype.setLanguage = function (lang) {
|
|
70
63
|
this._lang = lang;
|
|
@@ -74,8 +67,6 @@ var I18n = /** @class */ (function () {
|
|
|
74
67
|
* Get value
|
|
75
68
|
* @param {String} key
|
|
76
69
|
* @param {String} defVal - Default value
|
|
77
|
-
*
|
|
78
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
79
70
|
*/
|
|
80
71
|
I18n.prototype.get = function (key, defVal) {
|
|
81
72
|
if (defVal === void 0) { defVal = undefined; }
|
|
@@ -101,8 +92,6 @@ var I18n = /** @class */ (function () {
|
|
|
101
92
|
* @param {String} key
|
|
102
93
|
* @param {String} language - Specified langurage to be used
|
|
103
94
|
* @param {String} defVal - Default value
|
|
104
|
-
*
|
|
105
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
106
95
|
*/
|
|
107
96
|
I18n.prototype.getByLanguage = function (key, language, defVal) {
|
|
108
97
|
if (defVal === void 0) { defVal = null; }
|
|
@@ -120,8 +109,6 @@ var I18n = /** @class */ (function () {
|
|
|
120
109
|
* Add vocabularies for one language
|
|
121
110
|
* @param {String} language - Language of the dictionary
|
|
122
111
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
123
|
-
*
|
|
124
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
125
112
|
*/
|
|
126
113
|
I18n.prototype.putVocabulariesForLanguage = function (language, vocabularies) {
|
|
127
114
|
var lang_dict = this._dict[language];
|
|
@@ -135,8 +122,6 @@ var I18n = /** @class */ (function () {
|
|
|
135
122
|
* Add vocabularies for one language
|
|
136
123
|
* @param {Object} vocabularies - Object that has language as key,
|
|
137
124
|
* vocabularies of each language as value
|
|
138
|
-
*
|
|
139
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
140
125
|
*/
|
|
141
126
|
I18n.prototype.putVocabularies = function (vocabularies) {
|
|
142
127
|
var _this = this;
|
package/lib-esm/I18n/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I18nConfig } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Export I18n APIs
|
|
4
|
-
*
|
|
5
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
6
4
|
*/
|
|
7
5
|
export declare class I18n {
|
|
8
6
|
/**
|
|
@@ -11,22 +9,18 @@ export declare class I18n {
|
|
|
11
9
|
* Configure I18n part
|
|
12
10
|
* @param {Object} config - Configuration of the I18n
|
|
13
11
|
*/
|
|
14
|
-
static configure(config: Record<string, any>):
|
|
12
|
+
static configure(config: Record<string, any>): I18nConfig;
|
|
15
13
|
static getModuleName(): string;
|
|
16
14
|
/**
|
|
17
15
|
* @static
|
|
18
16
|
* @method
|
|
19
17
|
* Create an instance of I18n for the library
|
|
20
|
-
*
|
|
21
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
22
18
|
*/
|
|
23
19
|
static createInstance(): void;
|
|
24
20
|
/**
|
|
25
21
|
* @static @method
|
|
26
22
|
* Explicitly setting language
|
|
27
23
|
* @param {String} lang
|
|
28
|
-
*
|
|
29
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
30
24
|
*/
|
|
31
25
|
static setLanguage(lang: string): void;
|
|
32
26
|
/**
|
|
@@ -34,8 +28,6 @@ export declare class I18n {
|
|
|
34
28
|
* Get value
|
|
35
29
|
* @param {String} key
|
|
36
30
|
* @param {String} defVal - Default value
|
|
37
|
-
*
|
|
38
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
39
31
|
*/
|
|
40
32
|
static get(key: string, defVal?: string): any;
|
|
41
33
|
/**
|
|
@@ -44,8 +36,6 @@ export declare class I18n {
|
|
|
44
36
|
* Add vocabularies for one language
|
|
45
37
|
* @param {String} langurage - Language of the dictionary
|
|
46
38
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
47
|
-
*
|
|
48
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
49
39
|
*/
|
|
50
40
|
static putVocabulariesForLanguage(language: string, vocabularies: Record<string, string>): void;
|
|
51
41
|
/**
|
|
@@ -54,8 +44,6 @@ export declare class I18n {
|
|
|
54
44
|
* Add vocabularies for one language
|
|
55
45
|
* @param {Object} vocabularies - Object that has language as key,
|
|
56
46
|
* vocabularies of each language as value
|
|
57
|
-
*
|
|
58
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
59
47
|
*/
|
|
60
48
|
static putVocabularies(vocabularies: Record<string, string>): void;
|
|
61
49
|
static checkConfig(): boolean;
|
package/lib-esm/I18n/index.js
CHANGED
|
@@ -8,8 +8,6 @@ var _config = { language: null };
|
|
|
8
8
|
var _i18n = null;
|
|
9
9
|
/**
|
|
10
10
|
* Export I18n APIs
|
|
11
|
-
*
|
|
12
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
13
11
|
*/
|
|
14
12
|
var I18n = /** @class */ (function () {
|
|
15
13
|
function I18n() {
|
|
@@ -36,8 +34,6 @@ var I18n = /** @class */ (function () {
|
|
|
36
34
|
* @static
|
|
37
35
|
* @method
|
|
38
36
|
* Create an instance of I18n for the library
|
|
39
|
-
*
|
|
40
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
41
37
|
*/
|
|
42
38
|
I18n.createInstance = function () {
|
|
43
39
|
logger.debug('create I18n instance');
|
|
@@ -50,8 +46,6 @@ var I18n = /** @class */ (function () {
|
|
|
50
46
|
* @static @method
|
|
51
47
|
* Explicitly setting language
|
|
52
48
|
* @param {String} lang
|
|
53
|
-
*
|
|
54
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
55
49
|
*/
|
|
56
50
|
I18n.setLanguage = function (lang) {
|
|
57
51
|
I18n.checkConfig();
|
|
@@ -63,8 +57,6 @@ var I18n = /** @class */ (function () {
|
|
|
63
57
|
* Get value
|
|
64
58
|
* @param {String} key
|
|
65
59
|
* @param {String} defVal - Default value
|
|
66
|
-
*
|
|
67
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
68
60
|
*/
|
|
69
61
|
I18n.get = function (key, defVal) {
|
|
70
62
|
if (!I18n.checkConfig()) {
|
|
@@ -79,8 +71,6 @@ var I18n = /** @class */ (function () {
|
|
|
79
71
|
* Add vocabularies for one language
|
|
80
72
|
* @param {String} langurage - Language of the dictionary
|
|
81
73
|
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
82
|
-
*
|
|
83
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
84
74
|
*/
|
|
85
75
|
I18n.putVocabulariesForLanguage = function (language, vocabularies) {
|
|
86
76
|
I18n.checkConfig();
|
|
@@ -93,8 +83,6 @@ var I18n = /** @class */ (function () {
|
|
|
93
83
|
* Add vocabularies for one language
|
|
94
84
|
* @param {Object} vocabularies - Object that has language as key,
|
|
95
85
|
* vocabularies of each language as value
|
|
96
|
-
*
|
|
97
|
-
* @deprecated The I18n utility is on a deprecation path and will be removed in a future version of Amplify.
|
|
98
86
|
*/
|
|
99
87
|
I18n.putVocabularies = function (vocabularies) {
|
|
100
88
|
I18n.checkConfig();
|
package/lib-esm/I18n/types.d.ts
CHANGED
package/lib-esm/I18n/types.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
var I18nOptions = /** @class */ (function () {
|
|
7
|
-
function I18nOptions() {
|
|
3
|
+
var I18nConfig = /** @class */ (function () {
|
|
4
|
+
function I18nConfig() {
|
|
8
5
|
this.language = null;
|
|
9
6
|
}
|
|
10
|
-
return
|
|
7
|
+
return I18nConfig;
|
|
11
8
|
}());
|
|
12
|
-
export {
|
|
9
|
+
export { I18nConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.1-console-preview.
|
|
1
|
+
export declare const version = "6.0.1-console-preview.4b7d177.0+4b7d177";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export var version = '6.0.1-console-preview.
|
|
2
|
+
export var version = '6.0.1-console-preview.4b7d177.0+4b7d177';
|
|
@@ -3,6 +3,7 @@ import { AnalyticsConfig } from './Analytics/types';
|
|
|
3
3
|
import { AuthConfig, LibraryAuthOptions, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, CognitoIdentityPoolConfig } from './Auth/types';
|
|
4
4
|
import { GeoConfig } from './Geo/types';
|
|
5
5
|
import { LibraryStorageOptions, StorageAccessLevel, StorageConfig } from './Storage/types';
|
|
6
|
+
import { I18nConfig } from '../I18n/types';
|
|
6
7
|
export type LegacyConfig = {
|
|
7
8
|
/**
|
|
8
9
|
* @deprecated The field should not be used.
|
|
@@ -13,6 +14,7 @@ export type ResourcesConfig = {
|
|
|
13
14
|
API?: APIConfig;
|
|
14
15
|
Analytics?: AnalyticsConfig;
|
|
15
16
|
Auth?: AuthConfig;
|
|
17
|
+
I18n?: I18nConfig;
|
|
16
18
|
Storage?: StorageConfig;
|
|
17
19
|
Geo?: GeoConfig;
|
|
18
20
|
};
|