diff --git a/.changeset/shaggy-shoes-beg.md b/.changeset/shaggy-shoes-beg.md new file mode 100644 index 000000000000..c38fa18b8262 --- /dev/null +++ b/.changeset/shaggy-shoes-beg.md @@ -0,0 +1,6 @@ +--- +"ledger-live-desktop": patch +"@ledgerhq/live-common": patch +--- + +Add translation for troubleshooting network diff --git a/apps/ledger-live-desktop/src/renderer/modals/TroubleshootNetwork/Body.tsx b/apps/ledger-live-desktop/src/renderer/modals/TroubleshootNetwork/Body.tsx index f5eb450764af..6e84e41a94ef 100644 --- a/apps/ledger-live-desktop/src/renderer/modals/TroubleshootNetwork/Body.tsx +++ b/apps/ledger-live-desktop/src/renderer/modals/TroubleshootNetwork/Body.tsx @@ -65,19 +65,20 @@ const Status = ({ status }: { status?: TroubleshootStatus }) => { } }; const RenderState = ({ state }: { state: TroubleshootStatus[] }) => { + const { t } = useTranslation(); return ( - - + + {state.map(status => { return ( - + diff --git a/apps/ledger-live-desktop/static/i18n/en/app.json b/apps/ledger-live-desktop/static/i18n/en/app.json index 27b676b060ed..4c15bd11a8fd 100644 --- a/apps/ledger-live-desktop/static/i18n/en/app.json +++ b/apps/ledger-live-desktop/static/i18n/en/app.json @@ -2375,7 +2375,7 @@ "footer": { "estimatedFees": "Network fees" }, - "info":{ + "info": { "needMemoTag": { "title": "Don’t use Tag/Memo?", "description": "Your funds will get lost if you don’t add a Tag/Memo when sending them to any centralized exchange or custodial wallet.", @@ -2390,7 +2390,15 @@ "version": "Ledger Live {{versionNb}}" }, "troubleshootNetwork": { - "title": "Troubleshoot networking" + "title": "Troubleshoot networking", + "myLedgerServices": "My Ledger services (scriptrunner)", + "bitcoinExplorers": "Bitcoin explorers", + "ethereumExplorers": "Ethereum explorers", + "countervaluesApi": "Countervalues API", + "announcements": "Announcements", + "status": "Status", + "test": "TEST", + "renderer": "RENDERER" }, "systemLanguageAvailable": { "title": "Change your app's language?", diff --git a/libs/ledger-live-common/src/network-troubleshooting/index.ts b/libs/ledger-live-common/src/network-troubleshooting/index.ts index 26c933954b3f..2809d83cb0ec 100644 --- a/libs/ledger-live-common/src/network-troubleshooting/index.ts +++ b/libs/ledger-live-common/src/network-troubleshooting/index.ts @@ -11,12 +11,14 @@ export type TroubleshootStatus = { technicalDescription: string; status: "success" | "error" | "loading"; error?: string; + translationKey: string; }; type Troubleshoot = { title: string; technicalDescription: string; job: Promise; + translationKey: string; }; // Run all checks and return. each troubleshoot have a promise that suceed if the underlying job worked. @@ -25,6 +27,7 @@ export function troubleshoot(): Troubleshoot[] { return [ { title: "My Ledger services (scriptrunner)", + translationKey: "troubleshootNetwork.myLedgerServices", ...websocketConnects( `${getEnv( "BASE_SOCKET_URL", @@ -33,23 +36,28 @@ export function troubleshoot(): Troubleshoot[] { }, { title: "Bitcoin explorers", + translationKey: "troubleshootNetwork.bitcoinExplorers", ...httpGet(getEnv("EXPLORER") + "/blockchain/v4/btc/block/current"), }, { title: "Ethereum explorers", + translationKey: "troubleshootNetwork.ethereumExplorers", ...httpGet(getEnv("EXPLORER") + "/blockchain/v4/eth/block/current"), }, { title: "Countervalues API", + translationKey: "troubleshootNetwork.countervaluesApi", ...httpGet(`${getEnv("LEDGER_COUNTERVALUES_API")}/v3/spot/simple?froms=bitcoin&to=eur`), }, { title: "Announcements", + translationKey: "troubleshootNetwork.announcements", technicalDescription: "fetching announcements", job: announcementsApi.fetchAnnouncements(), }, { title: "Status", + translationKey: "troubleshootNetwork.status", technicalDescription: "fetching status", job: serviceStatusApi.fetchStatusSummary(), }, @@ -106,6 +114,7 @@ export function troubleshootOverObservable(): Observable { type: "init", all: all.map(s => ({ title: s.title, + translationKey: s.translationKey, technicalDescription: s.technicalDescription, status: "loading", })), @@ -120,6 +129,7 @@ export function troubleshootOverObservable(): Observable { type: "change", status: { title: s.title, + translationKey: s.translationKey, technicalDescription: s.technicalDescription, status: "success", }, @@ -130,6 +140,7 @@ export function troubleshootOverObservable(): Observable { type: "change", status: { title: s.title, + translationKey: s.translationKey, technicalDescription: s.technicalDescription, status: "error", error: String(e?.message || e),
TESTRENDERER{t("troubleshootNetwork.test")}{t("troubleshootNetwork.renderer")}
{status.title}{t(status.translationKey)}