Skip to content

💄 style(spelling): correct "broswer" to "browser" across codebase #6876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion locales/fa-IR/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
"title": "زبان تشخیص گفتار"
},
"sttService": {
"desc": "در این میان، broswer به سرویس تشخیص گفتار بومی مرورگر اشاره دارد",
"desc": "در این میان، browser به سرویس تشخیص گفتار بومی مرورگر اشاره دارد",
"title": "سرویس تشخیص گفتار"
},
"title": "سرویس‌های گفتاری",
Expand Down
2 changes: 1 addition & 1 deletion locales/zh-CN/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
"title": "语音识别语种"
},
"sttService": {
"desc": "其中 broswer 为浏览器原生的语音识别服务",
"desc": "其中 browser 为浏览器原生的语音识别服务",
"title": "语音识别服务"
},
"title": "语音服务",
Expand Down
2 changes: 1 addition & 1 deletion locales/zh-TW/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
"title": "語音識別語種"
},
"sttService": {
"desc": "其中 broswer 為瀏覽器原生的語音識別服務",
"desc": "其中 browser 為瀏覽器原生的語音識別服務",
"title": "語音識別服務"
},
"title": "語音服務",
Expand Down
2 changes: 1 addition & 1 deletion src/config/modelProviders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const filterEnabledModels = (provider: ModelProviderCard) => {
return provider.chatModels.filter((v) => v.enabled).map((m) => m.id);
};

export const isProviderDisableBroswerRequest = (id: string) => {
export const isProviderDisableBrowserRequest = (id: string) => {
const provider = DEFAULT_MODEL_PROVIDER_LIST.find((v) => v.id === id && v.disableBrowserRequest);
return !!provider;
};
Expand Down
2 changes: 1 addition & 1 deletion src/locales/default/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export default {
title: '语音识别语种',
},
sttService: {
desc: '其中 broswer 为浏览器原生的语音识别服务',
desc: '其中 browser 为浏览器原生的语音识别服务',
title: '语音识别服务',
},
title: '语音服务',
Expand Down
6 changes: 3 additions & 3 deletions src/store/aiInfra/slices/aiProvider/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isProviderDisableBroswerRequest } from '@/config/modelProviders';
import { isProviderDisableBrowserRequest } from '@/config/modelProviders';
import { AIProviderStoreState } from '@/store/aiInfra/initialState';
import { AiProviderRuntimeConfig } from '@/types/aiProvider';
import { GlobalLLMProviderKey } from '@/types/user/settings';
Expand Down Expand Up @@ -59,8 +59,8 @@ const isProviderFetchOnClient =
(provider: GlobalLLMProviderKey | string) => (s: AIProviderStoreState) => {
const config = providerConfigById(provider)(s);

// If the provider already disable broswer request in model config, force on Server.
if (isProviderDisableBroswerRequest(provider)) return false;
// If the provider already disable browser request in model config, force on Server.
if (isProviderDisableBrowserRequest(provider)) return false;

// If the provider in the whitelist, follow the user settings
if (providerWhitelist.has(provider) && typeof config?.fetchOnClient !== 'undefined')
Expand Down
4 changes: 2 additions & 2 deletions src/store/user/slices/modelList/selectors/modelConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ describe('modelConfigSelectors', () => {
expect(modelConfigSelectors.isProviderFetchOnClient('azure')(s)).toBe(true);
});

// Qwen provider not work in broswer request. Please skip this case if it work in future.
// Qwen provider not work in browser request. Please skip this case if it work in future.
// Issue: https://github.com/lobehub/lobe-chat/issues/3108
// PR: https://github.com/lobehub/lobe-chat/pull/3133
it('client fecth should be disabled if provider is disable broswer request', () => {
it('client fecth should be disabled if provider is disable browser request', () => {
const s = merge(initialSettingsState, {
settings: {
languageModel: {
Expand Down
6 changes: 3 additions & 3 deletions src/store/user/slices/modelList/selectors/modelConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isProviderDisableBroswerRequest } from '@/config/modelProviders';
import { isProviderDisableBrowserRequest } from '@/config/modelProviders';
import { UserStore } from '@/store/user';
import { GlobalLLMProviderKey } from '@/types/user/settings';

Expand All @@ -19,8 +19,8 @@ const providerWhitelist = new Set(['ollama']);
const isProviderFetchOnClient = (provider: GlobalLLMProviderKey | string) => (s: UserStore) => {
const config = getProviderConfigById(provider)(s);

// If the provider already disable broswer request in model config, force on Server.
if (isProviderDisableBroswerRequest(provider)) return false;
// If the provider already disable browser request in model config, force on Server.
if (isProviderDisableBrowserRequest(provider)) return false;

// If the provider in the whitelist, follow the user settings
if (providerWhitelist.has(provider) && typeof config?.fetchOnClient !== 'undefined')
Expand Down
Loading