@orderly.network/i18n 3.0.0-beta.0 → 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
package/dist/index.d.ts
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.js';
|
|
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.js';
|
|
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.js';
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -99,6 +99,10 @@ var affiliate = {
|
|
|
99
99
|
"affiliate.referralCode.label": "Enter referral code",
|
|
100
100
|
"affiliate.referralCode.bound": "Referral code bound",
|
|
101
101
|
"affiliate.referralCode.notExist": "This referral code does not exist.",
|
|
102
|
+
"affiliate.referralCode.bind.modal.title": "Were you referred by someone?",
|
|
103
|
+
"affiliate.referralCode.bind.modal.description": "If an affiliate shared their referral code with you, enter it below to bind your account and receive affiliate benefits.",
|
|
104
|
+
"affiliate.referralCode.bind.input.placeholder": "Enter referrer's code",
|
|
105
|
+
"affiliate.referralCode.bind.skip": "No, I was not referred by anyone",
|
|
102
106
|
"affiliate.process.title": "How It Works",
|
|
103
107
|
"affiliate.process.step1.title": "Trade $10,000+ or apply",
|
|
104
108
|
"affiliate.process.step1.description": "Unlock a referral code automatically ($0 of $10,000 completed - main account only), or apply for a higher rate via the form.",
|
|
@@ -130,7 +134,7 @@ var affiliate = {
|
|
|
130
134
|
"affiliate.base": "Affiliate",
|
|
131
135
|
"affiliate.directBonus": "Direct bonus",
|
|
132
136
|
"affiliate.commission.30d": "30d commission",
|
|
133
|
-
"affiliate.commission.column.activeUsers": "
|
|
137
|
+
"affiliate.commission.column.activeUsers": "New traders",
|
|
134
138
|
"affiliate.myReferees": "My referees",
|
|
135
139
|
"affiliate.referees": "Referees",
|
|
136
140
|
"affiliate.referees.column.refereeAddress": "Referee address",
|
|
@@ -160,6 +164,7 @@ var affiliate = {
|
|
|
160
164
|
"affiliate.direct": "Direct",
|
|
161
165
|
"affiliate.directInclBonus": "Incl. {{amount}} bonus",
|
|
162
166
|
"affiliate.indirect": "Indirect",
|
|
167
|
+
"affiliate.referredBy": "Referred by {{name}}",
|
|
163
168
|
"affiliate.referrals": "Referrals",
|
|
164
169
|
"affiliate.referralCode.edit.modal.title": "Configure your referral settings",
|
|
165
170
|
"affiliate.referralCode.create": "Create referral code",
|
|
@@ -465,6 +470,7 @@ var markets = {
|
|
|
465
470
|
"markets.favorites": "Favorites",
|
|
466
471
|
"markets.recent": "Recent",
|
|
467
472
|
"markets.newListings": "New listings",
|
|
473
|
+
"markets.community": "Community",
|
|
468
474
|
"markets.allMarkets": "All markets",
|
|
469
475
|
"markets.openInterest": "Open interest",
|
|
470
476
|
"markets.openInterest.tooltip": "Total size of positions per side.",
|
|
@@ -514,7 +520,13 @@ var markets = {
|
|
|
514
520
|
"markets.symbolInfoBar.24hVolume": "24h volume",
|
|
515
521
|
"markets.symbolInfoBar.24hVolume.tooltip": "24 hour total trading volume on the Orderly Network.",
|
|
516
522
|
"markets.symbolInfoBar.predFundingRate": "Est. funding rate",
|
|
517
|
-
"markets.symbolInfoBar.predFundingRate.tooltip": "Funding rates are payments between traders who are long and short. When positive, long positions pay short positions funding. When negative, short positions pay long positions."
|
|
523
|
+
"markets.symbolInfoBar.predFundingRate.tooltip": "Funding rates are payments between traders who are long and short. When positive, long positions pay short positions funding. When negative, short positions pay long positions.",
|
|
524
|
+
"markets.symbolInfoBar.riskNotice.content": "{{symbolWithBroker}} is a permissionless listing supported on Isolated Margin only, deployed and operated independently by {{brokerName}}. Please be aware of elevated risks, including low liquidity, high volatility, and increased liquidation risk."
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
// src/locale/module/navigation.ts
|
|
528
|
+
var navigation = {
|
|
529
|
+
"tradingPoints.points": "Points"
|
|
518
530
|
};
|
|
519
531
|
|
|
520
532
|
// src/locale/module/notification.ts
|
|
@@ -559,6 +571,7 @@ var orderEntry = {
|
|
|
559
571
|
"orderEntry.orderType.ioc.tooltip": "Executes immediately; any unfilled amount is canceled.",
|
|
560
572
|
"orderEntry.orderType.fok": "FOK",
|
|
561
573
|
"orderEntry.orderType.fok.tooltip": "Executes immediately in full, or is canceled entirely.",
|
|
574
|
+
"orderEntry.orderType.symbolPostOnly.tooltip": "This symbol is in POST_ONLY mode. Only limit orders are accepted until the order book is ready.",
|
|
562
575
|
"orderEntry.orderType.scaledOrder": "Scaled",
|
|
563
576
|
"orderEntry.orderType.trailingStop": "Trailing stop",
|
|
564
577
|
"orderEntry.orderSize": "Order size",
|
|
@@ -631,10 +644,13 @@ var orderEntry = {
|
|
|
631
644
|
"marginMode.current": "Current",
|
|
632
645
|
"marginMode.marginModeSettings": "Margin mode settings",
|
|
633
646
|
"marginMode.updatedSuccessfully": "Updated successfully",
|
|
647
|
+
"marginMode.noEditableSymbolsSelected": "No editable symbols selected",
|
|
648
|
+
"marginMode.failedToUpdateMarginMode": "Failed to update margin mode",
|
|
634
649
|
"marginMode.perpetualFutures": "Perpetual futures",
|
|
635
650
|
"marginMode.searchPlaceholder": "Search",
|
|
636
651
|
"marginMode.selectAll": "Select all",
|
|
637
652
|
"marginMode.setAs": "Set as",
|
|
653
|
+
"marginMode.disabledSymbolTooltip": "This symbol is independently operated by a third party. Isolated Margin is enforced to prevent risk from affecting your other positions.",
|
|
638
654
|
"orderEntry.startPrice.error.required": "Start price is required",
|
|
639
655
|
"orderEntry.startPrice.error.min": "Start price must be greater than {{value}}",
|
|
640
656
|
"orderEntry.startPrice.error.max": "Start price must be less than {{value}}",
|
|
@@ -663,7 +679,12 @@ var orderEntry = {
|
|
|
663
679
|
"orderEntry.reduceOnly.reminder": "Reduce-only reminder",
|
|
664
680
|
"orderEntry.reduceOnly.reminder.content": "Your account is in reduce-only and cannot open new positions. Would you like to turn off reduce-only mode and proceed with the\xA0order?",
|
|
665
681
|
"orderEntry.placeOrderNow": "Place order now",
|
|
666
|
-
"orderEntry.maxQty.reminder.content": "Order qty reduced to max available: {{maxQty}}"
|
|
682
|
+
"orderEntry.maxQty.reminder.content": "Order qty reduced to max available: {{maxQty}}",
|
|
683
|
+
"orderEntry.permissionlessNotice.title": "Community-Listed Market Notice",
|
|
684
|
+
"orderEntry.permissionlessNotice.content1": "This market was listed by a third-party deployer through the permissionless listing system.",
|
|
685
|
+
"orderEntry.permissionlessNotice.content2": "It is not created, reviewed, or endorsed by Orderly. Such markets may involve low liquidity, high volatility, incomplete information, or increased liquidation risk.",
|
|
686
|
+
"orderEntry.permissionlessNotice.content3": "Please review the deployer's documentation and trade at your own risk.",
|
|
687
|
+
"orderEntry.permissionlessNotice.checkbox": "I understand this is a community-listed market and accept the risks."
|
|
667
688
|
};
|
|
668
689
|
|
|
669
690
|
// src/locale/module/orders.ts
|
|
@@ -730,6 +751,8 @@ var portfolio = {
|
|
|
730
751
|
"portfolio.overview.performance.cumulativePnl": "Cumulative PnL",
|
|
731
752
|
"portfolio.overview.performance.dailyVolume": "Daily Volume",
|
|
732
753
|
"portfolio.overview.performance.cumulativeVolume": "Cumulative Volume",
|
|
754
|
+
"portfolio.overview.todaysPnl": "Today's PnL",
|
|
755
|
+
"portfolio.overview.todaysVol": "Today's Vol",
|
|
733
756
|
"portfolio.overview.distribution": "Distribution",
|
|
734
757
|
"portfolio.overview.transferHistory": "Transfer history",
|
|
735
758
|
"portfolio.overview.vaults": "Vaults",
|
|
@@ -1063,6 +1086,7 @@ var trading = {
|
|
|
1063
1086
|
"trading.rwa.tooltip.openIn": "Regular trading hours will open in <0>{{timeFormat}}</0>",
|
|
1064
1087
|
"trading.rwa.tooltip.checkDetailRules": "Check detail rules",
|
|
1065
1088
|
"trading.rwa.countdown.title": "US markets are closing soon, volatility may be lower.",
|
|
1089
|
+
"trading.symbolDelisting": "{{symbol}} has entered forced deleveraging mode (insufficient liquidity depth / insufficient IF balance). Your position on this symbol only allows closing operations.",
|
|
1066
1090
|
"trading.rwa.outsideMarketHours.notify": "This market is currently outside regular trading hours. You can still place a trade, but please be aware of reduced liquidity and potential risks.",
|
|
1067
1091
|
"trading.rwa.mWeb.outsideMarketHours.desc": "Regular trading hours are about to close - 24/7 trading continues; price may slow and liquidity may be lower.",
|
|
1068
1092
|
"trading.rwa.mWeb.insideMarketHours.desc": "Regular trading hours are about to open - get ready."
|
|
@@ -1106,46 +1130,6 @@ var tradingLeaderboard = {
|
|
|
1106
1130
|
"tradingLeaderboard.tradingVolume.tooltip": "Total trading volume generated during the campaign period. Updated every 30 seconds."
|
|
1107
1131
|
};
|
|
1108
1132
|
|
|
1109
|
-
// src/locale/module/tradingPoints.ts
|
|
1110
|
-
var tradingPoints = {
|
|
1111
|
-
"tradingPoints.points": "Points",
|
|
1112
|
-
"tradingPoints.startsIn": "Starts in",
|
|
1113
|
-
"tradingPoints.days": "Days",
|
|
1114
|
-
"tradingPoints.hours": "Hours",
|
|
1115
|
-
"tradingPoints.minutes": "Minutes",
|
|
1116
|
-
"tradingPoints.seconds": "Seconds",
|
|
1117
|
-
"tradingPoints.learnMore": "Learn more",
|
|
1118
|
-
"tradingPoints.stagePoints": "Stage points",
|
|
1119
|
-
"tradingPoints.stageRanking": "Stage ranking",
|
|
1120
|
-
"tradingPoints.referralCode": "Referral code",
|
|
1121
|
-
"tradingPoints.referralLink": "Referral link",
|
|
1122
|
-
"tradingPoints.currentPoints": "Current points",
|
|
1123
|
-
"tradingPoints.ranking": "Ranking",
|
|
1124
|
-
"tradingPoints.myPoints": "My points",
|
|
1125
|
-
"tradingPoints.thisWeek": "This week",
|
|
1126
|
-
"tradingPoints.lastWeek": "Last week",
|
|
1127
|
-
"tradingPoints.all": "All",
|
|
1128
|
-
"tradingPoints.tradePoints": "Trade points",
|
|
1129
|
-
"tradingPoints.tradePointsTooltip": "Trade Points are calculated based on your perps trading volume.Updated daily.",
|
|
1130
|
-
"tradingPoints.tradeNow": "Trade now",
|
|
1131
|
-
"tradingPoints.pnlPoints": "PNL points",
|
|
1132
|
-
"tradingPoints.pnlPointsTooltip": "Both profit or loss of each trade will be recorded. Updated daily.",
|
|
1133
|
-
"tradingPoints.referralPoints": "Referral points",
|
|
1134
|
-
"tradingPoints.referralPointsTooltip": "First-level invitee's rebates: {{l1}}%, Second-level invitee's rebates: {{l2}}%, Update daily.",
|
|
1135
|
-
"tradingPoints.copyLink": "Copy Link",
|
|
1136
|
-
"tradingPoints.faq.title": "FAQ",
|
|
1137
|
-
"tradingPoints.faq.whatArePoints.question": "What are Points?",
|
|
1138
|
-
"tradingPoints.faq.whatArePoints.answer": "The Points program is designed to encourage genuine user engagement with products and to reward loyal users who actively contribute to the growth of the {{brokerName}} ecosystem. Rewards will be airdropped in the future based on users' point accumulation.",
|
|
1139
|
-
"tradingPoints.faq.allocation.question": "What is the points allocation criteria?",
|
|
1140
|
-
"tradingPoints.faq.allocation.answer": "Points = Trade points + PNL points + Referral points.\n\nThe page will update your points daily, calculating the points you are expected to receive based on your contribution.\n\nNote: Wash trading (e.g., self-trades) will not receive any points",
|
|
1141
|
-
"tradingPoints.faq.distribution.question": "When will points be distributed?",
|
|
1142
|
-
"tradingPoints.faq.distribution.answer": "Points are distributed at 08:00 UTC everyday.",
|
|
1143
|
-
"tradingPoints.faq.pnl.question": "How are PNL points calculated?",
|
|
1144
|
-
"tradingPoints.faq.pnl.answer": "Points are based on your net profit or loss each trading.",
|
|
1145
|
-
"tradingPoints.faq.referral.question": "How does the referral work?",
|
|
1146
|
-
"tradingPoints.faq.referral.answer": "Based on the total points of your invitees and their invitees. Points earned from first-level invitees are higher than those from second-level invitees. Updated daily."
|
|
1147
|
-
};
|
|
1148
|
-
|
|
1149
1133
|
// src/locale/module/tradingRewards.ts
|
|
1150
1134
|
var tradingRewards = {
|
|
1151
1135
|
"tradingRewards.rewards": "Rewards",
|
|
@@ -1199,6 +1183,7 @@ var tradingView = {
|
|
|
1199
1183
|
"tradingView.displayControl.buySell": "Buy/Sell",
|
|
1200
1184
|
"tradingView.displayControl.limitOrders": "Limit orders",
|
|
1201
1185
|
"tradingView.displayControl.stopOrders": "Stop orders",
|
|
1186
|
+
"tradingView.displayControl.liquidationPrice": "Liquidation Price",
|
|
1202
1187
|
"tradingView.noScriptSrc": "Due to TradingView's policy, you will need to apply for your own license.",
|
|
1203
1188
|
"tradingView.noScriptSrc.1": "1. Please apply for your TradingView Advanced Chart license <0>here</0>",
|
|
1204
1189
|
"tradingView.noScriptSrc.2": "2. Follow the instructions on <0>orderly.network</0> to set up."
|
|
@@ -1221,10 +1206,20 @@ var transfer = {
|
|
|
1221
1206
|
"transfer.deposit.requested": "Deposit requested",
|
|
1222
1207
|
"transfer.deposit.completed": "Deposit completed",
|
|
1223
1208
|
"transfer.deposit.failed": "Deposit failed",
|
|
1209
|
+
"transfer.exclusiveDeposit.warning": "Only send {{token}} on {{network}} to this address. Sending other tokens, using other chains, or amounts below the minimum deposit will result in permanent loss of funds.",
|
|
1210
|
+
"transfer.exclusiveDeposit.selectFirst": "Select your network and token first",
|
|
1211
|
+
"transfer.exclusiveDeposit.selectNetwork": "Select network",
|
|
1212
|
+
"transfer.exclusiveDeposit.selectToken": "Select token",
|
|
1213
|
+
"transfer.exclusiveDeposit.minDeposit": "Min. deposit",
|
|
1214
|
+
"transfer.exclusiveDeposit.estimatedTime": "Estimated time",
|
|
1215
|
+
"transfer.exclusiveDeposit.estimatedTime.default": "~ 5 min",
|
|
1216
|
+
"transfer.exclusiveDeposit.depositPending": "Deposit pending: {{amount}} {{symbol}}",
|
|
1224
1217
|
"transfer.deposit.feeUnavailable": "Fee data is currently unavailable. Please try again later.",
|
|
1225
1218
|
"transfer.deposit.notEnoughGas": "Not enough gas. Add some {{token}} to your wallet to continue.",
|
|
1226
1219
|
"transfer.deposit.exceedCap": "Amount exceeds user deposit cap",
|
|
1227
1220
|
"transfer.deposit.closeToMaxLimit": "Deposit amount too close to maximum limit. To ensure your transaction succeeds, please reduce the amount",
|
|
1221
|
+
"transfer.deposit.tab.connectedWallet": "From connected wallet",
|
|
1222
|
+
"transfer.deposit.tab.exchangeOrOtherWallet": "From exchange / other wallet",
|
|
1228
1223
|
"transfer.deposit.estGasFee": "Est. gas fee",
|
|
1229
1224
|
"transfer.deposit.estGasFee.tooltip": "Estimated gas fee includes: transaction execution cost on this chain, and destination chain operation fee for Orderly deposit. Please prepare extra to ensure sufficient coverage.",
|
|
1230
1225
|
"transfer.deposit.destinationGasFee": "Destination gas fee",
|
|
@@ -1479,10 +1474,10 @@ var en = {
|
|
|
1479
1474
|
...affiliate,
|
|
1480
1475
|
...ui,
|
|
1481
1476
|
...tradingLeaderboard,
|
|
1482
|
-
...tradingPoints,
|
|
1483
1477
|
...widget,
|
|
1484
1478
|
...vaults,
|
|
1485
|
-
...notification
|
|
1479
|
+
...notification,
|
|
1480
|
+
...navigation
|
|
1486
1481
|
};
|
|
1487
1482
|
|
|
1488
1483
|
// src/i18n.ts
|
|
@@ -1510,8 +1505,30 @@ var i18n = createI18nInstance({
|
|
|
1510
1505
|
});
|
|
1511
1506
|
i18n.init();
|
|
1512
1507
|
var i18n_default = i18n;
|
|
1508
|
+
var LanguageContext = react.createContext({
|
|
1509
|
+
languages: [],
|
|
1510
|
+
onLanguageBeforeChanged: () => Promise.resolve(),
|
|
1511
|
+
onLanguageChanged: () => Promise.resolve()
|
|
1512
|
+
});
|
|
1513
|
+
var useLanguageContext = () => {
|
|
1514
|
+
return react.useContext(LanguageContext);
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1517
|
+
// src/resourceBundles/registerResources.ts
|
|
1518
|
+
async function registerResources(resources2, localeCode) {
|
|
1519
|
+
if (typeof resources2 === "function") {
|
|
1520
|
+
const resource = await resources2(localeCode, defaultNS);
|
|
1521
|
+
i18n_default.addResourceBundle(localeCode, defaultNS, resource, true, true);
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
if (resources2) {
|
|
1525
|
+
Object.entries(resources2).forEach(([locale, messages]) => {
|
|
1526
|
+
i18n_default.addResourceBundle(locale, defaultNS, messages, true, true);
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1513
1530
|
|
|
1514
|
-
// src/
|
|
1531
|
+
// src/resourceBundles/httpBackend.ts
|
|
1515
1532
|
var Backend = class {
|
|
1516
1533
|
constructor(options) {
|
|
1517
1534
|
this.options = options;
|
|
@@ -1555,15 +1572,38 @@ var Backend = class {
|
|
|
1555
1572
|
await Promise.all(promises);
|
|
1556
1573
|
}
|
|
1557
1574
|
};
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
});
|
|
1563
|
-
var useLocaleContext = () => {
|
|
1564
|
-
return react.useContext(LocaleContext);
|
|
1575
|
+
|
|
1576
|
+
// src/resourceBundles/registerDefaultResource.ts
|
|
1577
|
+
var registerDefaultResource = (messages) => {
|
|
1578
|
+
i18n_default.addResourceBundle(defaultLng, defaultNS, messages, true, true);
|
|
1565
1579
|
};
|
|
1566
1580
|
|
|
1581
|
+
// src/resourceBundles/importLocaleJsonModule.ts
|
|
1582
|
+
function asMessageRecord(value) {
|
|
1583
|
+
if (!value) {
|
|
1584
|
+
return {};
|
|
1585
|
+
}
|
|
1586
|
+
if (typeof value !== "string") {
|
|
1587
|
+
return value;
|
|
1588
|
+
}
|
|
1589
|
+
try {
|
|
1590
|
+
return JSON.parse(value);
|
|
1591
|
+
} catch {
|
|
1592
|
+
return {};
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
async function importLocaleJsonModule(loader) {
|
|
1596
|
+
if (!loader) {
|
|
1597
|
+
return asMessageRecord(void 0);
|
|
1598
|
+
}
|
|
1599
|
+
try {
|
|
1600
|
+
const mod = await loader();
|
|
1601
|
+
return asMessageRecord(mod.default);
|
|
1602
|
+
} catch {
|
|
1603
|
+
return {};
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1567
1607
|
// src/utils.ts
|
|
1568
1608
|
function parseI18nLang(lang, localeCodes, defaultLang) {
|
|
1569
1609
|
localeCodes = localeCodes || Object.values(LocaleEnum);
|
|
@@ -1601,19 +1641,9 @@ function generatePath(params) {
|
|
|
1601
1641
|
localePath = locale || parseI18nLang(i18n_default.language);
|
|
1602
1642
|
return `/${localePath}${path}${searchUrl}`;
|
|
1603
1643
|
}
|
|
1604
|
-
var
|
|
1605
|
-
const { children, ...rest } = props;
|
|
1606
|
-
return (
|
|
1607
|
-
// @ts-ignore
|
|
1608
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactI18next.I18nextProvider, { ...rest, children })
|
|
1609
|
-
);
|
|
1610
|
-
};
|
|
1611
|
-
var LocaleProvider = (props) => {
|
|
1644
|
+
var LanguageProvider = (props) => {
|
|
1612
1645
|
const {
|
|
1613
1646
|
children,
|
|
1614
|
-
locale,
|
|
1615
|
-
resource,
|
|
1616
|
-
resources: resources2,
|
|
1617
1647
|
backend,
|
|
1618
1648
|
popup,
|
|
1619
1649
|
supportedLanguages,
|
|
@@ -1623,22 +1653,6 @@ var LocaleProvider = (props) => {
|
|
|
1623
1653
|
} = props;
|
|
1624
1654
|
const [languages, setLanguages] = react.useState(defaultLanguages);
|
|
1625
1655
|
const backendRef = react.useRef(new Backend(backend));
|
|
1626
|
-
react.useEffect(() => {
|
|
1627
|
-
if (resources2) {
|
|
1628
|
-
Object.entries(resources2).forEach(([locale2, messages]) => {
|
|
1629
|
-
i18n_default.addResourceBundle(locale2, defaultNS, messages, true, true);
|
|
1630
|
-
});
|
|
1631
|
-
return;
|
|
1632
|
-
}
|
|
1633
|
-
if (resource && locale) {
|
|
1634
|
-
i18n_default.addResourceBundle(locale, defaultNS, resource, true, true);
|
|
1635
|
-
}
|
|
1636
|
-
}, [locale, resource, resources2]);
|
|
1637
|
-
react.useEffect(() => {
|
|
1638
|
-
if (locale && locale !== i18n_default.language) {
|
|
1639
|
-
i18n_default.changeLanguage(locale);
|
|
1640
|
-
}
|
|
1641
|
-
}, [locale]);
|
|
1642
1656
|
react.useEffect(() => {
|
|
1643
1657
|
if (Array.isArray(props.languages)) {
|
|
1644
1658
|
setLanguages(props.languages);
|
|
@@ -1649,7 +1663,7 @@ var LocaleProvider = (props) => {
|
|
|
1649
1663
|
).filter((item) => !!item)
|
|
1650
1664
|
);
|
|
1651
1665
|
}
|
|
1652
|
-
}, [
|
|
1666
|
+
}, [props.languages, supportedLanguages]);
|
|
1653
1667
|
react.useEffect(() => {
|
|
1654
1668
|
const initLanguage = async () => {
|
|
1655
1669
|
const lang = typeof convertDetectedLanguage === "function" ? convertDetectedLanguage(i18n_default.language) : parseI18nLang(i18n_default.language);
|
|
@@ -1681,59 +1695,62 @@ var LocaleProvider = (props) => {
|
|
|
1681
1695
|
onLanguageChanged: languageChangedHandle
|
|
1682
1696
|
};
|
|
1683
1697
|
}, [popup, languages, languageBeforeChangedHandle, languageChangedHandle]);
|
|
1684
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1698
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LanguageContext.Provider, { value: memoizedValue, children });
|
|
1685
1699
|
};
|
|
1686
|
-
function useTranslation(ns, options) {
|
|
1687
|
-
const context = react.useContext(reactI18next.I18nContext);
|
|
1688
|
-
return reactI18next.useTranslation(ns, {
|
|
1689
|
-
i18n: context?.i18n || i18n_default,
|
|
1690
|
-
// @ts-ignore
|
|
1691
|
-
// when the language resource is loaded, notify the translation component to re-render
|
|
1692
|
-
bindI18nStore: "added",
|
|
1693
|
-
...options
|
|
1694
|
-
});
|
|
1695
|
-
}
|
|
1696
1700
|
function useLocaleCode() {
|
|
1697
|
-
const [
|
|
1701
|
+
const [localeCode, setLocaleCode] = react.useState(
|
|
1698
1702
|
parseI18nLang(i18n_default.language)
|
|
1699
1703
|
);
|
|
1700
1704
|
react.useEffect(() => {
|
|
1701
1705
|
const handleLanguageChange = (lng) => {
|
|
1702
|
-
|
|
1706
|
+
setLocaleCode(lng);
|
|
1703
1707
|
};
|
|
1704
1708
|
i18n_default.on("languageChanged", handleLanguageChange);
|
|
1705
1709
|
return () => {
|
|
1706
1710
|
i18n_default.off("languageChanged", handleLanguageChange);
|
|
1707
1711
|
};
|
|
1708
1712
|
}, [i18n_default]);
|
|
1709
|
-
return
|
|
1713
|
+
return localeCode;
|
|
1710
1714
|
}
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
i18n_default.addResourceBundle(defaultLng, defaultNS, messages, true, true);
|
|
1715
|
-
};
|
|
1716
|
-
var asyncAddResource = async (localeCode, resources2) => {
|
|
1717
|
-
const resource = await resources2(localeCode, defaultNS);
|
|
1718
|
-
i18n_default.addResourceBundle(localeCode, defaultNS, resource, true, true);
|
|
1719
|
-
};
|
|
1720
|
-
var ExternalLocaleProvider = (props) => {
|
|
1721
|
-
const { resources: resources2 } = props;
|
|
1722
|
-
const localeCode = useLocaleCode();
|
|
1715
|
+
var LocaleProvider = (props) => {
|
|
1716
|
+
const { children, locale, resource, resources: resources2, ...languageProviderProps } = props;
|
|
1717
|
+
const localeCodeFromI18n = useLocaleCode();
|
|
1723
1718
|
react.useEffect(() => {
|
|
1724
|
-
if (typeof resources2 === "function") {
|
|
1725
|
-
asyncAddResource(localeCode, resources2);
|
|
1726
|
-
return;
|
|
1727
|
-
}
|
|
1728
1719
|
if (resources2) {
|
|
1729
|
-
|
|
1730
|
-
i18n_default.addResourceBundle(locale, defaultNS, messages, true, true);
|
|
1731
|
-
});
|
|
1720
|
+
registerResources(resources2, locale ?? localeCodeFromI18n);
|
|
1732
1721
|
return;
|
|
1733
1722
|
}
|
|
1723
|
+
if (resource && locale) {
|
|
1724
|
+
i18n_default.addResourceBundle(locale, defaultNS, resource, true, true);
|
|
1725
|
+
}
|
|
1726
|
+
}, [locale, localeCodeFromI18n, resource, resources2]);
|
|
1727
|
+
react.useEffect(() => {
|
|
1728
|
+
if (locale && locale !== i18n_default.language) {
|
|
1729
|
+
i18n_default.changeLanguage(locale);
|
|
1730
|
+
}
|
|
1731
|
+
}, [locale]);
|
|
1732
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LanguageProvider, { ...languageProviderProps, children: /* @__PURE__ */ jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18n_default, defaultNS, children }) });
|
|
1733
|
+
};
|
|
1734
|
+
function useRegisterExternalResources(resources2) {
|
|
1735
|
+
const localeCode = useLocaleCode();
|
|
1736
|
+
react.useEffect(() => {
|
|
1737
|
+
registerResources(resources2, localeCode);
|
|
1734
1738
|
}, [localeCode, resources2]);
|
|
1739
|
+
}
|
|
1740
|
+
var ExternalLocaleProvider = (props) => {
|
|
1741
|
+
useRegisterExternalResources(props.resources);
|
|
1735
1742
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.children });
|
|
1736
1743
|
};
|
|
1744
|
+
function useTranslation(ns, options) {
|
|
1745
|
+
const context = react.useContext(reactI18next.I18nContext);
|
|
1746
|
+
return reactI18next.useTranslation(ns, {
|
|
1747
|
+
i18n: context?.i18n || i18n_default,
|
|
1748
|
+
// @ts-ignore
|
|
1749
|
+
// when the language resource is loaded, notify the translation component to re-render
|
|
1750
|
+
bindI18nStore: "added",
|
|
1751
|
+
...options
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1737
1754
|
|
|
1738
1755
|
Object.defineProperty(exports, "createInstance", {
|
|
1739
1756
|
enumerable: true,
|
|
@@ -1743,11 +1760,13 @@ Object.defineProperty(exports, "i18next", {
|
|
|
1743
1760
|
enumerable: true,
|
|
1744
1761
|
get: function () { return i18next__default.default; }
|
|
1745
1762
|
});
|
|
1763
|
+
exports.Backend = Backend;
|
|
1746
1764
|
exports.ExternalLocaleProvider = ExternalLocaleProvider;
|
|
1747
|
-
exports.
|
|
1748
|
-
exports.
|
|
1765
|
+
exports.LanguageContext = LanguageContext;
|
|
1766
|
+
exports.LanguageProvider = LanguageProvider;
|
|
1749
1767
|
exports.LocaleEnum = LocaleEnum;
|
|
1750
1768
|
exports.LocaleProvider = LocaleProvider;
|
|
1769
|
+
exports.asMessageRecord = asMessageRecord;
|
|
1751
1770
|
exports.createI18nInstance = createI18nInstance;
|
|
1752
1771
|
exports.defaultLanguages = defaultLanguages;
|
|
1753
1772
|
exports.defaultLng = defaultLng;
|
|
@@ -1758,11 +1777,14 @@ exports.getLocalePathFromPathname = getLocalePathFromPathname;
|
|
|
1758
1777
|
exports.i18n = i18n_default;
|
|
1759
1778
|
exports.i18nCookieKey = i18nCookieKey;
|
|
1760
1779
|
exports.i18nLocalStorageKey = i18nLocalStorageKey;
|
|
1780
|
+
exports.importLocaleJsonModule = importLocaleJsonModule;
|
|
1761
1781
|
exports.parseI18nLang = parseI18nLang;
|
|
1762
|
-
exports.
|
|
1782
|
+
exports.registerDefaultResource = registerDefaultResource;
|
|
1783
|
+
exports.registerResources = registerResources;
|
|
1763
1784
|
exports.removeLangPrefix = removeLangPrefix;
|
|
1785
|
+
exports.useLanguageContext = useLanguageContext;
|
|
1764
1786
|
exports.useLocaleCode = useLocaleCode;
|
|
1765
|
-
exports.
|
|
1787
|
+
exports.useRegisterExternalResources = useRegisterExternalResources;
|
|
1766
1788
|
exports.useTranslation = useTranslation;
|
|
1767
1789
|
Object.keys(reactI18next).forEach(function (k) {
|
|
1768
1790
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|