From 2db5b0f60f77f9355a34cb6fbaa4ee15ded73ba9 Mon Sep 17 00:00:00 2001 From: "mathieu.brunot" Date: Thu, 21 Feb 2019 16:57:57 +0100 Subject: [PATCH] :globe_with_meridians: More i18n updates --- frontend/src/uxbox/main/data/colors.cljs | 2 +- frontend/src/uxbox/main/data/icons.cljs | 2 +- frontend/src/uxbox/main/data/images.cljs | 3 +- frontend/src/uxbox/main/data/users.cljs | 2 +- frontend/src/uxbox/main/locales/en.cljs | 41 ++++++++++------ frontend/src/uxbox/main/locales/fr.cljs | 47 ++++++++++++------- .../uxbox/main/ui/settings/notifications.cljs | 16 ++++--- .../src/uxbox/main/ui/settings/password.cljs | 12 ++--- .../src/uxbox/main/ui/settings/profile.cljs | 16 +++---- 9 files changed, 84 insertions(+), 57 deletions(-) diff --git a/frontend/src/uxbox/main/data/colors.cljs b/frontend/src/uxbox/main/data/colors.cljs index d6ce422f5..41cc230a1 100644 --- a/frontend/src/uxbox/main/data/colors.cljs +++ b/frontend/src/uxbox/main/data/colors.cljs @@ -92,7 +92,7 @@ (defrecord CreateCollection [id] ptk/UpdateEvent (update [_ state] - (let [item {:name (str "Unnamed Collection (" (gensym "c") ")") + (let [item {:name (tr "ds.default-library-title" (gensym "c")) :id id :created-at (dt/now) :type :own diff --git a/frontend/src/uxbox/main/data/icons.cljs b/frontend/src/uxbox/main/data/icons.cljs index 89713574a..8cf983aaa 100644 --- a/frontend/src/uxbox/main/data/icons.cljs +++ b/frontend/src/uxbox/main/data/icons.cljs @@ -108,7 +108,7 @@ (defrecord CreateCollection [] ptk/WatchEvent (watch [_ state s] - (let [name (str "Unnamed Collection (" (gensym "c") ")") + (let [name (tr "ds.default-library-title" (gensym "c")) coll {:name name}] (->> (rp/req :create/icon-collection coll) (rx/map :payload) diff --git a/frontend/src/uxbox/main/data/images.cljs b/frontend/src/uxbox/main/data/images.cljs index dda34c4f2..efddc6570 100644 --- a/frontend/src/uxbox/main/data/images.cljs +++ b/frontend/src/uxbox/main/data/images.cljs @@ -11,6 +11,7 @@ [potok.core :as ptk] [uxbox.main.store :as st] [uxbox.main.repo :as rp] + [uxbox.util.i18n :refer [tr]] [uxbox.util.data :refer (jscoll->vec)] [uxbox.util.uuid :as uuid] [uxbox.util.time :as ts] @@ -146,7 +147,7 @@ (defrecord CreateCollection [] ptk/WatchEvent (watch [_ state s] - (let [coll {:name (str "Unnamed Collection (" (gensym "c") ")") + (let [coll {:name (tr "ds.default-library-title" (gensym "c")) :id (uuid/random)}] (->> (rp/req :create/image-collection coll) (rx/map :payload) diff --git a/frontend/src/uxbox/main/data/users.cljs b/frontend/src/uxbox/main/data/users.cljs index e10ce950f..447da4913 100644 --- a/frontend/src/uxbox/main/data/users.cljs +++ b/frontend/src/uxbox/main/data/users.cljs @@ -43,7 +43,7 @@ ptk/WatchEvent (watch [_ state s] (rx/of (profile-fetched data) - (uum/info (tr "settings.profile-saved"))))) + (uum/info (tr "settings.profile.profile-saved"))))) (defn profile-updated [data] diff --git a/frontend/src/uxbox/main/locales/en.cljs b/frontend/src/uxbox/main/locales/en.cljs index d8a62fec5..1fbe2cf3a 100644 --- a/frontend/src/uxbox/main/locales/en.cljs +++ b/frontend/src/uxbox/main/locales/en.cljs @@ -69,6 +69,7 @@ "ds.library-title" "Library: " "ds.standard-title" "STANDARD" "ds.your-libraries-title" "YOUR LIBRARIES" + "ds.default-library-title" "Unnamed Collection (%s)" "ds.recent-colors" "Recent colors" "ds.element-options" "Element options" @@ -115,21 +116,31 @@ "settings.profile" "PROFILE" "settings.password" "PASSWORD" "settings.notifications" "NOTIFICATIONS" - "settings.profile-saved" "Profile saved successfully!" - "settings.name-username-email" "Name, username and email" - "settings.your-name" "Your name" - "settings.your-username" "Your username" - "settings.your-email" "Your email" - "settings.light-theme" "Light theme" - "settings.dark-theme" "Dark theme" - "settings.high-contrast-theme" "High-contrast theme" - "settings.your-avatar" "Your avatar" - "settings.password-saved" "Password saved successfully!" - "settings.wrong-old-password" "Wrong old password" - "settings.change-password" "Change password" - "settings.old-password" "Old password" - "settings.new-password" "New password" - "settings.confirm-password" "Confirm password" + + "settings.profile.profile-saved" "Profile saved successfully!" + "settings.profile.profile.profile-saved" "Name, username and email" + "settings.profile.your-name" "Your name" + "settings.profile.your-username" "Your username" + "settings.profile.your-email" "Your email" + "settings.profile.light-theme" "Light theme" + "settings.profile.dark-theme" "Dark theme" + "settings.profile.high-contrast-theme" "High-contrast theme" + "settings.profile.your-avatar" "Your avatar" + + "settings.password.password-saved" "Password saved successfully!" + "settings.password.wrong-old-password" "Wrong old password" + "settings.password.change-password" "Change password" + "settings.password.old-password" "Old password" + "settings.password.new-password" "New password" + "settings.password.confirm-password" "Confirm password" + + "settings.notifications.notifications-saved" "Notifications preferences saved successfully!" + "settings.notifications.prototype-notifications" "Prototype notifications" + "settings.notifications.description" "Get a roll up of prototype changes in your inbox." + "settings.notifications.none" "None" + "settings.notifications.every-hour" "Every hour" + "settings.notifications.every-day" "Every day" + "settings.update-settings" "Update settings" "history.alert-message" "You are seeing version %s" diff --git a/frontend/src/uxbox/main/locales/fr.cljs b/frontend/src/uxbox/main/locales/fr.cljs index f61569d6a..b40733f68 100644 --- a/frontend/src/uxbox/main/locales/fr.cljs +++ b/frontend/src/uxbox/main/locales/fr.cljs @@ -53,22 +53,23 @@ "ds.your-images-title" "VOS IMAGES" "ds.store-images-title" "BOUTIQUE" "ds.images-collection.new" "+ Nouvelle librairie" - "ds.image-new" "+ New image" + "ds.image-new" "+ Nouvelle image" "ds.colors" "COULEURS" "ds.num-colors" ["Nb couleurs" "%s couleur" "%s couleurs"] - "ds.your-colors-title" "YOUR COLORS" + "ds.your-colors-title" "VOS COULEURS" "ds.store-colors-title" "BOUTIQUE" "ds.colors-collection.new" "+ Nouvelle librairie" - "ds.color-new" "+ Nouvelle color" + "ds.color-new" "+ Nouvelle couleur" "ds.color-lightbox.title" "Nouvelle couleur" "ds.color-lightbox.add" "+ Ajouter couleur" "ds.library-title" "Librairie : " "ds.standard-title" "STANDARD" "ds.your-libraries-title" "VOS LIBRAIRIES" + "ds.default-library-title" "Collection sans nom (%s)" "ds.recent-colors" "Couleurs récentes" "ds.element-options" "Options d'élément" @@ -115,21 +116,31 @@ "settings.profile" "PROFIL" "settings.password" "MOT DE PASSE" "settings.notifications" "NOTIFICATIONS" - "settings.profile-saved" "Profil enregistré avec succès !" - "settings.name-username-email" "Nom, nom d'utilisateur et adresse email" - "settings.your-name" "Votre nom complet" - "settings.your-username" "Votre nom d'utilisateur" - "settings.your-email" "Votre adresse email" - "settings.light-theme" "Thème Jour" - "settings.dark-theme" "Thème Nuit" - "settings.high-contrast-theme" "Thème Contraste élevé" - "settings.your-avatar" "Votre avatar" - "settings.password-saved" "Mot de passe enregistré avec succès !" - "settings.wrong-old-password" "Ancien mot de passe incorrect" - "settings.change-password" "Changement de mot de passe" - "settings.old-password" "Ancien mot de passe" - "settings.new-password" "Nouveau mot de passe" - "settings.confirm-password" "Confirmez mot de passe" + + "settings.profile.profile-saved" "Profil enregistré avec succès !" + "settings.profile.profile.profile-saved" "Nom, nom d'utilisateur et adresse email" + "settings.profile.your-name" "Votre nom complet" + "settings.profile.your-username" "Votre nom d'utilisateur" + "settings.profile.your-email" "Votre adresse email" + "settings.profile.light-theme" "Thème Jour" + "settings.profile.dark-theme" "Thème Nuit" + "settings.profile.high-contrast-theme" "Thème Contraste élevé" + "settings.profile.your-avatar" "Votre avatar" + + "settings.password.password-saved" "Mot de passe enregistré avec succès !" + "settings.password.wrong-old-password" "Ancien mot de passe incorrect" + "settings.password.change-password" "Changement de mot de passe" + "settings.password.old-password" "Ancien mot de passe" + "settings.password.new-password" "Nouveau mot de passe" + "settings.password.confirm-password" "Confirmez mot de passe" + + "settings.notifications.notifications-saved" "Préférences de notifications enregistrées avec succès !" + "settings.notifications.prototype-notifications" "Notifications de prototypage" + "settings.notifications.description" "Obtenez un résumé des modifications apportées aux prototypes à votre adresse email." + "settings.notifications.none" "Aucune" + "settings.notifications.every-hour" "Chaque heure" + "settings.notifications.every-day" "Chaque jour" + "settings.update-settings" "Mettre à jour les paramètres" "history.alert-message" "Vous voyez la version %s" diff --git a/frontend/src/uxbox/main/ui/settings/notifications.cljs b/frontend/src/uxbox/main/ui/settings/notifications.cljs index fc7fbbd3e..a70770e12 100644 --- a/frontend/src/uxbox/main/ui/settings/notifications.cljs +++ b/frontend/src/uxbox/main/ui/settings/notifications.cljs @@ -24,25 +24,29 @@ (header) [:section.dashboard-content.user-settings [:section.user-settings-content - [:span.user-settings-label "Prototype notifications"] - [:p "Get a roll up of prototype changes in your inbox."] + [:span.user-settings-label (tr "settings.notifications.none")] + [:p (tr "settings.notifications.description")] [:div.input-radio.radio-primary [:input {:type "radio" :id "notification-1" :name "notification" :value "none"}] [:label {:for "notification-1" - :value "None"} "None"] + :value (tr "settings.notifications.none")} (tr "settings.notifications.none")] [:input {:type "radio" :id "notification-2" :name "notification" :value "every-hour"}] [:label {:for "notification-2" - :value "Every hour"} "Every hour"] + :value (tr "settings.notifications.every-hour")} (tr "settings.notifications.every-hour")] [:input {:type "radio" :id "notification-3" :name "notification" :value "every-day"}] - [:label {:for "notification-3" :value "Every day"} "Every day"]] - [:input.btn-primary {:type "submit" :value "Update settings"}] + [:label {:for "notification-3" + :value (tr "settings.notifications.every-day")} (tr "settings.notifications.every-day")]] + [:input.btn-primary {:type "submit" + :class "btn-disabled" + :disabled true + :value (tr "settings.update-settings")}] ]]]) diff --git a/frontend/src/uxbox/main/ui/settings/password.cljs b/frontend/src/uxbox/main/ui/settings/password.cljs index 0c71fc0d8..25d0cec76 100644 --- a/frontend/src/uxbox/main/ui/settings/password.cljs +++ b/frontend/src/uxbox/main/ui/settings/password.cljs @@ -49,11 +49,11 @@ (let [value (dom/event->value event)] (st/emit! (assoc-value field value)))) (on-success [] - (st/emit! (um/info (tr "settings.password-saved")))) + (st/emit! (um/info (tr "settings.password.password-saved")))) (on-error [{:keys [code] :as payload}] (case code :uxbox.services.users/old-password-not-match - (st/emit! (assoc-error :password-old (tr "settings.wrong-old-password"))) + (st/emit! (assoc-error :password-old (tr "settings.password.wrong-old-password"))) :else (throw (ex-info "unexpected" {:error payload})))) @@ -62,27 +62,27 @@ :on-success on-success :on-error on-error)))] [:form.password-form - [:span.user-settings-label (tr "settings.change-password")] + [:span.user-settings-label (tr "settings.password.change-password")] [:input.input-text {:type "password" :class (fm/error-class errors :password-old) :value (:password-old data "") :on-change (partial on-change :password-old) - :placeholder (tr "settings.old-password")}] + :placeholder (tr "settings.password.old-password")}] (fm/input-error errors :password-old) [:input.input-text {:type "password" :class (fm/error-class errors :password-1) :value (:password-1 data "") :on-change (partial on-change :password-1) - :placeholder (tr "settings.new-password")}] + :placeholder (tr "settings.password.new-password")}] (fm/input-error errors :password-1) [:input.input-text {:type "password" :class (fm/error-class errors :password-2) :value (:password-2 data "") :on-change (partial on-change :password-2) - :placeholder (tr "settings.confirm-password")}] + :placeholder (tr "settings.password.confirm-password")}] (fm/input-error errors :password-2) [:input.btn-primary {:type "button" diff --git a/frontend/src/uxbox/main/ui/settings/profile.cljs b/frontend/src/uxbox/main/ui/settings/profile.cljs index 46454231a..1468c6730 100644 --- a/frontend/src/uxbox/main/ui/settings/profile.cljs +++ b/frontend/src/uxbox/main/ui/settings/profile.cljs @@ -71,24 +71,24 @@ (on-submit [event] (st/emit! (udu/update-profile data on-success on-error)))] [:form.profile-form - [:span.user-settings-label (tr "settings.name-username-email")] + [:span.user-settings-label (tr "settings.profile.profile.profile-saved")] [:input.input-text {:type "text" :on-change (partial on-change :fullname) :value (:fullname data "") - :placeholder (tr "settings.your-name")}] + :placeholder (tr "settings.profile.your-name")}] [:input.input-text {:type "text" :on-change (partial on-change :username) :value (:username data "") - :placeholder (tr "settings.your-username")}] + :placeholder (tr "settings.profile.your-username")}] (fm/input-error errors :username) [:input.input-text {:type "email" :on-change (partial on-change :email) :value (:email data "") - :placeholder (tr "settings.your-email")}] + :placeholder (tr "settings.profile.your-email")}] (fm/input-error errors :email) #_[:span.user-settings-label (tr "settings.choose-color-theme")] @@ -99,7 +99,7 @@ :id "light-theme" :name "theme" :value "light"}] - [:label {:for "light-theme"} (tr "settings.light-theme")] + [:label {:for "light-theme"} (tr "settings.profile.light-theme")] [:input {:type "radio" :checked (when (= theme "dark") "checked") @@ -107,7 +107,7 @@ :id "dark-theme" :name "theme" :value "dark"}] - [:label {:for "dark-theme"} (tr "settings.dark-theme")] + [:label {:for "dark-theme"} (tr "settings.profile.dark-theme")] [:input {:type "radio" :checked (when (= theme "high-contrast") "checked") @@ -115,7 +115,7 @@ :id "high-contrast-theme" :name "theme" :value "high-contrast"}] - [:label {:for "high-contrast-theme"} (tr "settings.high-contrast-theme")]] + [:label {:for "high-contrast-theme"} (tr "settings.profile.high-contrast-theme")]] [:input.btn-primary {:type "button" @@ -156,6 +156,6 @@ (header) [:section.dashboard-content.user-settings [:section.user-settings-content - [:span.user-settings-label (tr "settings.your-avatar")] + [:span.user-settings-label (tr "settings.profile.your-avatar")] (profile-photo-form) (profile-form)]]])