@lobehub/chat 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.3.2](https://github.com/lobehub/lobe-chat/compare/v1.3.1...v1.3.2)
6
+
7
+ <sup>Released on **2024-07-09**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Automatic refresh when change language.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Automatic refresh when change language, closes [#3181](https://github.com/lobehub/lobe-chat/issues/3181) ([b597c5a](https://github.com/lobehub/lobe-chat/commit/b597c5a))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.3.1](https://github.com/lobehub/lobe-chat/compare/v1.3.0...v1.3.1)
6
31
 
7
32
  <sup>Released on **2024-07-09**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -113,9 +113,9 @@
113
113
  "@khmyznikov/pwa-install": "^0.3.9",
114
114
  "@lobehub/chat-plugin-sdk": "^1.32.4",
115
115
  "@lobehub/chat-plugins-gateway": "^1.9.0",
116
- "@lobehub/icons": "^1.25.2",
116
+ "@lobehub/icons": "^1.26.0",
117
117
  "@lobehub/tts": "^1.24.3",
118
- "@lobehub/ui": "^1.146.4",
118
+ "@lobehub/ui": "^1.146.6",
119
119
  "@microsoft/fetch-event-source": "^2.0.1",
120
120
  "@neondatabase/serverless": "^0.9.4",
121
121
  "@next/third-parties": "^14.2.4",
@@ -4,6 +4,7 @@ import { Form, type ItemGroup, SelectWithImg, SliderWithInput } from '@lobehub/u
4
4
  import { Select } from 'antd';
5
5
  import isEqual from 'fast-deep-equal';
6
6
  import { Monitor, Moon, Sun } from 'lucide-react';
7
+ import { useRouter } from 'next/navigation';
7
8
  import { memo } from 'react';
8
9
  import { useTranslation } from 'react-i18next';
9
10
 
@@ -12,7 +13,7 @@ import { enableAuth } from '@/const/auth';
12
13
  import { FORM_STYLE } from '@/const/layoutTokens';
13
14
  import { imageUrl } from '@/const/url';
14
15
  import AvatarWithUpload from '@/features/AvatarWithUpload';
15
- import { localeOptions } from '@/locales/resources';
16
+ import { Locales, localeOptions } from '@/locales/resources';
16
17
  import { useUserStore } from '@/store/user';
17
18
  import { settingsSelectors, userGeneralSettingsSelectors } from '@/store/user/selectors';
18
19
  import { switchLang } from '@/utils/client/switchLang';
@@ -23,6 +24,7 @@ type SettingItemGroup = ItemGroup;
23
24
 
24
25
  const Theme = memo(() => {
25
26
  const { t } = useTranslation('setting');
27
+ const router = useRouter();
26
28
  const [form] = Form.useForm();
27
29
  const settings = useUserStore(settingsSelectors.currentSettings, isEqual);
28
30
  const themeMode = useUserStore(userGeneralSettingsSelectors.currentThemeMode);
@@ -30,6 +32,11 @@ const Theme = memo(() => {
30
32
 
31
33
  useSyncSettings(form);
32
34
 
35
+ const handleLangChange = (value: Locales) => {
36
+ switchLang(value);
37
+ router.refresh();
38
+ };
39
+
33
40
  const theme: SettingItemGroup = {
34
41
  children: [
35
42
  {
@@ -74,7 +81,7 @@ const Theme = memo(() => {
74
81
  {
75
82
  children: (
76
83
  <Select
77
- onChange={switchLang}
84
+ onChange={handleLangChange}
78
85
  options={[{ label: t('settingTheme.lang.autoMode'), value: 'auto' }, ...localeOptions]}
79
86
  />
80
87
  ),