@orderly.network/i18n 2.8.10-alpha.0 → 2.8.11-alpha.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.
@@ -1,87 +1,5 @@
1
1
  import * as react from 'react';
2
2
 
3
- type Language = {
4
- localCode: LocaleCode;
5
- displayName: string;
6
- };
7
- type PopupMode = "modal" | "dropdown" | "sheet";
8
- type PopupProps = {
9
- /**
10
- * popup mode
11
- * - modal: show in a dialog
12
- * - dropdown: show in a dropdown menu
13
- * - sheet: show in a sheet (only for mobile)
14
- * @default modal
15
- */
16
- mode?: PopupMode;
17
- /** popup class name */
18
- className?: string;
19
- /** popup style */
20
- style?: React.CSSProperties;
21
- };
22
- type LocaleContextState = {
23
- /**
24
- * custom languages
25
- */
26
- languages: Language[];
27
- /**
28
- * called before language changed
29
- */
30
- onLanguageBeforeChanged: (lang: LocaleCode) => Promise<void>;
31
- /**
32
- * called when language changed
33
- */
34
- onLanguageChanged: (lang: LocaleCode) => Promise<void>;
35
- /**
36
- * popup options for language switcher
37
- */
38
- popup?: PopupProps;
39
- };
40
- declare const LocaleContext: react.Context<LocaleContextState>;
41
- declare const useLocaleContext: () => LocaleContextState;
42
-
43
- declare enum LocaleEnum {
44
- /** English */
45
- en = "en",
46
- /** Chinese */
47
- zh = "zh",
48
- /** Japanese */
49
- ja = "ja",
50
- /** Spanish */
51
- es = "es",
52
- /** Korean */
53
- ko = "ko",
54
- /** Vietnamese */
55
- vi = "vi",
56
- /** German */
57
- de = "de",
58
- /** French */
59
- fr = "fr",
60
- /** Russian */
61
- ru = "ru",
62
- /** Indonesian */
63
- id = "id",
64
- /** Turkish */
65
- tr = "tr",
66
- /** Italian */
67
- it = "it",
68
- /** Portuguese */
69
- pt = "pt",
70
- /** Ukrainian */
71
- uk = "uk",
72
- /** Polish */
73
- pl = "pl",
74
- /** Dutch */
75
- nl = "nl",
76
- /** Traditional Chinese */
77
- tc = "tc"
78
- }
79
- declare const defaultLanguages: Language[];
80
- declare const defaultLng = LocaleEnum.en;
81
- declare const defaultNS = "translation";
82
- declare const i18nLocalStorageKey = "orderly_i18nLng";
83
- declare const i18nCookieKey = "orderly_i18nLng";
84
-
85
3
  declare const en: {
86
4
  "notification.campaign": string;
87
5
  "notification.delisting": string;
@@ -792,7 +710,6 @@ declare const en: {
792
710
  "positions.closeAll.description": string;
793
711
  "positions.closeAll.success": string;
794
712
  "positions.column.liqPrice": string;
795
- "positions.column.liqPrice.tooltip": string;
796
713
  "positions.column.unrealPnl.tooltip": string;
797
714
  "positions.column.unrealPnl.priceBasis": string;
798
715
  "positions.column.margin": string;
@@ -867,6 +784,8 @@ declare const en: {
867
784
  "trading.orderBook": string;
868
785
  "trading.lastTrades": string;
869
786
  "trading.orderBook.column.value": string;
787
+ "trading.orderBook.settings": string;
788
+ "trading.orderBook.showBuySellRatio": string;
870
789
  "trading.tabs.chart": string;
871
790
  "trading.tabs.trades": string;
872
791
  "trading.tabs.data": string;
@@ -892,6 +811,12 @@ declare const en: {
892
811
  "trading.asset.maintenanceMarginRatio": string;
893
812
  "trading.asset.maintenanceMarginRatio.tooltip": string;
894
813
  "trading.asset.maintenanceMarginRatio.formula": string;
814
+ "trading.asset.maintenanceMargin": string;
815
+ "trading.asset.maintenanceMargin.tooltip": string;
816
+ "trading.asset.maintenanceMargin.formula": string;
817
+ "trading.asset.currentLeverage": string;
818
+ "trading.asset.currentLeverage.tooltip": string;
819
+ "trading.asset.currentLeverage.formula": string;
895
820
  "trading.riskRate": string;
896
821
  "trading.riskRate.tooltip": string;
897
822
  "trading.riskRate.formula": string;
@@ -1165,6 +1090,8 @@ declare const en: {
1165
1090
  "common.vaults": string;
1166
1091
  "common.optional": string;
1167
1092
  "common.learnMore": string;
1093
+ "common.liquidationPrice.tooltip": string;
1094
+ "common.liquidationPrice.tooltip.learnMore": string;
1168
1095
  "common.switch": string;
1169
1096
  "common.notSupported": string;
1170
1097
  "common.details": string;
@@ -1181,7 +1108,9 @@ declare const en: {
1181
1108
 
1182
1109
  type LocaleCode = keyof typeof LocaleEnum | (string & {});
1183
1110
  type ExtendLocaleMessages = Record<`extend.${string}`, string>;
1184
- type LocaleMessages = typeof en & ExtendLocaleMessages;
1111
+ type EnType = typeof en;
1112
+ interface LocaleMessages extends EnType, ExtendLocaleMessages {
1113
+ }
1185
1114
  type Resources<T extends {} = {}> = {
1186
1115
  [key in LocaleCode]?: Partial<LocaleMessages & T>;
1187
1116
  };
@@ -1193,4 +1122,86 @@ declare module "i18next" {
1193
1122
  }
1194
1123
  }
1195
1124
 
1125
+ type Language = {
1126
+ localCode: LocaleCode;
1127
+ displayName: string;
1128
+ };
1129
+ type PopupMode = "modal" | "dropdown" | "sheet";
1130
+ type PopupProps = {
1131
+ /**
1132
+ * popup mode
1133
+ * - modal: show in a dialog
1134
+ * - dropdown: show in a dropdown menu
1135
+ * - sheet: show in a sheet (only for mobile)
1136
+ * @default modal
1137
+ */
1138
+ mode?: PopupMode;
1139
+ /** popup class name */
1140
+ className?: string;
1141
+ /** popup style */
1142
+ style?: React.CSSProperties;
1143
+ };
1144
+ type LocaleContextState = {
1145
+ /**
1146
+ * custom languages
1147
+ */
1148
+ languages: Language[];
1149
+ /**
1150
+ * called before language changed
1151
+ */
1152
+ onLanguageBeforeChanged: (lang: LocaleCode) => Promise<void>;
1153
+ /**
1154
+ * called when language changed
1155
+ */
1156
+ onLanguageChanged: (lang: LocaleCode) => Promise<void>;
1157
+ /**
1158
+ * popup options for language switcher
1159
+ */
1160
+ popup?: PopupProps;
1161
+ };
1162
+ declare const LocaleContext: react.Context<LocaleContextState>;
1163
+ declare const useLocaleContext: () => LocaleContextState;
1164
+
1165
+ declare enum LocaleEnum {
1166
+ /** English */
1167
+ en = "en",
1168
+ /** Chinese */
1169
+ zh = "zh",
1170
+ /** Japanese */
1171
+ ja = "ja",
1172
+ /** Spanish */
1173
+ es = "es",
1174
+ /** Korean */
1175
+ ko = "ko",
1176
+ /** Vietnamese */
1177
+ vi = "vi",
1178
+ /** German */
1179
+ de = "de",
1180
+ /** French */
1181
+ fr = "fr",
1182
+ /** Russian */
1183
+ ru = "ru",
1184
+ /** Indonesian */
1185
+ id = "id",
1186
+ /** Turkish */
1187
+ tr = "tr",
1188
+ /** Italian */
1189
+ it = "it",
1190
+ /** Portuguese */
1191
+ pt = "pt",
1192
+ /** Ukrainian */
1193
+ uk = "uk",
1194
+ /** Polish */
1195
+ pl = "pl",
1196
+ /** Dutch */
1197
+ nl = "nl",
1198
+ /** Traditional Chinese */
1199
+ tc = "tc"
1200
+ }
1201
+ declare const defaultLanguages: Language[];
1202
+ declare const defaultLng = LocaleEnum.en;
1203
+ declare const defaultNS = "translation";
1204
+ declare const i18nLocalStorageKey = "orderly_i18nLng";
1205
+ declare const i18nCookieKey = "orderly_i18nLng";
1206
+
1196
1207
  export { type LocaleCode as L, type PopupMode as P, type Resources as R, type LocaleContextState as a, type Language as b, type PopupProps as c, LocaleContext 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, useLocaleContext as u };