From 3d5e0643584e13853dd61e9794f8930821b81ce3 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 4 Jul 2024 12:37:53 +0200 Subject: [PATCH] :recycle: Remove unused locale function --- frontend/resources/styles/common/base.scss | 6 +----- frontend/src/app/main/data/users.cljs | 3 +-- frontend/src/app/util/i18n.cljs | 18 ------------------ 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/frontend/resources/styles/common/base.scss b/frontend/resources/styles/common/base.scss index 49f037129..62b26317c 100644 --- a/frontend/resources/styles/common/base.scss +++ b/frontend/resources/styles/common/base.scss @@ -18,16 +18,12 @@ $lh-115: 1.15; $lh-133: 1.33; $size-4: 1rem; -:root { - --font-family: "worksans", "vazirmatn", sans-serif; -} - body { background-color: var(--db-primary); color: var(--df-primary); display: flex; flex-direction: column; - font-family: var(--font-family); + font-family: "worksans", "vazirmatn", sans-serif; width: 100vw; height: 100vh; overflow: hidden; diff --git a/frontend/src/app/main/data/users.cljs b/frontend/src/app/main/data/users.cljs index 8ba0f7547..967c00c57 100644 --- a/frontend/src/app/main/data/users.cljs +++ b/frontend/src/app/main/data/users.cljs @@ -317,8 +317,7 @@ (effect [_ _ _] ;; We prefer to keek some stuff in the storage like the current-team-id and the profile (swap! storage dissoc :redirect-url) - (set-current-team! nil) - (i18n/reset-locale))))) + (set-current-team! nil))))) (defn logout ([] (logout {})) diff --git a/frontend/src/app/util/i18n.cljs b/frontend/src/app/util/i18n.cljs index c87ac6f20..eadf74a56 100644 --- a/frontend/src/app/util/i18n.cljs +++ b/frontend/src/app/util/i18n.cljs @@ -10,7 +10,6 @@ [app.common.data :as d] [app.common.logging :as log] [app.config :as cfg] - [app.util.dom :as dom] [app.util.globals :as globals] [app.util.storage :refer [storage]] [cuerdas.core :as str] @@ -106,23 +105,6 @@ (swap! storage assoc ::locale lname) (reset! locale lname)))) -(defn reset-locale - "Set the current locale to the browser detected one if it is - supported or default locale if not." - [] - (swap! storage dissoc ::locale) - (reset! locale (autodetect))) - -(add-watch locale "browser-font" - (fn [_ _ _ locale] - (log/info :hint "locale changed" :locale locale) - (dom/set-html-lang! locale) - (let [node (dom/get-body)] - (if (or (= locale "fa") - (= locale "ar")) - (dom/set-css-property! node "--font-family" "'vazirmatn', 'worksans', sans-serif") - (dom/unset-css-property! node "--font-family"))))) - (deftype C [val] IDeref (-deref [_] val))