From 80017271966599874148c0e4cd62265905705a05 Mon Sep 17 00:00:00 2001 From: tobspr Date: Mon, 20 Jun 2022 19:08:14 +0200 Subject: [PATCH] Update translations and minor fixes --- src/css/states/main_menu.scss | 84 ++++++++------- src/js/core/steam_sso.js | 50 +++++---- src/js/states/main_menu.js | 40 ++++---- translations/base-ar.yaml | 18 ++++ translations/base-cat.yaml | 18 ++++ translations/base-cz.yaml | 18 ++++ translations/base-da.yaml | 18 ++++ translations/base-de.yaml | 18 ++++ translations/base-el.yaml | 18 ++++ translations/base-en.yaml | 4 +- translations/base-es.yaml | 18 ++++ translations/base-fi.yaml | 18 ++++ translations/base-fr.yaml | 18 ++++ translations/base-he.yaml | 18 ++++ translations/base-hr.yaml | 18 ++++ translations/base-hu.yaml | 18 ++++ translations/base-ind.yaml | 18 ++++ translations/base-it.yaml | 18 ++++ translations/base-ja.yaml | 53 +++++----- translations/base-kor.yaml | 165 ++++++++++++------------------ translations/base-lt.yaml | 18 ++++ translations/base-nl.yaml | 18 ++++ translations/base-no.yaml | 18 ++++ translations/base-pl.yaml | 18 ++++ translations/base-pt-BR.yaml | 18 ++++ translations/base-pt-PT.yaml | 18 ++++ translations/base-ro.yaml | 18 ++++ translations/base-ru.yaml | 18 ++++ translations/base-sl.yaml | 18 ++++ translations/base-sr.yaml | 18 ++++ translations/base-sv.yaml | 18 ++++ translations/base-tr.yaml | 18 ++++ translations/base-uk.yaml | 26 ++++- translations/base-zh-CN-ISBN.yaml | 18 ++++ translations/base-zh-CN.yaml | 59 ++++++----- translations/base-zh-TW.yaml | 50 +++++---- 36 files changed, 763 insertions(+), 254 deletions(-) diff --git a/src/css/states/main_menu.scss b/src/css/states/main_menu.scss index 0d16163b..6043365b 100644 --- a/src/css/states/main_menu.scss +++ b/src/css/states/main_menu.scss @@ -49,45 +49,6 @@ } } - .steamSso { - position: fixed; - @include S(top, 0px); - @include S(left, 10px); - background: rgba(88, 92, 102, 0.4); - @include SuperSmallText; - color: #fff; - @include S(max-width, 150px); - @include S(border-radius, $globalBorderRadius); - border-top-left-radius: 0; - border-top-right-radius: 0; - @include S(padding, 5px); - box-shadow: 0 D(5px) D(15px) rgba(#000, 0.1); - display: flex; - color: #000; - flex-direction: column; - - a.ssoSignIn { - background: #171a23 uiResource("steam_signin.png") center center / contain no-repeat; - @include S(width, 110px); - @include S(height, 19px); - display: inline-flex; - @include S(border-radius, $globalBorderRadius); - @include S(margin-top, 3px); - overflow: hidden; - text-indent: -999em; - &:hover { - opacity: 0.95; - } - } - - @include DarkThemeOverride { - color: #333539; - a { - color: #111; - } - } - } - .fullscreenBackgroundVideo { // display: none !important; z-index: -1; @@ -972,6 +933,51 @@ } } + > .steamSso { + background: rgba($colorBlueBright, 0.9); + &:hover { + background: rgba($colorBlueBright, 0.9); + } + // @include SuperSmallText; + // color: #fff; + // @include S(max-width, 150px); + // @include S(border-radius, $globalBorderRadius); + // border-top-left-radius: 0; + // border-top-right-radius: 0; + @include S(padding, 5px); + // box-shadow: 0 D(5px) D(15px) rgba(#000, 0.1); + // color: #000; + display: flex; + color: #222428; + flex-direction: column; + + @include S(font-size, 9px); + + a.ssoSignIn { + background: #171a23 uiResource("steam_signin.png") center center / contain no-repeat; + width: 100%; + box-sizing: border-box; + @include S(height, 16px); + @include S(min-height, 16px); + + display: inline-flex; + @include S(border-radius, $globalBorderRadius * 0.5); + @include S(margin-top, 3px); + overflow: hidden; + text-indent: -999em; + &:hover { + opacity: 0.95; + } + } + + @include DarkThemeOverride { + color: #333539; + a { + color: #111; + } + } + } + > .sidelinks { display: grid; align-items: flex-start; diff --git a/src/js/core/steam_sso.js b/src/js/core/steam_sso.js index f04fb3bc..67c6d582 100644 --- a/src/js/core/steam_sso.js +++ b/src/js/core/steam_sso.js @@ -51,29 +51,37 @@ export async function authorizeViaSSOToken(app, dialogs) { return; } - const response = await Promise.race([ - fetch(apiUrl + "/v1/sso/refresh", { - method: "POST", - body: token, - headers: { - "x-api-key": "d5c54aaa491f200709afff082c153ef2", - }, - }), - new Promise((resolve, reject) => { - setTimeout(() => reject("timeout exceeded"), 20000); - }), - ]); - const responseText = await response.json(); - if (!responseText.token) { - console.warn("Failed to register"); + try { + const response = await Promise.race([ + fetch(apiUrl + "/v1/sso/refresh", { + method: "POST", + body: token, + headers: { + "x-api-key": "d5c54aaa491f200709afff082c153ef2", + }, + }), + new Promise((resolve, reject) => { + setTimeout(() => reject("timeout exceeded"), 20000); + }), + ]); + + const responseText = await response.json(); + if (!responseText.token) { + console.warn("Failed to register"); + window.localStorage.setItem("steam_sso_auth_token", ""); + window.location.replace("?sso_logout"); + return; + } + + window.localStorage.setItem("steam_sso_auth_token", responseText.token); + app.clientApi.token = responseText.token; + WEB_STEAM_SSO_AUTHENTICATED = true; + } catch (ex) { + console.warn("Auth failure", ex); window.localStorage.setItem("steam_sso_auth_token", ""); - window.location.replace("?sso_logout"); - return; + window.location.replace("/"); + return new Promise(() => null); } - - window.localStorage.setItem("steam_sso_auth_token", responseText.token); - app.clientApi.token = responseText.token; - WEB_STEAM_SSO_AUTHENTICATED = true; }; await verify(); diff --git a/src/js/states/main_menu.js b/src/js/states/main_menu.js index cd1bccc8..f1a0de9a 100644 --- a/src/js/states/main_menu.js +++ b/src/js/states/main_menu.js @@ -120,25 +120,6 @@ export class MainMenuState extends GameState { ${showExitAppButton ? `` : ""} - ${ - G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED - ? "" - : `
- ${T.mainMenu.playFullVersion} - Sign in -
` - } - ${ - WEB_STEAM_SSO_AUTHENTICATED - ? ` -
${T.mainMenu.playingFullVersion} - ${T.mainMenu.logout} -
- ` - : "" - }