@orderly.network/i18n 3.0.0-beta.1 → 3.0.0-beta.2
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/README.md +23 -469
- package/dist/{constant-BeXwHrGj.d.mts → constant-DkvDyddr.d.mts} +37 -40
- package/dist/{constant-BeXwHrGj.d.ts → constant-DkvDyddr.d.ts} +37 -40
- package/dist/constant.d.mts +1 -1
- package/dist/constant.d.ts +1 -1
- package/dist/constant.js.map +1 -1
- package/dist/constant.mjs.map +1 -1
- package/dist/index.d.mts +69 -30
- package/dist/index.d.ts +69 -30
- package/dist/index.js +140 -118
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +132 -115
- package/dist/index.mjs.map +1 -1
- package/dist/locale.csv +33 -106
- package/dist/locales/de.json +33 -38
- package/dist/locales/en.json +33 -38
- package/dist/locales/es.json +33 -38
- package/dist/locales/fr.json +33 -38
- package/dist/locales/id.json +33 -38
- package/dist/locales/it.json +33 -38
- package/dist/locales/ja.json +33 -38
- package/dist/locales/ko.json +33 -38
- package/dist/locales/nl.json +33 -38
- package/dist/locales/pl.json +33 -38
- package/dist/locales/pt.json +33 -38
- package/dist/locales/ru.json +33 -38
- package/dist/locales/tc.json +33 -38
- package/dist/locales/tr.json +33 -38
- package/dist/locales/uk.json +33 -38
- package/dist/locales/vi.json +33 -38
- package/dist/locales/zh.json +33 -38
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +40 -45
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +40 -45
- package/dist/utils.mjs.map +1 -1
- package/docs/guide/AGENTS.md +109 -0
- package/docs/guide/cli.md +133 -0
- package/docs/guide/examples.md +455 -0
- package/docs/guide/exports.md +14 -0
- package/docs/guide/integration.md +223 -0
- package/docs/guide/utils.md +14 -0
- package/package.json +8 -6
- package/scripts/copyLocales.js +11 -0
- package/scripts/csv2json.js +28 -0
- package/scripts/diffCsv.js +175 -0
- package/scripts/fillJson.js +33 -0
- package/scripts/filterLocaleKeys.js +127 -0
- package/scripts/generateCsv.js +36 -0
- package/scripts/generateEnJson.js +11 -0
- package/scripts/generateMissingKeys.js +49 -0
- package/scripts/json-csv-converter.js +286 -0
- package/scripts/json2csv.js +38 -0
- package/scripts/mergeJson.js +67 -0
- package/scripts/separateJson.js +50 -0
- package/scripts/utils.js +94 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
declare const en: {
|
|
4
|
+
"tradingPoints.points": string;
|
|
4
5
|
"notification.campaign": string;
|
|
5
6
|
"notification.delisting": string;
|
|
6
7
|
"notification.general": string;
|
|
@@ -130,42 +131,6 @@ declare const en: {
|
|
|
130
131
|
"errorBoundary.refresh": string;
|
|
131
132
|
"dmm.maker": string;
|
|
132
133
|
"dmm.taker": string;
|
|
133
|
-
"tradingPoints.points": string;
|
|
134
|
-
"tradingPoints.startsIn": string;
|
|
135
|
-
"tradingPoints.days": string;
|
|
136
|
-
"tradingPoints.hours": string;
|
|
137
|
-
"tradingPoints.minutes": string;
|
|
138
|
-
"tradingPoints.seconds": string;
|
|
139
|
-
"tradingPoints.learnMore": string;
|
|
140
|
-
"tradingPoints.stagePoints": string;
|
|
141
|
-
"tradingPoints.stageRanking": string;
|
|
142
|
-
"tradingPoints.referralCode": string;
|
|
143
|
-
"tradingPoints.referralLink": string;
|
|
144
|
-
"tradingPoints.currentPoints": string;
|
|
145
|
-
"tradingPoints.ranking": string;
|
|
146
|
-
"tradingPoints.myPoints": string;
|
|
147
|
-
"tradingPoints.thisWeek": string;
|
|
148
|
-
"tradingPoints.lastWeek": string;
|
|
149
|
-
"tradingPoints.all": string;
|
|
150
|
-
"tradingPoints.tradePoints": string;
|
|
151
|
-
"tradingPoints.tradePointsTooltip": string;
|
|
152
|
-
"tradingPoints.tradeNow": string;
|
|
153
|
-
"tradingPoints.pnlPoints": string;
|
|
154
|
-
"tradingPoints.pnlPointsTooltip": string;
|
|
155
|
-
"tradingPoints.referralPoints": string;
|
|
156
|
-
"tradingPoints.referralPointsTooltip": string;
|
|
157
|
-
"tradingPoints.copyLink": string;
|
|
158
|
-
"tradingPoints.faq.title": string;
|
|
159
|
-
"tradingPoints.faq.whatArePoints.question": string;
|
|
160
|
-
"tradingPoints.faq.whatArePoints.answer": string;
|
|
161
|
-
"tradingPoints.faq.allocation.question": string;
|
|
162
|
-
"tradingPoints.faq.allocation.answer": string;
|
|
163
|
-
"tradingPoints.faq.distribution.question": string;
|
|
164
|
-
"tradingPoints.faq.distribution.answer": string;
|
|
165
|
-
"tradingPoints.faq.pnl.question": string;
|
|
166
|
-
"tradingPoints.faq.pnl.answer": string;
|
|
167
|
-
"tradingPoints.faq.referral.question": string;
|
|
168
|
-
"tradingPoints.faq.referral.answer": string;
|
|
169
134
|
"tradingLeaderboard.leaderboard": string;
|
|
170
135
|
"tradingLeaderboard.campaigns": string;
|
|
171
136
|
"tradingLeaderboard.ongoing": string;
|
|
@@ -226,6 +191,10 @@ declare const en: {
|
|
|
226
191
|
"affiliate.referralCode.label": string;
|
|
227
192
|
"affiliate.referralCode.bound": string;
|
|
228
193
|
"affiliate.referralCode.notExist": string;
|
|
194
|
+
"affiliate.referralCode.bind.modal.title": string;
|
|
195
|
+
"affiliate.referralCode.bind.modal.description": string;
|
|
196
|
+
"affiliate.referralCode.bind.input.placeholder": string;
|
|
197
|
+
"affiliate.referralCode.bind.skip": string;
|
|
229
198
|
"affiliate.process.title": string;
|
|
230
199
|
"affiliate.process.step1.title": string;
|
|
231
200
|
"affiliate.process.step1.description": string;
|
|
@@ -287,6 +256,7 @@ declare const en: {
|
|
|
287
256
|
"affiliate.direct": string;
|
|
288
257
|
"affiliate.directInclBonus": string;
|
|
289
258
|
"affiliate.indirect": string;
|
|
259
|
+
"affiliate.referredBy": string;
|
|
290
260
|
"affiliate.referrals": string;
|
|
291
261
|
"affiliate.referralCode.edit.modal.title": string;
|
|
292
262
|
"affiliate.referralCode.create": string;
|
|
@@ -369,10 +339,20 @@ declare const en: {
|
|
|
369
339
|
"transfer.deposit.requested": string;
|
|
370
340
|
"transfer.deposit.completed": string;
|
|
371
341
|
"transfer.deposit.failed": string;
|
|
342
|
+
"transfer.exclusiveDeposit.warning": string;
|
|
343
|
+
"transfer.exclusiveDeposit.selectFirst": string;
|
|
344
|
+
"transfer.exclusiveDeposit.selectNetwork": string;
|
|
345
|
+
"transfer.exclusiveDeposit.selectToken": string;
|
|
346
|
+
"transfer.exclusiveDeposit.minDeposit": string;
|
|
347
|
+
"transfer.exclusiveDeposit.estimatedTime": string;
|
|
348
|
+
"transfer.exclusiveDeposit.estimatedTime.default": string;
|
|
349
|
+
"transfer.exclusiveDeposit.depositPending": string;
|
|
372
350
|
"transfer.deposit.feeUnavailable": string;
|
|
373
351
|
"transfer.deposit.notEnoughGas": string;
|
|
374
352
|
"transfer.deposit.exceedCap": string;
|
|
375
353
|
"transfer.deposit.closeToMaxLimit": string;
|
|
354
|
+
"transfer.deposit.tab.connectedWallet": string;
|
|
355
|
+
"transfer.deposit.tab.exchangeOrOtherWallet": string;
|
|
376
356
|
"transfer.deposit.estGasFee": string;
|
|
377
357
|
"transfer.deposit.estGasFee.tooltip": string;
|
|
378
358
|
"transfer.deposit.destinationGasFee": string;
|
|
@@ -550,6 +530,7 @@ declare const en: {
|
|
|
550
530
|
"tradingView.displayControl.buySell": string;
|
|
551
531
|
"tradingView.displayControl.limitOrders": string;
|
|
552
532
|
"tradingView.displayControl.stopOrders": string;
|
|
533
|
+
"tradingView.displayControl.liquidationPrice": string;
|
|
553
534
|
"tradingView.noScriptSrc": string;
|
|
554
535
|
"tradingView.noScriptSrc.1": string;
|
|
555
536
|
"tradingView.noScriptSrc.2": string;
|
|
@@ -609,6 +590,7 @@ declare const en: {
|
|
|
609
590
|
"orderEntry.orderType.ioc.tooltip": string;
|
|
610
591
|
"orderEntry.orderType.fok": string;
|
|
611
592
|
"orderEntry.orderType.fok.tooltip": string;
|
|
593
|
+
"orderEntry.orderType.symbolPostOnly.tooltip": string;
|
|
612
594
|
"orderEntry.orderType.scaledOrder": string;
|
|
613
595
|
"orderEntry.orderType.trailingStop": string;
|
|
614
596
|
"orderEntry.orderSize": string;
|
|
@@ -679,10 +661,13 @@ declare const en: {
|
|
|
679
661
|
"marginMode.current": string;
|
|
680
662
|
"marginMode.marginModeSettings": string;
|
|
681
663
|
"marginMode.updatedSuccessfully": string;
|
|
664
|
+
"marginMode.noEditableSymbolsSelected": string;
|
|
665
|
+
"marginMode.failedToUpdateMarginMode": string;
|
|
682
666
|
"marginMode.perpetualFutures": string;
|
|
683
667
|
"marginMode.searchPlaceholder": string;
|
|
684
668
|
"marginMode.selectAll": string;
|
|
685
669
|
"marginMode.setAs": string;
|
|
670
|
+
"marginMode.disabledSymbolTooltip": string;
|
|
686
671
|
"orderEntry.startPrice.error.required": string;
|
|
687
672
|
"orderEntry.startPrice.error.min": string;
|
|
688
673
|
"orderEntry.startPrice.error.max": string;
|
|
@@ -712,6 +697,11 @@ declare const en: {
|
|
|
712
697
|
"orderEntry.reduceOnly.reminder.content": string;
|
|
713
698
|
"orderEntry.placeOrderNow": string;
|
|
714
699
|
"orderEntry.maxQty.reminder.content": string;
|
|
700
|
+
"orderEntry.permissionlessNotice.title": string;
|
|
701
|
+
"orderEntry.permissionlessNotice.content1": string;
|
|
702
|
+
"orderEntry.permissionlessNotice.content2": string;
|
|
703
|
+
"orderEntry.permissionlessNotice.content3": string;
|
|
704
|
+
"orderEntry.permissionlessNotice.checkbox": string;
|
|
715
705
|
"share.pnl.sharePnl": string;
|
|
716
706
|
"share.pnl.share.long": string;
|
|
717
707
|
"share.pnl.share.short": string;
|
|
@@ -987,6 +977,7 @@ declare const en: {
|
|
|
987
977
|
"trading.rwa.tooltip.openIn": string;
|
|
988
978
|
"trading.rwa.tooltip.checkDetailRules": string;
|
|
989
979
|
"trading.rwa.countdown.title": string;
|
|
980
|
+
"trading.symbolDelisting": string;
|
|
990
981
|
"trading.rwa.outsideMarketHours.notify": string;
|
|
991
982
|
"trading.rwa.mWeb.outsideMarketHours.desc": string;
|
|
992
983
|
"trading.rwa.mWeb.insideMarketHours.desc": string;
|
|
@@ -1006,6 +997,8 @@ declare const en: {
|
|
|
1006
997
|
"portfolio.overview.performance.cumulativePnl": string;
|
|
1007
998
|
"portfolio.overview.performance.dailyVolume": string;
|
|
1008
999
|
"portfolio.overview.performance.cumulativeVolume": string;
|
|
1000
|
+
"portfolio.overview.todaysPnl": string;
|
|
1001
|
+
"portfolio.overview.todaysVol": string;
|
|
1009
1002
|
"portfolio.overview.distribution": string;
|
|
1010
1003
|
"portfolio.overview.transferHistory": string;
|
|
1011
1004
|
"portfolio.overview.vaults": string;
|
|
@@ -1083,6 +1076,7 @@ declare const en: {
|
|
|
1083
1076
|
"markets.favorites": string;
|
|
1084
1077
|
"markets.recent": string;
|
|
1085
1078
|
"markets.newListings": string;
|
|
1079
|
+
"markets.community": string;
|
|
1086
1080
|
"markets.allMarkets": string;
|
|
1087
1081
|
"markets.openInterest": string;
|
|
1088
1082
|
"markets.openInterest.tooltip": string;
|
|
@@ -1131,6 +1125,7 @@ declare const en: {
|
|
|
1131
1125
|
"markets.symbolInfoBar.24hVolume.tooltip": string;
|
|
1132
1126
|
"markets.symbolInfoBar.predFundingRate": string;
|
|
1133
1127
|
"markets.symbolInfoBar.predFundingRate.tooltip": string;
|
|
1128
|
+
"markets.symbolInfoBar.riskNotice.content": string;
|
|
1134
1129
|
"common.cancel": string;
|
|
1135
1130
|
"common.close": string;
|
|
1136
1131
|
"common.confirm": string;
|
|
@@ -1275,6 +1270,8 @@ interface LocaleMessages extends EnType, ExtendLocaleMessages {
|
|
|
1275
1270
|
type Resources<T extends {} = {}> = {
|
|
1276
1271
|
[key in LocaleCode]?: Partial<LocaleMessages & T>;
|
|
1277
1272
|
};
|
|
1273
|
+
/** Async loader for a single locale/namespace message table (see `useRegisterExternalResources`, ExternalLocaleProvider, LocaleProvider `resources`). */
|
|
1274
|
+
type AsyncResources = (lang: LocaleCode, ns: string) => Promise<Record<string, string>>;
|
|
1278
1275
|
declare module "i18next" {
|
|
1279
1276
|
interface CustomTypeOptions {
|
|
1280
1277
|
resources: {
|
|
@@ -1302,7 +1299,7 @@ type PopupProps = {
|
|
|
1302
1299
|
/** popup style */
|
|
1303
1300
|
style?: React.CSSProperties;
|
|
1304
1301
|
};
|
|
1305
|
-
type
|
|
1302
|
+
type LanguageContextState = {
|
|
1306
1303
|
/**
|
|
1307
1304
|
* custom languages
|
|
1308
1305
|
*/
|
|
@@ -1320,8 +1317,8 @@ type LocaleContextState = {
|
|
|
1320
1317
|
*/
|
|
1321
1318
|
popup?: PopupProps;
|
|
1322
1319
|
};
|
|
1323
|
-
declare const
|
|
1324
|
-
declare const
|
|
1320
|
+
declare const LanguageContext: react.Context<LanguageContextState>;
|
|
1321
|
+
declare const useLanguageContext: () => LanguageContextState;
|
|
1325
1322
|
|
|
1326
1323
|
declare enum LocaleEnum {
|
|
1327
1324
|
/** English */
|
|
@@ -1365,4 +1362,4 @@ declare const defaultNS = "translation";
|
|
|
1365
1362
|
declare const i18nLocalStorageKey = "orderly_i18nLng";
|
|
1366
1363
|
declare const i18nCookieKey = "orderly_i18nLng";
|
|
1367
1364
|
|
|
1368
|
-
export { type LocaleCode as L, type PopupMode as P, type Resources as R, type
|
|
1365
|
+
export { type AsyncResources as A, type LocaleCode as L, type PopupMode as P, type Resources as R, type LanguageContextState as a, type Language as b, type PopupProps as c, LanguageContext as d, type LocaleMessages as e, LocaleEnum as f, defaultLanguages as g, defaultLng as h, defaultNS as i, i18nLocalStorageKey as j, i18nCookieKey as k, en as l, useLanguageContext as u };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
declare const en: {
|
|
4
|
+
"tradingPoints.points": string;
|
|
4
5
|
"notification.campaign": string;
|
|
5
6
|
"notification.delisting": string;
|
|
6
7
|
"notification.general": string;
|
|
@@ -130,42 +131,6 @@ declare const en: {
|
|
|
130
131
|
"errorBoundary.refresh": string;
|
|
131
132
|
"dmm.maker": string;
|
|
132
133
|
"dmm.taker": string;
|
|
133
|
-
"tradingPoints.points": string;
|
|
134
|
-
"tradingPoints.startsIn": string;
|
|
135
|
-
"tradingPoints.days": string;
|
|
136
|
-
"tradingPoints.hours": string;
|
|
137
|
-
"tradingPoints.minutes": string;
|
|
138
|
-
"tradingPoints.seconds": string;
|
|
139
|
-
"tradingPoints.learnMore": string;
|
|
140
|
-
"tradingPoints.stagePoints": string;
|
|
141
|
-
"tradingPoints.stageRanking": string;
|
|
142
|
-
"tradingPoints.referralCode": string;
|
|
143
|
-
"tradingPoints.referralLink": string;
|
|
144
|
-
"tradingPoints.currentPoints": string;
|
|
145
|
-
"tradingPoints.ranking": string;
|
|
146
|
-
"tradingPoints.myPoints": string;
|
|
147
|
-
"tradingPoints.thisWeek": string;
|
|
148
|
-
"tradingPoints.lastWeek": string;
|
|
149
|
-
"tradingPoints.all": string;
|
|
150
|
-
"tradingPoints.tradePoints": string;
|
|
151
|
-
"tradingPoints.tradePointsTooltip": string;
|
|
152
|
-
"tradingPoints.tradeNow": string;
|
|
153
|
-
"tradingPoints.pnlPoints": string;
|
|
154
|
-
"tradingPoints.pnlPointsTooltip": string;
|
|
155
|
-
"tradingPoints.referralPoints": string;
|
|
156
|
-
"tradingPoints.referralPointsTooltip": string;
|
|
157
|
-
"tradingPoints.copyLink": string;
|
|
158
|
-
"tradingPoints.faq.title": string;
|
|
159
|
-
"tradingPoints.faq.whatArePoints.question": string;
|
|
160
|
-
"tradingPoints.faq.whatArePoints.answer": string;
|
|
161
|
-
"tradingPoints.faq.allocation.question": string;
|
|
162
|
-
"tradingPoints.faq.allocation.answer": string;
|
|
163
|
-
"tradingPoints.faq.distribution.question": string;
|
|
164
|
-
"tradingPoints.faq.distribution.answer": string;
|
|
165
|
-
"tradingPoints.faq.pnl.question": string;
|
|
166
|
-
"tradingPoints.faq.pnl.answer": string;
|
|
167
|
-
"tradingPoints.faq.referral.question": string;
|
|
168
|
-
"tradingPoints.faq.referral.answer": string;
|
|
169
134
|
"tradingLeaderboard.leaderboard": string;
|
|
170
135
|
"tradingLeaderboard.campaigns": string;
|
|
171
136
|
"tradingLeaderboard.ongoing": string;
|
|
@@ -226,6 +191,10 @@ declare const en: {
|
|
|
226
191
|
"affiliate.referralCode.label": string;
|
|
227
192
|
"affiliate.referralCode.bound": string;
|
|
228
193
|
"affiliate.referralCode.notExist": string;
|
|
194
|
+
"affiliate.referralCode.bind.modal.title": string;
|
|
195
|
+
"affiliate.referralCode.bind.modal.description": string;
|
|
196
|
+
"affiliate.referralCode.bind.input.placeholder": string;
|
|
197
|
+
"affiliate.referralCode.bind.skip": string;
|
|
229
198
|
"affiliate.process.title": string;
|
|
230
199
|
"affiliate.process.step1.title": string;
|
|
231
200
|
"affiliate.process.step1.description": string;
|
|
@@ -287,6 +256,7 @@ declare const en: {
|
|
|
287
256
|
"affiliate.direct": string;
|
|
288
257
|
"affiliate.directInclBonus": string;
|
|
289
258
|
"affiliate.indirect": string;
|
|
259
|
+
"affiliate.referredBy": string;
|
|
290
260
|
"affiliate.referrals": string;
|
|
291
261
|
"affiliate.referralCode.edit.modal.title": string;
|
|
292
262
|
"affiliate.referralCode.create": string;
|
|
@@ -369,10 +339,20 @@ declare const en: {
|
|
|
369
339
|
"transfer.deposit.requested": string;
|
|
370
340
|
"transfer.deposit.completed": string;
|
|
371
341
|
"transfer.deposit.failed": string;
|
|
342
|
+
"transfer.exclusiveDeposit.warning": string;
|
|
343
|
+
"transfer.exclusiveDeposit.selectFirst": string;
|
|
344
|
+
"transfer.exclusiveDeposit.selectNetwork": string;
|
|
345
|
+
"transfer.exclusiveDeposit.selectToken": string;
|
|
346
|
+
"transfer.exclusiveDeposit.minDeposit": string;
|
|
347
|
+
"transfer.exclusiveDeposit.estimatedTime": string;
|
|
348
|
+
"transfer.exclusiveDeposit.estimatedTime.default": string;
|
|
349
|
+
"transfer.exclusiveDeposit.depositPending": string;
|
|
372
350
|
"transfer.deposit.feeUnavailable": string;
|
|
373
351
|
"transfer.deposit.notEnoughGas": string;
|
|
374
352
|
"transfer.deposit.exceedCap": string;
|
|
375
353
|
"transfer.deposit.closeToMaxLimit": string;
|
|
354
|
+
"transfer.deposit.tab.connectedWallet": string;
|
|
355
|
+
"transfer.deposit.tab.exchangeOrOtherWallet": string;
|
|
376
356
|
"transfer.deposit.estGasFee": string;
|
|
377
357
|
"transfer.deposit.estGasFee.tooltip": string;
|
|
378
358
|
"transfer.deposit.destinationGasFee": string;
|
|
@@ -550,6 +530,7 @@ declare const en: {
|
|
|
550
530
|
"tradingView.displayControl.buySell": string;
|
|
551
531
|
"tradingView.displayControl.limitOrders": string;
|
|
552
532
|
"tradingView.displayControl.stopOrders": string;
|
|
533
|
+
"tradingView.displayControl.liquidationPrice": string;
|
|
553
534
|
"tradingView.noScriptSrc": string;
|
|
554
535
|
"tradingView.noScriptSrc.1": string;
|
|
555
536
|
"tradingView.noScriptSrc.2": string;
|
|
@@ -609,6 +590,7 @@ declare const en: {
|
|
|
609
590
|
"orderEntry.orderType.ioc.tooltip": string;
|
|
610
591
|
"orderEntry.orderType.fok": string;
|
|
611
592
|
"orderEntry.orderType.fok.tooltip": string;
|
|
593
|
+
"orderEntry.orderType.symbolPostOnly.tooltip": string;
|
|
612
594
|
"orderEntry.orderType.scaledOrder": string;
|
|
613
595
|
"orderEntry.orderType.trailingStop": string;
|
|
614
596
|
"orderEntry.orderSize": string;
|
|
@@ -679,10 +661,13 @@ declare const en: {
|
|
|
679
661
|
"marginMode.current": string;
|
|
680
662
|
"marginMode.marginModeSettings": string;
|
|
681
663
|
"marginMode.updatedSuccessfully": string;
|
|
664
|
+
"marginMode.noEditableSymbolsSelected": string;
|
|
665
|
+
"marginMode.failedToUpdateMarginMode": string;
|
|
682
666
|
"marginMode.perpetualFutures": string;
|
|
683
667
|
"marginMode.searchPlaceholder": string;
|
|
684
668
|
"marginMode.selectAll": string;
|
|
685
669
|
"marginMode.setAs": string;
|
|
670
|
+
"marginMode.disabledSymbolTooltip": string;
|
|
686
671
|
"orderEntry.startPrice.error.required": string;
|
|
687
672
|
"orderEntry.startPrice.error.min": string;
|
|
688
673
|
"orderEntry.startPrice.error.max": string;
|
|
@@ -712,6 +697,11 @@ declare const en: {
|
|
|
712
697
|
"orderEntry.reduceOnly.reminder.content": string;
|
|
713
698
|
"orderEntry.placeOrderNow": string;
|
|
714
699
|
"orderEntry.maxQty.reminder.content": string;
|
|
700
|
+
"orderEntry.permissionlessNotice.title": string;
|
|
701
|
+
"orderEntry.permissionlessNotice.content1": string;
|
|
702
|
+
"orderEntry.permissionlessNotice.content2": string;
|
|
703
|
+
"orderEntry.permissionlessNotice.content3": string;
|
|
704
|
+
"orderEntry.permissionlessNotice.checkbox": string;
|
|
715
705
|
"share.pnl.sharePnl": string;
|
|
716
706
|
"share.pnl.share.long": string;
|
|
717
707
|
"share.pnl.share.short": string;
|
|
@@ -987,6 +977,7 @@ declare const en: {
|
|
|
987
977
|
"trading.rwa.tooltip.openIn": string;
|
|
988
978
|
"trading.rwa.tooltip.checkDetailRules": string;
|
|
989
979
|
"trading.rwa.countdown.title": string;
|
|
980
|
+
"trading.symbolDelisting": string;
|
|
990
981
|
"trading.rwa.outsideMarketHours.notify": string;
|
|
991
982
|
"trading.rwa.mWeb.outsideMarketHours.desc": string;
|
|
992
983
|
"trading.rwa.mWeb.insideMarketHours.desc": string;
|
|
@@ -1006,6 +997,8 @@ declare const en: {
|
|
|
1006
997
|
"portfolio.overview.performance.cumulativePnl": string;
|
|
1007
998
|
"portfolio.overview.performance.dailyVolume": string;
|
|
1008
999
|
"portfolio.overview.performance.cumulativeVolume": string;
|
|
1000
|
+
"portfolio.overview.todaysPnl": string;
|
|
1001
|
+
"portfolio.overview.todaysVol": string;
|
|
1009
1002
|
"portfolio.overview.distribution": string;
|
|
1010
1003
|
"portfolio.overview.transferHistory": string;
|
|
1011
1004
|
"portfolio.overview.vaults": string;
|
|
@@ -1083,6 +1076,7 @@ declare const en: {
|
|
|
1083
1076
|
"markets.favorites": string;
|
|
1084
1077
|
"markets.recent": string;
|
|
1085
1078
|
"markets.newListings": string;
|
|
1079
|
+
"markets.community": string;
|
|
1086
1080
|
"markets.allMarkets": string;
|
|
1087
1081
|
"markets.openInterest": string;
|
|
1088
1082
|
"markets.openInterest.tooltip": string;
|
|
@@ -1131,6 +1125,7 @@ declare const en: {
|
|
|
1131
1125
|
"markets.symbolInfoBar.24hVolume.tooltip": string;
|
|
1132
1126
|
"markets.symbolInfoBar.predFundingRate": string;
|
|
1133
1127
|
"markets.symbolInfoBar.predFundingRate.tooltip": string;
|
|
1128
|
+
"markets.symbolInfoBar.riskNotice.content": string;
|
|
1134
1129
|
"common.cancel": string;
|
|
1135
1130
|
"common.close": string;
|
|
1136
1131
|
"common.confirm": string;
|
|
@@ -1275,6 +1270,8 @@ interface LocaleMessages extends EnType, ExtendLocaleMessages {
|
|
|
1275
1270
|
type Resources<T extends {} = {}> = {
|
|
1276
1271
|
[key in LocaleCode]?: Partial<LocaleMessages & T>;
|
|
1277
1272
|
};
|
|
1273
|
+
/** Async loader for a single locale/namespace message table (see `useRegisterExternalResources`, ExternalLocaleProvider, LocaleProvider `resources`). */
|
|
1274
|
+
type AsyncResources = (lang: LocaleCode, ns: string) => Promise<Record<string, string>>;
|
|
1278
1275
|
declare module "i18next" {
|
|
1279
1276
|
interface CustomTypeOptions {
|
|
1280
1277
|
resources: {
|
|
@@ -1302,7 +1299,7 @@ type PopupProps = {
|
|
|
1302
1299
|
/** popup style */
|
|
1303
1300
|
style?: React.CSSProperties;
|
|
1304
1301
|
};
|
|
1305
|
-
type
|
|
1302
|
+
type LanguageContextState = {
|
|
1306
1303
|
/**
|
|
1307
1304
|
* custom languages
|
|
1308
1305
|
*/
|
|
@@ -1320,8 +1317,8 @@ type LocaleContextState = {
|
|
|
1320
1317
|
*/
|
|
1321
1318
|
popup?: PopupProps;
|
|
1322
1319
|
};
|
|
1323
|
-
declare const
|
|
1324
|
-
declare const
|
|
1320
|
+
declare const LanguageContext: react.Context<LanguageContextState>;
|
|
1321
|
+
declare const useLanguageContext: () => LanguageContextState;
|
|
1325
1322
|
|
|
1326
1323
|
declare enum LocaleEnum {
|
|
1327
1324
|
/** English */
|
|
@@ -1365,4 +1362,4 @@ declare const defaultNS = "translation";
|
|
|
1365
1362
|
declare const i18nLocalStorageKey = "orderly_i18nLng";
|
|
1366
1363
|
declare const i18nCookieKey = "orderly_i18nLng";
|
|
1367
1364
|
|
|
1368
|
-
export { type LocaleCode as L, type PopupMode as P, type Resources as R, type
|
|
1365
|
+
export { type AsyncResources as A, type LocaleCode as L, type PopupMode as P, type Resources as R, type LanguageContextState as a, type Language as b, type PopupProps as c, LanguageContext as d, type LocaleMessages as e, LocaleEnum as f, defaultLanguages as g, defaultLng as h, defaultNS as i, i18nLocalStorageKey as j, i18nCookieKey as k, en as l, useLanguageContext as u };
|
package/dist/constant.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { f as LocaleEnum, g as defaultLanguages, h as defaultLng, i as defaultNS, k as i18nCookieKey, j as i18nLocalStorageKey } from './constant-
|
|
1
|
+
export { f as LocaleEnum, g as defaultLanguages, h as defaultLng, i as defaultNS, k as i18nCookieKey, j as i18nLocalStorageKey } from './constant-DkvDyddr.mjs';
|
|
2
2
|
import 'react';
|
package/dist/constant.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { f as LocaleEnum, g as defaultLanguages, h as defaultLng, i as defaultNS, k as i18nCookieKey, j as i18nLocalStorageKey } from './constant-
|
|
1
|
+
export { f as LocaleEnum, g as defaultLanguages, h as defaultLng, i as defaultNS, k as i18nCookieKey, j as i18nLocalStorageKey } from './constant-DkvDyddr.js';
|
|
2
2
|
import 'react';
|
package/dist/constant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constant.ts"],"names":["LocaleEnum"],"mappings":";;;A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EACnD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,aAAA,EAAW;AAAA;AAAA,EACpD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,4CAAA,EAAU;AAAA;AAAA,EACnD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,kBAAA,EAAmB;AAAA;AAAA,EAC5D,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,cAAA,EAAS;AAAA;AAAA,EAClD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,UAAA,EAAW;AAAA;AAAA,EACpD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,cAAA,EAAY;AAAA;AAAA,EACrD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,8DAAA,EAAa;AAAA;AAAA,EACtD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,QAAA,EAAS;AAAA;AAAA,EAClD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,YAAA,EAAa;AAAA;AAAA,EACtD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,0BAAA;AAAO;AAClD;AACO,IAAM,UAAA,GAAa,IAAA;AACnB,IAAM,SAAA,GAAY;AAElB,IAAM,mBAAA,GAAsB;AAG5B,IAAM,aAAA,GAAgB","file":"constant.js","sourcesContent":["import { Language } from \"./provider/languageContext\";\n\nexport enum LocaleEnum {\n /** English */\n en = \"en\",\n /** Chinese */\n zh = \"zh\",\n /** Japanese */\n ja = \"ja\",\n /** Spanish */\n es = \"es\",\n /** Korean */\n ko = \"ko\",\n /** Vietnamese */\n vi = \"vi\",\n /** German */\n de = \"de\",\n /** French */\n fr = \"fr\",\n /** Russian */\n ru = \"ru\",\n /** Indonesian */\n id = \"id\",\n /** Turkish */\n tr = \"tr\",\n /** Italian */\n it = \"it\",\n /** Portuguese */\n pt = \"pt\",\n /** Ukrainian */\n uk = \"uk\",\n /** Polish */\n pl = \"pl\",\n /** Dutch */\n nl = \"nl\",\n /** Traditional Chinese */\n tc = \"tc\",\n}\n\nexport const defaultLanguages: Language[] = [\n { localCode: LocaleEnum.en, displayName: \"English\" }, // English\n { localCode: LocaleEnum.zh, displayName: \"中文\" }, // Chinese\n { localCode: LocaleEnum.ja, displayName: \"日本語\" }, // Japanese\n { localCode: LocaleEnum.es, displayName: \"Español\" }, // Spanish\n { localCode: LocaleEnum.ko, displayName: \"한국어\" }, // Korean\n { localCode: LocaleEnum.vi, displayName: \"Tiếng Việt\" }, // Vietnamese\n { localCode: LocaleEnum.de, displayName: \"Deutsch\" }, // German\n { localCode: LocaleEnum.fr, displayName: \"Français\" }, // French\n { localCode: LocaleEnum.ru, displayName: \"Русский\" }, // Russian\n { localCode: LocaleEnum.id, displayName: \"Bahasa Indonesia\" }, // Indonesian\n { localCode: LocaleEnum.tr, displayName: \"Türkçe\" }, // Turkish\n { localCode: LocaleEnum.it, displayName: \"Italiano\" }, // Italian\n { localCode: LocaleEnum.pt, displayName: \"Português\" }, // Portuguese\n { localCode: LocaleEnum.uk, displayName: \"Українська\" }, // Ukrainian\n { localCode: LocaleEnum.pl, displayName: \"Polski\" }, // Polish\n { localCode: LocaleEnum.nl, displayName: \"Nederlands\" }, // Dutch\n { localCode: LocaleEnum.tc, displayName: \"繁體中文\" }, // Traditional Chinese\n];\nexport const defaultLng = LocaleEnum.en;\nexport const defaultNS = \"translation\";\n\nexport const i18nLocalStorageKey = \"orderly_i18nLng\";\n\n// preferred-language\nexport const i18nCookieKey = \"orderly_i18nLng\";\n"]}
|
package/dist/constant.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constant.ts"],"names":["LocaleEnum"],"mappings":";AAEO,IAAK,UAAA,qBAAAA,WAAAA,KAAL;AAEL,EAAAA,YAAA,IAAA,CAAA,GAAK,IAAA;AAEL,EAAAA,YAAA,IAAA,CAAA,GAAK,IAAA;AAEL,EAAAA,YAAA,IAAA,CAAA,GAAK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A,EAAW,IAAA,WAAe,WAAA,EAAa,kBAAA,EAAmB;AAAA;AAAA,EAC5D,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,cAAA,EAAS;AAAA;AAAA,EAClD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,UAAA,EAAW;AAAA;AAAA,EACpD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,cAAA,EAAY;AAAA;AAAA,EACrD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,8DAAA,EAAa;AAAA;AAAA,EACtD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,QAAA,EAAS;AAAA;AAAA,EAClD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,YAAA,EAAa;AAAA;AAAA,EACtD,EAAE,SAAA,EAAW,IAAA,WAAe,WAAA,EAAa,0BAAA;AAAO;AAClD;AACO,IAAM,UAAA,GAAa,IAAA;AACnB,IAAM,SAAA,GAAY;AAElB,IAAM,mBAAA,GAAsB;AAG5B,IAAM,aAAA,GAAgB","file":"constant.mjs","sourcesContent":["import { Language } from \"./provider/languageContext\";\n\nexport enum LocaleEnum {\n /** English */\n en = \"en\",\n /** Chinese */\n zh = \"zh\",\n /** Japanese */\n ja = \"ja\",\n /** Spanish */\n es = \"es\",\n /** Korean */\n ko = \"ko\",\n /** Vietnamese */\n vi = \"vi\",\n /** German */\n de = \"de\",\n /** French */\n fr = \"fr\",\n /** Russian */\n ru = \"ru\",\n /** Indonesian */\n id = \"id\",\n /** Turkish */\n tr = \"tr\",\n /** Italian */\n it = \"it\",\n /** Portuguese */\n pt = \"pt\",\n /** Ukrainian */\n uk = \"uk\",\n /** Polish */\n pl = \"pl\",\n /** Dutch */\n nl = \"nl\",\n /** Traditional Chinese */\n tc = \"tc\",\n}\n\nexport const defaultLanguages: Language[] = [\n { localCode: LocaleEnum.en, displayName: \"English\" }, // English\n { localCode: LocaleEnum.zh, displayName: \"中文\" }, // Chinese\n { localCode: LocaleEnum.ja, displayName: \"日本語\" }, // Japanese\n { localCode: LocaleEnum.es, displayName: \"Español\" }, // Spanish\n { localCode: LocaleEnum.ko, displayName: \"한국어\" }, // Korean\n { localCode: LocaleEnum.vi, displayName: \"Tiếng Việt\" }, // Vietnamese\n { localCode: LocaleEnum.de, displayName: \"Deutsch\" }, // German\n { localCode: LocaleEnum.fr, displayName: \"Français\" }, // French\n { localCode: LocaleEnum.ru, displayName: \"Русский\" }, // Russian\n { localCode: LocaleEnum.id, displayName: \"Bahasa Indonesia\" }, // Indonesian\n { localCode: LocaleEnum.tr, displayName: \"Türkçe\" }, // Turkish\n { localCode: LocaleEnum.it, displayName: \"Italiano\" }, // Italian\n { localCode: LocaleEnum.pt, displayName: \"Português\" }, // Portuguese\n { localCode: LocaleEnum.uk, displayName: \"Українська\" }, // Ukrainian\n { localCode: LocaleEnum.pl, displayName: \"Polski\" }, // Polish\n { localCode: LocaleEnum.nl, displayName: \"Nederlands\" }, // Dutch\n { localCode: LocaleEnum.tc, displayName: \"繁體中文\" }, // Traditional Chinese\n];\nexport const defaultLng = LocaleEnum.en;\nexport const defaultNS = \"translation\";\n\nexport const i18nLocalStorageKey = \"orderly_i18nLng\";\n\n// preferred-language\nexport const i18nCookieKey = \"orderly_i18nLng\";\n"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,54 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { b as Language, d as
|
|
1
|
+
import { R as Resources, A as AsyncResources, L as LocaleCode, a as LanguageContextState } from './constant-DkvDyddr.mjs';
|
|
2
|
+
export { b as Language, d as LanguageContext, f as LocaleEnum, e as LocaleMessages, P as PopupMode, c as PopupProps, g as defaultLanguages, h as defaultLng, i as defaultNS, l as en, k as i18nCookieKey, j as i18nLocalStorageKey, u as useLanguageContext } from './constant-DkvDyddr.mjs';
|
|
3
3
|
import * as react_i18next from 'react-i18next';
|
|
4
|
-
import {
|
|
4
|
+
import { FallbackNs, UseTranslationOptions } from 'react-i18next';
|
|
5
5
|
export * from 'react-i18next';
|
|
6
6
|
import * as i18next from 'i18next';
|
|
7
7
|
import { InitOptions, FlatNamespace, KeyPrefix } from 'i18next';
|
|
8
8
|
export { createInstance, default as i18next } from 'i18next';
|
|
9
|
-
import {
|
|
9
|
+
import { PropsWithChildren, FC } from 'react';
|
|
10
10
|
import { $Tuple } from 'react-i18next/helpers';
|
|
11
11
|
export { generatePath, getLocalePathFromPathname, parseI18nLang, removeLangPrefix } from './utils.mjs';
|
|
12
12
|
|
|
13
13
|
declare function createI18nInstance(options?: InitOptions): i18next.i18n;
|
|
14
14
|
declare const i18n: i18next.i18n;
|
|
15
15
|
|
|
16
|
+
declare function registerResources(resources: Resources | AsyncResources | undefined, localeCode: LocaleCode): Promise<void>;
|
|
17
|
+
|
|
16
18
|
type BackendOptions = {
|
|
17
19
|
loadPath: (lang: LocaleCode, ns: string) => string | string[] | undefined;
|
|
18
20
|
};
|
|
21
|
+
declare class Backend {
|
|
22
|
+
options: BackendOptions;
|
|
23
|
+
cache: Set<string>;
|
|
24
|
+
constructor(options: BackendOptions);
|
|
25
|
+
fetchData(url: string): Promise<any>;
|
|
26
|
+
loadLanguage(lang: LocaleCode, ns: string): Promise<void>;
|
|
27
|
+
}
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Register the default language bundle before your React tree renders to reduce
|
|
31
|
+
* flicker of raw translation keys.
|
|
32
|
+
*/
|
|
33
|
+
declare const registerDefaultResource: (messages: Record<string, string>) => void;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Shape of a locale JSON file loaded via dynamic import / Vite `import.meta.glob`.
|
|
37
|
+
*/
|
|
38
|
+
type LocaleJsonModule = {
|
|
39
|
+
default?: Record<string, string> | string | null;
|
|
40
|
+
};
|
|
41
|
+
declare function asMessageRecord(value: Record<string, string> | string | null | undefined): Record<string, string>;
|
|
42
|
+
/**
|
|
43
|
+
* Loads a locale JSON module via a Vite `import.meta.glob` loader or a dynamic `import()` thunk,
|
|
44
|
+
* and normalizes `default` to a flat message record.
|
|
45
|
+
* Missing `loader`, rejected `loader()`, or missing/invalid `default` yields `{}` (see {@link asMessageRecord}).
|
|
46
|
+
*/
|
|
47
|
+
declare function importLocaleJsonModule(loader: (() => Promise<LocaleJsonModule>) | undefined): Promise<Record<string, string>>;
|
|
48
|
+
|
|
49
|
+
type LanguageProviderProps = PropsWithChildren<{
|
|
50
|
+
backend?: BackendOptions;
|
|
27
51
|
/**
|
|
28
52
|
* supported languages, you can select supported languages from default languages
|
|
29
53
|
*/
|
|
30
54
|
supportedLanguages?: LocaleCode[];
|
|
31
55
|
/** optional conversion function to use to modify the detected language code */
|
|
32
56
|
convertDetectedLanguage?: (lang: string) => LocaleCode;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
declare const LocaleProvider: React.FC<LocaleProviderProps>;
|
|
57
|
+
} & Partial<LanguageContextState>>;
|
|
58
|
+
declare const LanguageProvider: FC<LanguageProviderProps>;
|
|
36
59
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
type LocaleProviderProps = LanguageProviderProps & {
|
|
61
|
+
/** Active locale; when set and bundles exist, syncs i18n language via `changeLanguage`. */
|
|
62
|
+
locale?: LocaleCode;
|
|
63
|
+
/** Flat key-value messages for `defaultNS`; used together with `locale` when `resources` is not provided. */
|
|
64
|
+
resource?: Record<string, string>;
|
|
65
|
+
/**
|
|
66
|
+
* Preload locale bundles: static `Resources` map, or an async loader (same contract as
|
|
67
|
+
* `ExternalLocaleProvider`). When set, takes precedence over `locale` + `resource`.
|
|
68
|
+
*/
|
|
69
|
+
resources?: Resources | AsyncResources;
|
|
70
|
+
};
|
|
71
|
+
declare const LocaleProvider: FC<LocaleProviderProps>;
|
|
45
72
|
|
|
46
|
-
/**
|
|
47
|
-
* Async loader contract for pulling translation resources from an external system.
|
|
48
|
-
* Implementations are expected to return the full message table for the given locale
|
|
49
|
-
* and namespace so that the bundle can be replaced atomically.
|
|
50
|
-
*/
|
|
51
|
-
type AsyncResources = (lang: LocaleCode, ns: string) => Promise<Record<string, string>>;
|
|
52
73
|
type ExternalLocaleProviderProps = PropsWithChildren<{
|
|
53
74
|
resources?: Resources | AsyncResources;
|
|
54
75
|
}>;
|
|
@@ -62,8 +83,26 @@ type ExternalLocaleProviderProps = PropsWithChildren<{
|
|
|
62
83
|
* synchronously on mount.
|
|
63
84
|
*
|
|
64
85
|
* This component renders no UI; it only manages i18n side effects and simply
|
|
65
|
-
* returns its children.
|
|
86
|
+
* returns its children. Same behavior as calling `useRegisterExternalResources(resources)`
|
|
87
|
+
* in your own component under `LocaleProvider`.
|
|
66
88
|
*/
|
|
67
89
|
declare const ExternalLocaleProvider: FC<ExternalLocaleProviderProps>;
|
|
68
90
|
|
|
69
|
-
|
|
91
|
+
declare function useTranslation<Ns extends FlatNamespace | $Tuple<FlatNamespace> | undefined, KPrefix extends KeyPrefix<FallbackNs<Ns>> = undefined>(ns?: Ns, options?: UseTranslationOptions<KPrefix>): react_i18next.UseTranslationResponse<FallbackNs<Ns>, KPrefix>;
|
|
92
|
+
|
|
93
|
+
declare function useLocaleCode(): LocaleCode;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Registers host-provided i18n resources into the shared i18n instance whenever
|
|
97
|
+
* the active locale or `resources` reference changes.
|
|
98
|
+
*
|
|
99
|
+
* - When `resources` is a function, it is invoked for the current locale to
|
|
100
|
+
* load the bundle (e.g. from another bundle, backend, or runtime loader).
|
|
101
|
+
* - When `resources` is a static map, all provided locale bundles are registered.
|
|
102
|
+
*
|
|
103
|
+
* Prefer a stable `resources` reference (e.g. `useCallback` for loaders, module
|
|
104
|
+
* scope or `useMemo` for static maps) to avoid unnecessary re-registration.
|
|
105
|
+
*/
|
|
106
|
+
declare function useRegisterExternalResources(resources?: Resources | AsyncResources): void;
|
|
107
|
+
|
|
108
|
+
export { AsyncResources, Backend, type BackendOptions, ExternalLocaleProvider, type ExternalLocaleProviderProps, LanguageContextState, LanguageProvider, type LanguageProviderProps, LocaleCode, type LocaleJsonModule, LocaleProvider, type LocaleProviderProps, Resources, asMessageRecord, createI18nInstance, i18n, importLocaleJsonModule, registerDefaultResource, registerResources, useLocaleCode, useRegisterExternalResources, useTranslation };
|