From 2108dd5975f03ad3e74430a2de3ea5b4e3910385 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Tue, 25 Jan 2022 20:52:21 +0700 Subject: [PATCH] add i18n to lastfm button --- src/i18n/en_US.jsonc | 3 +++ src/renderer/index.js | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/i18n/en_US.jsonc b/src/i18n/en_US.jsonc index 643965bd..07c00fa1 100644 --- a/src/i18n/en_US.jsonc +++ b/src/i18n/en_US.jsonc @@ -70,6 +70,9 @@ "term.enabled": "Enabled", "term.disabled": "Disabled", "term.connect": "Connect", + "term.disconnect": "Disconnect", + "term.authed": "Authed", + "term.connecting": "Connecting", "term.confirm": "Confirm ?", "term.more": "More", "term.less": "Less", diff --git a/src/renderer/index.js b/src/renderer/index.js index 4f82df13..290364fe 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -3296,12 +3296,12 @@ const app = new Vue({ const element = document.getElementById('lfmConnect'); // new key : f9986d12aab5a0fe66193c559435ede3 window.open('https://www.last.fm/api/auth?api_key=f9986d12aab5a0fe66193c559435ede3&cb=cider://auth/lastfm'); - element.innerText = 'Connecting...'; + element.innerText = app.getLz('term.connecting') + '...'; /* Just a timeout for the button */ setTimeout(() => { - if (element.innerText === 'Connecting...') { - element.innerText = 'Connect'; + if (element.innerText === app.getLz('term.connecting') +'...') { + element.innerText = app.getLz('term.connect'); console.warn('[LastFM] Attempted connection timed out.'); } }, 20000); @@ -3309,7 +3309,7 @@ const app = new Vue({ ipcRenderer.on('LastfmAuthenticated', function(_event, lfmAuthKey) { app.cfg.lastfm.auth_token = lfmAuthKey; app.cfg.lastfm.enabled = true; - element.innerHTML = `Disconnect\n

(Authed: ${lfmAuthKey})

`; + element.innerHTML = `${app.getLz('term.disconnect')}\n

(${app.getLz('term.authed')}: ${lfmAuthKey})

`; element.onclick = app.LastFMDeauthorize; }); },