@orderly.network/i18n 3.0.4-alpha.2 → 3.0.4-alpha.4
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/{constant-BwPxVQ3H.d.mts → constant-CIx423sl.d.mts} +2 -0
- package/dist/{constant-BwPxVQ3H.d.ts → constant-CIx423sl.d.ts} +2 -0
- package/dist/constant.d.mts +1 -1
- package/dist/constant.d.ts +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +96 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -14
- package/dist/index.mjs.map +1 -1
- package/dist/locale.csv +4 -2
- package/dist/locales/de.json +4 -2
- package/dist/locales/en.json +3 -1
- package/dist/locales/es.json +4 -2
- package/dist/locales/fr.json +4 -2
- package/dist/locales/id.json +4 -2
- package/dist/locales/it.json +4 -2
- package/dist/locales/ja.json +4 -2
- package/dist/locales/ko.json +4 -2
- package/dist/locales/nl.json +4 -2
- package/dist/locales/pl.json +4 -2
- package/dist/locales/pt.json +4 -2
- package/dist/locales/ru.json +4 -2
- package/dist/locales/tc.json +4 -2
- package/dist/locales/tr.json +4 -2
- package/dist/locales/uk.json +4 -2
- package/dist/locales/vi.json +4 -2
- package/dist/locales/zh.json +4 -2
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +38 -1
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +38 -1
- package/dist/utils.mjs.map +1 -1
- package/docs/guide/integration.md +76 -27
- package/package.json +2 -2
package/dist/utils.mjs
CHANGED
|
@@ -594,7 +594,7 @@ var orderEntry = {
|
|
|
594
594
|
"marginMode.crossMargin": "Cross Margin",
|
|
595
595
|
"marginMode.isolatedMargin": "Isolated Margin",
|
|
596
596
|
"marginMode.crossMarginDescription": "Margin and PnL are shared across positions. You may lose all positions if liquidation occurs.",
|
|
597
|
-
"marginMode.isolatedMarginDescription": "Margin and PnL are independent for each position. You'll only lose the current position if liquidation occurs.",
|
|
597
|
+
"marginMode.isolatedMarginDescription": "Margin and PnL are independent for each position. You'll only lose the current position if liquidation occurs. Only USDC is accepted as collateral. <0>Learn more</0>",
|
|
598
598
|
"marginMode.current": "Current",
|
|
599
599
|
"marginMode.marginModeSettings": "Margin mode settings",
|
|
600
600
|
"marginMode.updatedSuccessfully": "Updated successfully",
|
|
@@ -1265,6 +1265,8 @@ var transfer = {
|
|
|
1265
1265
|
"transfer.LTV.tooltip": `If your LTV exceeds {{threshold}}% or your USDC balance plus Unsettled PnL falls below {{usdcThreshold}}, your collateral will be automatically converted with a haircut. To avoid this, you can manually convert assets to USDC.`,
|
|
1266
1266
|
"transfer.LTV.currentLTV": "Current LTV",
|
|
1267
1267
|
"transfer.LTV.isolatedModeUsdcOnly": "Only USDC can be used as margin in Isolated Mode.",
|
|
1268
|
+
"transfer.LTV.availableCrossMarginHint": "Available balance = USDC balance + Unsettled PnL. All collateral assets contribute to your available margin.",
|
|
1269
|
+
"transfer.LTV.isolatedMarginOrderHint": "In Isolated Margin mode, only USDC is accepted as margin. Convert your assets to USDC to place orders.",
|
|
1268
1270
|
"transfer.convert": "Convert",
|
|
1269
1271
|
// "transfer.convert.note": "Please note that convert fees will be charged.",
|
|
1270
1272
|
"transfer.deposit.globalMaxQty.error": "Your deposit couldn't be processed because the global deposit cap for {{token}} on {{chain}} has been reached. This is typically resolved after rebalancing, which takes around 1 hour. Please try again later, or use a smaller amount or a different chain. <0>Learn more</0>",
|
|
@@ -1440,6 +1442,19 @@ var en = {
|
|
|
1440
1442
|
...navigation
|
|
1441
1443
|
};
|
|
1442
1444
|
|
|
1445
|
+
// src/resourceBundles/externalResources.ts
|
|
1446
|
+
var externalResourcePreloaders = /* @__PURE__ */ new Set();
|
|
1447
|
+
async function preloadExternalResources(lang) {
|
|
1448
|
+
await Promise.all(
|
|
1449
|
+
Array.from(externalResourcePreloaders).map(async (preloader) => {
|
|
1450
|
+
try {
|
|
1451
|
+
await preloader(lang);
|
|
1452
|
+
} catch (error) {
|
|
1453
|
+
}
|
|
1454
|
+
})
|
|
1455
|
+
);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1443
1458
|
// src/i18n.ts
|
|
1444
1459
|
var resources = {
|
|
1445
1460
|
[defaultLng]: { [defaultNS]: en }
|
|
@@ -1463,6 +1478,28 @@ function createI18nInstance(options) {
|
|
|
1463
1478
|
var i18n = createI18nInstance({
|
|
1464
1479
|
resources
|
|
1465
1480
|
});
|
|
1481
|
+
var parseChangeLanguageTarget = (lang) => {
|
|
1482
|
+
if (!lang) {
|
|
1483
|
+
return void 0;
|
|
1484
|
+
}
|
|
1485
|
+
const localeCodes = Object.values(LocaleEnum);
|
|
1486
|
+
if (localeCodes.includes(lang)) {
|
|
1487
|
+
return lang;
|
|
1488
|
+
}
|
|
1489
|
+
const match = lang.match(/^([a-z]{2})/i);
|
|
1490
|
+
if (match && localeCodes.includes(match[1])) {
|
|
1491
|
+
return match[1];
|
|
1492
|
+
}
|
|
1493
|
+
return lang;
|
|
1494
|
+
};
|
|
1495
|
+
var originalChangeLanguage = i18n.changeLanguage.bind(i18n);
|
|
1496
|
+
i18n.changeLanguage = (async (lang, callback) => {
|
|
1497
|
+
const localeCode = parseChangeLanguageTarget(lang);
|
|
1498
|
+
if (localeCode) {
|
|
1499
|
+
await preloadExternalResources(localeCode);
|
|
1500
|
+
}
|
|
1501
|
+
return originalChangeLanguage(lang, callback);
|
|
1502
|
+
});
|
|
1466
1503
|
i18n.init();
|
|
1467
1504
|
var i18n_default = i18n;
|
|
1468
1505
|
|