@lobehub/chat 1.36.28 → 1.36.29

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.36.29](https://github.com/lobehub/lobe-chat/compare/v1.36.28...v1.36.29)
6
+
7
+ <sup>Released on **2024-12-16**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix discover locale with different default lang.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix discover locale with different default lang, closes [#5045](https://github.com/lobehub/lobe-chat/issues/5045) ([915827e](https://github.com/lobehub/lobe-chat/commit/915827e))
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.36.28](https://github.com/lobehub/lobe-chat/compare/v1.36.27...v1.36.28)
6
31
 
7
32
  <sup>Released on **2024-12-16**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Fix discover locale with different default lang."
6
+ ]
7
+ },
8
+ "date": "2024-12-16",
9
+ "version": "1.36.29"
10
+ },
2
11
  {
3
12
  "children": {},
4
13
  "date": "2024-12-16",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.36.28",
3
+ "version": "1.36.29",
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",
@@ -1,4 +1,4 @@
1
- import { normalizeLocale, supportLocales } from '@/locales/resources';
1
+ import { supportLocales } from '@/locales/resources';
2
2
 
3
3
  export const DEFAULT_LANG = 'en-US';
4
4
  export const LOBE_LOCALE_COOKIE = 'LOBE_LOCALE';
@@ -7,6 +7,4 @@ export const LOBE_LOCALE_COOKIE = 'LOBE_LOCALE';
7
7
  * Check if the language is supported
8
8
  * @param locale
9
9
  */
10
- export const isLocaleNotSupport = (locale: string) => {
11
- return normalizeLocale(locale) === DEFAULT_LANG || !supportLocales.includes(locale);
12
- };
10
+ export const isLocaleNotSupport = (locale: string) => !supportLocales.includes(locale);
@@ -8,7 +8,7 @@ describe('AssistantStore', () => {
8
8
  it('should return the default index URL when no language is provided', () => {
9
9
  const agentMarket = new AssistantStore();
10
10
  const url = agentMarket.getAgentIndexUrl();
11
- expect(url).toBe(baseURL);
11
+ expect(url).toBe(`${baseURL}/index.en-US.json`);
12
12
  });
13
13
 
14
14
  it('should return the index URL for a not supported language', () => {
@@ -20,13 +20,17 @@ describe('AssistantStore', () => {
20
20
  it('should return the zh-CN URL for zh locale', () => {
21
21
  const agentMarket = new AssistantStore();
22
22
  const url = agentMarket.getAgentIndexUrl('zh' as any);
23
- expect(url).toBe('https://registry.npmmirror.com/@lobehub/agents-index/v1/files/public/index.zh-CN.json');
23
+ expect(url).toBe(
24
+ 'https://registry.npmmirror.com/@lobehub/agents-index/v1/files/public/index.zh-CN.json',
25
+ );
24
26
  });
25
27
 
26
28
  it('should return the default URL for en locale', () => {
27
29
  const agentMarket = new AssistantStore();
28
30
  const url = agentMarket.getAgentIndexUrl('en' as any);
29
- expect(url).toBe('https://registry.npmmirror.com/@lobehub/agents-index/v1/files/public');
31
+ expect(url).toBe(
32
+ 'https://registry.npmmirror.com/@lobehub/agents-index/v1/files/public/index.en-US.json',
33
+ );
30
34
  });
31
35
 
32
36
  it('should return the base URL if the provided language is not supported', () => {
@@ -38,7 +42,7 @@ describe('AssistantStore', () => {
38
42
  it('should return the agent URL with default language when no language is provided', () => {
39
43
  const agentMarket = new AssistantStore();
40
44
  const url = agentMarket.getAgentUrl('agent-123');
41
- expect(url).toBe(`${baseURL}/agent-123.json`);
45
+ expect(url).toBe(`${baseURL}/agent-123.en-US.json`);
42
46
  });
43
47
 
44
48
  it('should return the agent URL for a supported language', () => {
@@ -9,13 +9,13 @@ describe('PluginStore', () => {
9
9
  it('should return the default index URL when no language is provided', () => {
10
10
  const pluginStore = new PluginStore();
11
11
  const url = pluginStore.getPluginIndexUrl();
12
- expect(url).toBe(baseURL);
12
+ expect(url).toBe(`${baseURL}/index.en-US.json`);
13
13
  });
14
14
 
15
15
  it('should return the index URL for a supported language', () => {
16
16
  const pluginStore = new PluginStore();
17
17
  const url = pluginStore.getPluginIndexUrl('en-US');
18
- expect(url).toBe(baseURL);
18
+ expect(url).toBe(`${baseURL}/index.en-US.json`);
19
19
  });
20
20
 
21
21
  it('should return the base URL if the provided language is not supported', () => {