From 52a621e9ba9540ec3db74e013504045da1f12aad Mon Sep 17 00:00:00 2001 From: Matt Kilgore Date: Wed, 7 Aug 2024 20:57:40 -0400 Subject: [PATCH] fix: use the browser default language --- frontend/layouts/default.vue | 5 ++--- frontend/locales/en.json | 9 +++++++-- frontend/pages/profile.vue | 30 +++++++----------------------- frontend/plugins/i18n.ts | 20 +++++++++++++++++++- 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/frontend/layouts/default.vue b/frontend/layouts/default.vue index eb0763a1..df117f37 100644 --- a/frontend/layouts/default.vue +++ b/frontend/layouts/default.vue @@ -103,12 +103,11 @@ import MdiMagnify from "~icons/mdi/magnify"; import MdiAccount from "~icons/mdi/account"; import MdiCog from "~icons/mdi/cog"; - const username = computed(() => authCtx.user?.name || "User"); - // Preload currency format useFormatCurrency(); - + const locale = useState("locale").value; + console.log(locale); const modals = reactive({ item: false, location: false, diff --git a/frontend/locales/en.json b/frontend/locales/en.json index 712529e0..f2b7fbe1 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -31,11 +31,16 @@ "change_password": "Change Password", "current_password": "Current Password", "new_password": "New Password", - "notifier": "{ type, select, true {Edit} false {Create} other {Other}} Notifier", + "notifier_modal": "{ type, select, true {Edit} false {Create} other {Other}} Notifier", + "notifiers": "Notifiers", + "notifiers_sub": "Get notifications for up coming maintenance reminders", "name": "Name", "url": "URL", "enabled": "Enabled", - "test": "Test" + "test": "Test", + "gen_invite": "Generate Invite Link", + "user_profile": "User Profile", + "user_profile_sub": "Invite users, and manage your account." }, "components": { "global": { diff --git a/frontend/pages/profile.vue b/frontend/pages/profile.vue index 4449e87f..fe3986d4 100644 --- a/frontend/pages/profile.vue +++ b/frontend/pages/profile.vue @@ -326,7 +326,7 @@ - +