diff --git a/package.json b/package.json index 7e9112b..60a2ec0 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,13 @@ "tauri": "tauri" }, "dependencies": { + "@fluent/bundle": "^0.19.1", "@tauri-apps/api": "^2", "@tauri-apps/plugin-http": "~2", "@tauri-apps/plugin-opener": "^2", "@tauri-apps/plugin-store": "~2", "@tauri-apps/plugin-websocket": "~2", + "fluent-vue": "^3.8.1", "vue": "^3.5.13", "vue-router": "^4.6.4" }, @@ -22,6 +24,7 @@ "@tauri-apps/cli": "^2", "@vitejs/plugin-vue": "^5.2.1", "typescript": "~5.6.2", + "unplugin-fluent-vue": "^1.4.1", "vite": "^6.0.3", "vue-tsc": "^2.1.10" } diff --git a/src/authStore.ts b/src/authStore.ts index 00eddf9..f669e80 100644 --- a/src/authStore.ts +++ b/src/authStore.ts @@ -53,3 +53,14 @@ export async function getLastRoom(): Promise { const s = await getStore() return (await s.get('last_room_uuid')) ?? null } + +export async function saveLocalePreference(locale: string) { + const s = await getStore() + await s.set('language', locale) + await s.save() +} + +export async function getLocalePreference(): Promise { + const s = await getStore() + return (await s.get('language')) ?? null +} diff --git a/src/components/ChatWindow.vue b/src/components/ChatWindow.vue index 496b4a4..e205c8b 100644 --- a/src/components/ChatWindow.vue +++ b/src/components/ChatWindow.vue @@ -4,7 +4,7 @@
-

Select a room to start talking

+

{{ $t('chat-no-room') }}

@@ -15,7 +15,7 @@
diff --git a/src/components/CreateRoomModal.vue b/src/components/CreateRoomModal.vue index b73c0ac..76151c2 100644 --- a/src/components/CreateRoomModal.vue +++ b/src/components/CreateRoomModal.vue @@ -1,22 +1,22 @@