diff --git a/app/assets/js/discordwrapper.js b/app/assets/js/discordwrapper.js index 1e44e867ba..11ed053b30 100644 --- a/app/assets/js/discordwrapper.js +++ b/app/assets/js/discordwrapper.js @@ -5,15 +5,17 @@ const logger = LoggerUtil.getLogger('DiscordWrapper') const { Client } = require('discord-rpc-patch') +const Lang = require('./langloader') + let client let activity -exports.initRPC = function(genSettings, servSettings, initialDetails = 'Waiting for Client..'){ +exports.initRPC = function(genSettings, servSettings, initialDetails = Lang.queryJS('discord.waiting')){ client = new Client({ transport: 'ipc' }) activity = { details: initialDetails, - state: 'Server: ' + servSettings.shortId, + state: Lang.queryJS('discord.state', {shortId: servSettings.shortId}), largeImageKey: servSettings.largeImageKey, largeImageText: servSettings.largeImageText, smallImageKey: genSettings.smallImageKey, diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index 0374334c7e..1c73e044f5 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -563,7 +563,7 @@ async function dlAsync(login = true) { const onLoadComplete = () => { toggleLaunchArea(false) if(hasRPC){ - DiscordWrapper.updateDetails('Loading game..') + DiscordWrapper.updateDetails(Lang.queryJS('landing.discord.loading')) proc.stdout.on('data', gameStateChange) } proc.stdout.removeListener('data', tempListener) @@ -590,9 +590,9 @@ async function dlAsync(login = true) { const gameStateChange = function(data){ data = data.trim() if(SERVER_JOINED_REGEX.test(data)){ - DiscordWrapper.updateDetails('Exploring the Realm!') + DiscordWrapper.updateDetails(Lang.queryJS('landing.discord.joined')) } else if(GAME_JOINED_REGEX.test(data)){ - DiscordWrapper.updateDetails('Sailing to Westeros!') + DiscordWrapper.updateDetails(Lang.queryJS('landing.discord.joining')) } } diff --git a/app/assets/js/scripts/overlay.js b/app/assets/js/scripts/overlay.js index b7acfa2e84..0d6ab2ae7f 100644 --- a/app/assets/js/scripts/overlay.js +++ b/app/assets/js/scripts/overlay.js @@ -130,7 +130,7 @@ async function toggleServerSelection(toggleState){ * @param {string} acknowledge Acknowledge button text. * @param {string} dismiss Dismiss button text. */ -function setOverlayContent(title, description, acknowledge, dismiss = 'Dismiss'){ +function setOverlayContent(title, description, acknowledge, dismiss = Lang.queryJS('overlay.dismiss')){ document.getElementById('overlayTitle').innerHTML = title document.getElementById('overlayDesc').innerHTML = description document.getElementById('overlayAcknowledge').innerHTML = acknowledge diff --git a/app/assets/js/scripts/settings.js b/app/assets/js/scripts/settings.js index 1d850055a4..628c63cef7 100644 --- a/app/assets/js/scripts/settings.js +++ b/app/assets/js/scripts/settings.js @@ -900,7 +900,7 @@ function bindDropinModsRemoveButton(){ setOverlayContent( Lang.queryJS('settings.dropinMods.deleteFailedTitle', { fullName }), Lang.queryJS('settings.dropinMods.deleteFailedMessage'), - Lang.queryJS('settings.okButton') + Lang.queryJS('settings.dropinMods.okButton') ) setOverlayHandler(null) toggleOverlay(true) @@ -955,7 +955,7 @@ function saveDropinModConfiguration(){ setOverlayContent( Lang.queryJS('settings.dropinMods.failedToggleTitle'), err.message, - Lang.queryJS('settings.okButton') + Lang.queryJS('settings.dropinMods.okButton') ) setOverlayHandler(null) toggleOverlay(true) diff --git a/app/assets/lang/en_US.toml b/app/assets/lang/en_US.toml index 8bd2f48ae5..59877b74ae 100644 --- a/app/assets/lang/en_US.toml +++ b/app/assets/lang/en_US.toml @@ -130,6 +130,14 @@ waitingText = "Waiting for Microsoft.." continueButton = "CONTINUE" +[js.discord] +waiting = "Waiting for Client.." +state = "Server: {shortId}" + +[js.index] +microsoftLoginTitle = "Microsoft Login" +microsoftLogoutTitle = "Microsoft Logout" + [js.login] login = "LOGIN" loggingIn = "LOGGING IN" @@ -202,6 +210,14 @@ checkConsoleForDetails = "Please check the console (CTRL + Shift + i) for more d [js.landing.news] checking = "Checking for News" +[js.landing.discord] +loading = "Loading game.." +joining = "Sailing to Westeros!" +joined = "Exploring the Realm!" + +[js.overlay] +dismiss = "Dismiss" + [js.settings.fileSelectors] executables = "Executables" allFiles = "All Files" diff --git a/index.js b/index.js index ae0408ae82..7060c3c685 100644 --- a/index.js +++ b/index.js @@ -125,7 +125,7 @@ ipcMain.on(MSFT_OPCODE.OPEN_LOGIN, (ipcEvent, ...arguments_) => { msftAuthViewSuccess = arguments_[0] msftAuthViewOnClose = arguments_[1] msftAuthWindow = new BrowserWindow({ - title: 'Microsoft Login', + title: LangLoader.queryJS('index.microsoftLoginTitle'), backgroundColor: '#222222', width: 520, height: 600, @@ -178,7 +178,7 @@ ipcMain.on(MSFT_OPCODE.OPEN_LOGOUT, (ipcEvent, uuid, isLastAccount) => { msftLogoutSuccess = false msftLogoutSuccessSent = false msftLogoutWindow = new BrowserWindow({ - title: 'Microsoft Logout', + title: LangLoader.queryJS('index.microsoftLogoutTitle'), backgroundColor: '#222222', width: 520, height: 600,