pds-dev-kit-web 2.2.194 → 2.2.196
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/dist/src/common/services/i18n/resources/en.json +1 -0
- package/dist/src/common/services/i18n/resources/es.json +1 -0
- package/dist/src/common/services/i18n/resources/fil.json +1 -0
- package/dist/src/common/services/i18n/resources/index.d.ts +7 -0
- package/dist/src/common/services/i18n/resources/ja.json +1 -0
- package/dist/src/common/services/i18n/resources/ko.json +1 -0
- package/dist/src/common/services/i18n/resources/zh-cn.json +1 -0
- package/dist/src/common/services/i18n/resources/zh-tw.json +1 -0
- package/dist/src/core/pricing/translator.d.ts +2 -1
- package/dist/src/core/pricing/translator.js +4 -1
- package/dist/src/core/pricing/types.d.ts +2 -1
- package/dist/src/core/pricing/types.js +4 -7
- package/dist/src/desktop/components/PriceTextLabel/PriceTextLabel.js +4 -1
- package/dist/src/mobile/components/PriceTextLabel/PriceTextLabel.js +4 -1
- package/package.json +1 -1
- package/release-note.md +2 -3
|
@@ -41,6 +41,7 @@ declare const locale: {
|
|
|
41
41
|
str_please_enter_price: string;
|
|
42
42
|
str_channel_min_price: string;
|
|
43
43
|
str_friendly_currency_won: string;
|
|
44
|
+
str_friendly_currency_jpy: string;
|
|
44
45
|
str_friendly_currency_dollar: string;
|
|
45
46
|
};
|
|
46
47
|
};
|
|
@@ -86,6 +87,7 @@ declare const locale: {
|
|
|
86
87
|
str_please_enter_price: string;
|
|
87
88
|
str_channel_min_price: string;
|
|
88
89
|
str_friendly_currency_won: string;
|
|
90
|
+
str_friendly_currency_jpy: string;
|
|
89
91
|
str_friendly_currency_dollar: string;
|
|
90
92
|
};
|
|
91
93
|
};
|
|
@@ -131,6 +133,7 @@ declare const locale: {
|
|
|
131
133
|
str_please_enter_price: string;
|
|
132
134
|
str_channel_min_price: string;
|
|
133
135
|
str_friendly_currency_won: string;
|
|
136
|
+
str_friendly_currency_jpy: string;
|
|
134
137
|
str_friendly_currency_dollar: string;
|
|
135
138
|
};
|
|
136
139
|
};
|
|
@@ -176,6 +179,7 @@ declare const locale: {
|
|
|
176
179
|
str_please_enter_price: string;
|
|
177
180
|
str_channel_min_price: string;
|
|
178
181
|
str_friendly_currency_won: string;
|
|
182
|
+
str_friendly_currency_jpy: string;
|
|
179
183
|
str_friendly_currency_dollar: string;
|
|
180
184
|
};
|
|
181
185
|
};
|
|
@@ -221,6 +225,7 @@ declare const locale: {
|
|
|
221
225
|
str_please_enter_price: string;
|
|
222
226
|
str_channel_min_price: string;
|
|
223
227
|
str_friendly_currency_won: string;
|
|
228
|
+
str_friendly_currency_jpy: string;
|
|
224
229
|
str_friendly_currency_dollar: string;
|
|
225
230
|
};
|
|
226
231
|
};
|
|
@@ -266,6 +271,7 @@ declare const locale: {
|
|
|
266
271
|
str_please_enter_price: string;
|
|
267
272
|
str_channel_min_price: string;
|
|
268
273
|
str_friendly_currency_won: string;
|
|
274
|
+
str_friendly_currency_jpy: string;
|
|
269
275
|
str_friendly_currency_dollar: string;
|
|
270
276
|
};
|
|
271
277
|
};
|
|
@@ -311,6 +317,7 @@ declare const locale: {
|
|
|
311
317
|
str_please_enter_price: string;
|
|
312
318
|
str_channel_min_price: string;
|
|
313
319
|
str_friendly_currency_won: string;
|
|
320
|
+
str_friendly_currency_jpy: string;
|
|
314
321
|
str_friendly_currency_dollar: string;
|
|
315
322
|
};
|
|
316
323
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { CurrencyCodeType, Price } from './types';
|
|
1
|
+
import type { CurrencyCodeType, Price, TranslationType } from './types';
|
|
2
2
|
export interface PricingTranslateOptions {
|
|
3
3
|
friendly?: boolean;
|
|
4
|
+
translation?: TranslationType;
|
|
4
5
|
}
|
|
5
6
|
export declare class PricingTranslator {
|
|
6
7
|
private static browserLanguage;
|
|
@@ -28,7 +28,10 @@ var PricingTranslator = /** @class */ (function () {
|
|
|
28
28
|
*/
|
|
29
29
|
PricingTranslator.currency = function (code, opts) {
|
|
30
30
|
var currency = types_1.CURRENCY_MAP[code];
|
|
31
|
-
|
|
31
|
+
if (opts === null || opts === void 0 ? void 0 : opts.friendly) {
|
|
32
|
+
return currency.friendlyName(opts.translation);
|
|
33
|
+
}
|
|
34
|
+
return currency.name;
|
|
32
35
|
};
|
|
33
36
|
/**
|
|
34
37
|
* 포맷된 금액과 통화 문자열을 결합합니다
|
|
@@ -4,10 +4,11 @@ export declare enum CurrencyCode {
|
|
|
4
4
|
JPY = "JPY"
|
|
5
5
|
}
|
|
6
6
|
export type CurrencyCodeType = CurrencyCode | string;
|
|
7
|
+
export type TranslationType = (key: string) => string;
|
|
7
8
|
export interface Currency {
|
|
8
9
|
code: CurrencyCode;
|
|
9
10
|
name: string;
|
|
10
|
-
friendlyName: () => string;
|
|
11
|
+
friendlyName: (translate?: TranslationType) => string;
|
|
11
12
|
decimalDigits: number;
|
|
12
13
|
}
|
|
13
14
|
export declare const CURRENCY_MAP: Record<CurrencyCode, Currency>;
|
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
var _a;
|
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
4
|
exports.CURRENCY_MAP = exports.CurrencyCode = void 0;
|
|
8
|
-
var i18next_1 = __importDefault(require("i18next"));
|
|
9
5
|
var CurrencyCode;
|
|
10
6
|
(function (CurrencyCode) {
|
|
11
7
|
CurrencyCode["KRW"] = "KRW";
|
|
12
8
|
CurrencyCode["USD"] = "USD";
|
|
13
9
|
CurrencyCode["JPY"] = "JPY";
|
|
14
10
|
})(CurrencyCode = exports.CurrencyCode || (exports.CurrencyCode = {}));
|
|
11
|
+
var translateFriendlyName = function (key) { return function (t) { var _a; return (_a = t === null || t === void 0 ? void 0 : t(key)) !== null && _a !== void 0 ? _a : key; }; };
|
|
15
12
|
exports.CURRENCY_MAP = (_a = {},
|
|
16
13
|
_a[CurrencyCode.KRW] = {
|
|
17
14
|
code: CurrencyCode.KRW,
|
|
18
15
|
name: CurrencyCode.KRW,
|
|
19
|
-
friendlyName:
|
|
16
|
+
friendlyName: translateFriendlyName('str_friendly_currency_won'),
|
|
20
17
|
decimalDigits: 0
|
|
21
18
|
},
|
|
22
19
|
_a[CurrencyCode.USD] = {
|
|
23
20
|
code: CurrencyCode.USD,
|
|
24
21
|
name: CurrencyCode.USD,
|
|
25
|
-
friendlyName:
|
|
22
|
+
friendlyName: translateFriendlyName('str_friendly_currency_dollar'),
|
|
26
23
|
decimalDigits: 2
|
|
27
24
|
},
|
|
28
25
|
_a[CurrencyCode.JPY] = {
|
|
29
26
|
code: CurrencyCode.JPY,
|
|
30
27
|
name: CurrencyCode.JPY,
|
|
31
|
-
friendlyName:
|
|
28
|
+
friendlyName: translateFriendlyName('str_friendly_currency_jpy'),
|
|
32
29
|
decimalDigits: 0
|
|
33
30
|
},
|
|
34
31
|
_a);
|
|
@@ -23,10 +23,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
26
|
+
var react_i18next_1 = require("react-i18next");
|
|
26
27
|
var pricing_1 = require("../../../core/pricing");
|
|
27
28
|
var TextLabel_1 = require("../TextLabel");
|
|
28
29
|
function PriceTextLabel(_a) {
|
|
29
30
|
var price = _a.price, _b = _a.useFriendlyName, useFriendlyName = _b === void 0 ? 'none' : _b, _c = _a.useMinus, useMinus = _c === void 0 ? 'none' : _c, selectedCurrency = _a.selectedCurrency, exchangeRates = _a.exchangeRates, userCountryCode = _a.userCountryCode, args = __rest(_a, ["price", "useFriendlyName", "useMinus", "selectedCurrency", "exchangeRates", "userCountryCode"]);
|
|
31
|
+
var t = (0, react_i18next_1.useTranslation)('translation').t;
|
|
30
32
|
var targetPrice = price;
|
|
31
33
|
var formattedAmount = useMinus === 'use' ? "-".concat(targetPrice.amount) : targetPrice.amount;
|
|
32
34
|
var priceText = pricing_1.PricingService.translate.priceWithCurrency(exchangeRates && selectedCurrency
|
|
@@ -37,7 +39,8 @@ function PriceTextLabel(_a) {
|
|
|
37
39
|
? pricing_1.PricingService.getDefaultPreferredCurrency(userCountryCode.toLocaleLowerCase())
|
|
38
40
|
: price.currency
|
|
39
41
|
}, {
|
|
40
|
-
friendly: useFriendlyName === 'use' ? true : false
|
|
42
|
+
friendly: useFriendlyName === 'use' ? true : false,
|
|
43
|
+
translation: t
|
|
41
44
|
});
|
|
42
45
|
return (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, __assign({}, args, { text: priceText }));
|
|
43
46
|
}
|
|
@@ -23,10 +23,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
26
|
+
var react_i18next_1 = require("react-i18next");
|
|
26
27
|
var pricing_1 = require("../../../core/pricing");
|
|
27
28
|
var TextLabel_1 = require("../TextLabel");
|
|
28
29
|
function PriceTextLabel(_a) {
|
|
29
30
|
var price = _a.price, _b = _a.useFriendlyName, useFriendlyName = _b === void 0 ? 'none' : _b, _c = _a.useMinus, useMinus = _c === void 0 ? 'none' : _c, selectedCurrency = _a.selectedCurrency, exchangeRates = _a.exchangeRates, userCountryCode = _a.userCountryCode, args = __rest(_a, ["price", "useFriendlyName", "useMinus", "selectedCurrency", "exchangeRates", "userCountryCode"]);
|
|
31
|
+
var t = (0, react_i18next_1.useTranslation)('translation').t;
|
|
30
32
|
var targetPrice = price;
|
|
31
33
|
var formattedAmount = useMinus === 'use' ? "-".concat(targetPrice.amount) : targetPrice.amount;
|
|
32
34
|
var priceText = pricing_1.PricingService.translate.priceWithCurrency(exchangeRates && selectedCurrency
|
|
@@ -37,7 +39,8 @@ function PriceTextLabel(_a) {
|
|
|
37
39
|
? pricing_1.PricingService.getDefaultPreferredCurrency(userCountryCode.toLocaleLowerCase())
|
|
38
40
|
: price.currency
|
|
39
41
|
}, {
|
|
40
|
-
friendly: useFriendlyName === 'use' ? true : false
|
|
42
|
+
friendly: useFriendlyName === 'use' ? true : false,
|
|
43
|
+
translation: t
|
|
41
44
|
});
|
|
42
45
|
return (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, __assign({}, args, { text: priceText }));
|
|
43
46
|
}
|
package/package.json
CHANGED
package/release-note.md
CHANGED