Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🌐 chore: translate non-English comments to English in routes and layout (#13210)

LobeHub Bot0689dd68a3f5
diff --git a/src/app/(backend)/api/v1/[[...route]]/route.ts b/src/app/(backend)/api/v1/[[...route]]/route.ts
index 991f8d11d5b..20694db214c 100644
--- a/src/app/(backend)/api/v1/[[...route]]/route.ts
+++ b/src/app/(backend)/api/v1/[[...route]]/route.ts
@@ -2,7 +2,7 @@ import lobeOpenApi from '@lobechat/openapi';
const handler = (request: Request) => lobeOpenApi.fetch(request);
-// 导出所有需要的HTTP方法处理器
+// Export all required HTTP method handlers
export const GET = handler;
export const POST = handler;
export const PUT = handler;
diff --git a/src/app/(backend)/oidc/handoff/route.ts b/src/app/(backend)/oidc/handoff/route.ts
index 7e05f74d73e..2d86b41a31f 100644
--- a/src/app/(backend)/oidc/handoff/route.ts
+++ b/src/app/(backend)/oidc/handoff/route.ts
@@ -9,7 +9,7 @@ const log = debug('lobe-oidc:handoff');
/**
* GET /oidc/handoff?id=xxx&client=xxx
- * 轮询获取并消费认证凭证
+ * Poll to fetch and consume the authentication credential
*/
export async function GET(request: NextRequest) {
log('Received GET request for /oidc/handoff');
diff --git a/src/app/[variants]/(auth)/oauth/consent/[uid]/Consent/index.tsx b/src/app/[variants]/(auth)/oauth/consent/[uid]/Consent/index.tsx
index 22ad9e32587..791d855a9e4 100644
--- a/src/app/[variants]/(auth)/oauth/consent/[uid]/Consent/index.tsx
+++ b/src/app/[variants]/(auth)/oauth/consent/[uid]/Consent/index.tsx
@@ -23,7 +23,7 @@ interface ClientProps {
}
/**
- * 获取 Scope 的描述
+ * Get the description for a scope
*/
function getScopeDescription(scope: string, t: any): string {
return t(`consent.scope.${scope.replace(':', '-')}`, scope);
diff --git a/src/layout/GlobalProvider/Query.tsx b/src/layout/GlobalProvider/Query.tsx
index 07d7b4e349a..bd631c9da38 100644
--- a/src/layout/GlobalProvider/Query.tsx
+++ b/src/layout/GlobalProvider/Query.tsx
@@ -17,7 +17,7 @@ const QueryProvider = ({ children }: PropsWithChildren) => {
typeof lambdaQuery.Provider
>['queryClient'];
- // 使用 useState 确保 provider 只创建一次
+ // Use useState to ensure the provider is only created once
const [provider] = useState(swrCacheProvider);
return (
diff --git a/src/libs/traces/event.ts b/src/libs/traces/event.ts
index f2067214a8b..44940bc85af 100644
--- a/src/libs/traces/event.ts
+++ b/src/libs/traces/event.ts
@@ -11,7 +11,7 @@ import {
} from '@/types/trace';
/**
- * trace 事件得分
+ * Trace event scores
*/
export enum EventScore {
DeleteAndRegenerate = -1,
diff --git a/src/routes/(desktop)/desktop-onboarding/_layout/style.ts b/src/routes/(desktop)/desktop-onboarding/_layout/style.ts
index 3e8c80bdc6d..ca867a507cc 100644
--- a/src/routes/(desktop)/desktop-onboarding/_layout/style.ts
+++ b/src/routes/(desktop)/desktop-onboarding/_layout/style.ts
@@ -3,12 +3,12 @@ import { createStaticStyles } from 'antd-style';
import { isMacOSWithLargeWindowBorders } from '@/utils/platform';
export const styles = createStaticStyles(({ css, cssVar }) => ({
- // Divider 样式
+ // Divider style
divider: css`
height: 24px;
`,
- // 内层容器 - 深色模式
+ // Inner container - dark mode
innerContainerDark: css`
position: relative;
@@ -22,7 +22,7 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({
background: ${cssVar.colorBgContainer};
`,
- // 内层容器 - 浅色模式
+ // Inner container - light mode
innerContainerLight: css`
position: relative;
@@ -36,7 +36,7 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({
background: ${cssVar.colorBgContainer};
`,
- // 外层容器
+ // Outer container
outerContainer: css`
position: relative;
`,
diff --git a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx b/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx
index 92bd1114495..89df159f3f5 100644
--- a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx
+++ b/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx
@@ -26,10 +26,10 @@ const LEGACY_LOCAL_DB_MIGRATION_GUIDE_URL = urlJoin(
'/docs/usage/migrate-from-local-database',
);
-// 登录方式类型
+// Login method type
type LoginMethod = 'cloud' | 'selfhost';
-// 登录状态类型
+// Login status type
type LoginStatus = 'idle' | 'loading' | 'success' | 'error';
const authorizationPhaseI18nKeyMap: Record<AuthorizationPhase, string> = {
@@ -117,12 +117,12 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
!!endpoint.trim() &&
endpoint.trim() === (dataSyncConfig?.remoteServerUrl ?? '');
- // 判断是否可以开始使用(任一方式成功即可)
+ // Determine if user can proceed (either method succeeding is sufficient)
const canStart = () => {
return isCloudAuthed || cloudLoginStatus === 'success' || isSelfHostEndpointVerified;
};
- // 处理云端登录
+ // Handle cloud login
const handleCloudLogin = async () => {
if (!isDesktop) {
setRemoteError(t('screen5.errors.desktopOnlyOidc'));
@@ -140,7 +140,7 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
});
};
- // 处理自建服务器连接
+ // Handle self-hosted server connection
const handleSelfhostConnect = async () => {
if (!isDesktop) {
setRemoteError(t('screen5.errors.desktopOnlyOidc'));
@@ -157,7 +157,7 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
await connectRemoteServer({ remoteServerUrl: url, storageMode: 'selfHost' });
};
- // 退出登录(断开远程同步授权)并回到登录选择
+ // Sign out (disconnect remote sync authorization) and return to login selection
const handleSignOut = async () => {
if (isSigningOut) return;
@@ -259,7 +259,7 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
await remoteServerService.cancelAuthorization();
};
- // 渲染 Cloud 登录内容
+ // Render Cloud login content
const renderCloudContent = () => {
if (cloudLoginStatus === 'success') {
return (
@@ -361,7 +361,7 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
);
};
- // 渲染 Self-host 登录内容
+ // Render Self-host login content
const renderSelfhostContent = () => {
if (selfhostLoginStatus === 'success') {
return (
diff --git a/src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsx b/src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsx
index 0868393e594..826d4256729 100644
--- a/src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsx
+++ b/src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsx
@@ -23,7 +23,7 @@ const WelcomeStep = memo<WelcomeStepProps>(({ onNext }) => {
const updateGeneralConfig = useUserStore((s) => s.updateGeneralConfig);
const handleNext = () => {
- // 默认启用 telemetry
+ // Enable telemetry by default
updateGeneralConfig({ telemetry: true });
onNext();
};
diff --git a/src/routes/(desktop)/desktop-onboarding/index.tsx b/src/routes/(desktop)/desktop-onboarding/index.tsx
index f9838e7f8f0..041ed9b5b5b 100644
--- a/src/routes/(desktop)/desktop-onboarding/index.tsx
+++ b/src/routes/(desktop)/desktop-onboarding/index.tsx
@@ -88,7 +88,7 @@ const DesktopOnboardingPage = memo(() => {
setDesktopOnboardingScreen(currentScreen);
}, [currentScreen, isLoading]);
- // 设置窗口大小和可调整性
+ // Set window size and resizability
useEffect(() => {
const minimumSize = { height: 900, width: 1200 };
@@ -110,7 +110,7 @@ const DesktopOnboardingPage = memo(() => {
};
}, []);
- // 检测平台:非 macOS 直接跳过权限页
+ // Detect platform: skip permissions page on non-macOS
useEffect(() => {
let mounted = true;
const detectPlatform = async () => {
diff --git a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts b/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts
index 5764ee4dd2a..0a5283ba1aa 100644
--- a/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts
+++ b/src/routes/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts
@@ -39,7 +39,7 @@ export const useMarketPublish = ({ action, onSuccess }: UseMarketPublishOptions)
const { t } = useTranslation('setting');
const [isPublishing, setIsPublishing] = useState(false);
const [isCheckingOwnership, setIsCheckingOwnership] = useState(false);
- // 使用 ref 来同步跟踪发布状态,避免闭包导致的竞态问题
+ // Use ref to synchronously track publishing state and avoid race conditions caused by closures
const isPublishingRef = useRef(false);
const { isAuthenticated } = useMarketAuth();
@@ -95,12 +95,12 @@ export const useMarketPublish = ({ action, onSuccess }: UseMarketPublishOptions)
}, [meta?.marketIdentifier]);
const publish = useCallback(async () => {
- // 防止重复发布:使用 ref 同步检查,避免闭包导致的竞态问题
+ // Prevent duplicate publishing: use ref for synchronous check to avoid race conditions from closures
if (isPublishingRef.current) {
return { success: false };
}
- // 检查认证状态 - tRPC 会自动处理 trustedClient
+ // Check authentication state - tRPC handles trustedClient automatically
if (!isAuthenticated) {
return { success: false };
}
@@ -113,12 +113,12 @@ export const useMarketPublish = ({ action, onSuccess }: UseMarketPublishOptions)
const changelog = generateDefaultChangelog();
try {
- // 立即设置 ref,防止重复调用
+ // Set ref immediately to prevent duplicate calls
isPublishingRef.current = true;
setIsPublishing(true);
message.loading({ content: loadingMessage, key: messageKey });
- // 使用 tRPC publishOrCreate - 后端会自动处理 ownership 检查
+ // Use tRPC publishOrCreate - backend handles ownership check automatically
const result = await lambdaClient.market.agent.publishOrCreate.mutate({
avatar: meta?.avatar,
changelog,
@@ -150,14 +150,14 @@ export const useMarketPublish = ({ action, onSuccess }: UseMarketPublishOptions)
},
description: meta?.description || '',
editorData,
- // 传递现有的 identifier,后端会检查 ownership
+ // Pass existing identifier; backend will check ownership
identifier: meta?.marketIdentifier,
name: meta?.title || '',
tags: meta?.tags,
tokenUsage,
});
- // 如果是新创建的 agent,需要更新 meta
+ // If a new agent was created, update meta with the new identifier
if (result.isNewAgent) {
updateAgentMeta({ marketIdentifier: result.identifier });
}
diff --git a/src/routes/(main)/community/features/UserAvatar/index.tsx b/src/routes/(main)/community/features/UserAvatar/index.tsx
index 02a0af09369..bfcff3ae7d3 100644
--- a/src/routes/(main)/community/features/UserAvatar/index.tsx
+++ b/src/routes/(main)/community/features/UserAvatar/index.tsx
@@ -11,8 +11,8 @@ import { useServerConfigStore } from '@/store/serverConfig';
import { serverConfigSelectors } from '@/store/serverConfig/selectors';
/**
- * 检查用户是否需要完善资料
- * 当使用 trustedClient 自动授权时,用户的 meta 相关字段会为空
+ * Check whether the user needs to complete their profile
+ * When using trustedClient auto-authorization, the user's meta-related fields will be empty
*/
const checkNeedsProfileSetup = (
enableMarketTrustedClient: boolean,
@@ -28,7 +28,7 @@ const checkNeedsProfileSetup = (
if (!enableMarketTrustedClient) return false;
if (!userProfile) return true;
- // 如果 avatarUrl 字段为空,则需要完善资料
+ // If the avatarUrl field is empty, the user needs to complete their profile
const hasAvatarUrl = !!userProfile.avatarUrl;
return !hasAvatarUrl;
@@ -50,15 +50,15 @@ const UserAvatar = memo(() => {
// Use SWR to fetch user profile with caching
const { data: userProfile } = useMarketUserProfile(username);
- // 检查是否需要完善资料
+ // Check whether profile setup is needed
const needsProfileSetup = checkNeedsProfileSetup(enableMarketTrustedClient, userProfile);
const handleSignIn = useCallback(async () => {
setLoading(true);
try {
- // 统一调用 signIn,会先弹出确认弹窗
- // trustedClient 模式下确认后会弹出 ProfileSetupModal
- // OIDC 模式下确认后会走 OIDC 流程
+ // Unified call to signIn, which shows a confirmation dialog first
+ // In trustedClient mode, confirmation opens the ProfileSetupModal
+ // In OIDC mode, confirmation triggers the OIDC flow
await signIn();
} catch {
// User cancelled or error occurred
@@ -77,8 +77,8 @@ const UserAvatar = memo(() => {
return <Skeleton.Avatar active shape={'square'} size={28} style={{ borderRadius: 6 }} />;
}
- // 如果启用了 trustedClient,不显示"成为创作者"按钮,直接显示头像
- // 否则,未认证或需要完善资料时,显示登录按钮
+ // If trustedClient is enabled, skip the "become a creator" button and show the avatar directly
+ // Otherwise, show the login button when unauthenticated or profile setup is needed
if (!enableMarketTrustedClient && (!isAuthenticated || needsProfileSetup)) {
return (
<Button
diff --git a/src/routes/onboarding/_layout/style.ts b/src/routes/onboarding/_layout/style.ts
index 8ba1dd2bf00..862e4561dc6 100644
--- a/src/routes/onboarding/_layout/style.ts
+++ b/src/routes/onboarding/_layout/style.ts
@@ -1,12 +1,12 @@
import { createStaticStyles } from 'antd-style';
export const styles = createStaticStyles(({ css, cssVar }) => ({
- // Divider 样式
+ // Divider style
divider: css`
height: 24px;
`,
- // 内层容器 - 深色模式
+ // Inner container - dark mode
innerContainerDark: css`
position: relative;
@@ -18,7 +18,7 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({
background: ${cssVar.colorBgContainer};
`,
- // 内层容器 - 浅色模式
+ // Inner container - light mode
innerContainerLight: css`
position: relative;
@@ -30,7 +30,7 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({
background: ${cssVar.colorBgContainer};
`,
- // 外层容器
+ // Outer container
outerContainer: css`
position: relative;
`,