mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
🌐 chore: translate non-English comments to English in desktop core modules (#11873)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,14 +34,14 @@ export interface RouteInterceptConfig {
|
||||
*/
|
||||
export const interceptRoutes: RouteInterceptConfig[] = [
|
||||
{
|
||||
description: '开发者工具',
|
||||
description: 'Developer Tools',
|
||||
enabled: true,
|
||||
pathPrefix: '/desktop/devtools',
|
||||
targetWindow: 'devtools',
|
||||
},
|
||||
// 未来可能的其他路由
|
||||
// Possible future routes
|
||||
// {
|
||||
// description: '帮助中心',
|
||||
// description: 'Help Center',
|
||||
// enabled: true,
|
||||
// pathPrefix: '/help',
|
||||
// targetWindow: 'help',
|
||||
@@ -49,24 +49,24 @@ export const interceptRoutes: RouteInterceptConfig[] = [
|
||||
];
|
||||
|
||||
/**
|
||||
* 通过路径查找匹配的路由拦截配置
|
||||
* @param path 需要检查的路径
|
||||
* @returns 匹配的拦截配置,如果没有匹配则返回 undefined
|
||||
* Find matching route intercept configuration by path
|
||||
* @param path Path to check
|
||||
* @returns Matching intercept configuration, or undefined if no match found
|
||||
*/
|
||||
export const findMatchingRoute = (path: string): RouteInterceptConfig | undefined => {
|
||||
return interceptRoutes.find((route) => route.enabled && path.startsWith(route.pathPrefix));
|
||||
};
|
||||
|
||||
/**
|
||||
* 从完整路径中提取子路径
|
||||
* @param fullPath 完整路径,如 '/settings/agent'
|
||||
* @param pathPrefix 路径前缀,如 '/settings'
|
||||
* @returns 子路径,如 'agent'
|
||||
* Extract sub-path from full path
|
||||
* @param fullPath Full path, e.g., '/settings/agent'
|
||||
* @param pathPrefix Path prefix, e.g., '/settings'
|
||||
* @returns Sub-path, e.g., 'agent'
|
||||
*/
|
||||
export const extractSubPath = (fullPath: string, pathPrefix: string): string | undefined => {
|
||||
if (fullPath.length <= pathPrefix.length) return undefined;
|
||||
|
||||
// 去除前导斜杠
|
||||
// Remove leading slash
|
||||
const subPath = fullPath.slice(Math.max(0, pathPrefix.length + 1));
|
||||
return subPath || undefined;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ export const githubConfig = {
|
||||
};
|
||||
|
||||
export const updaterConfig = {
|
||||
// 应用Update configuration
|
||||
// Application update configuration
|
||||
app: {
|
||||
// Whether to auto-check for updates
|
||||
autoCheckUpdate: true,
|
||||
|
||||
@@ -37,24 +37,24 @@ export interface McpSchema {
|
||||
homepage?: string;
|
||||
/** Plugin icon */
|
||||
icon?: string;
|
||||
/** Plugin unique identifier,必须与URL中的id参数匹配 */
|
||||
/** Plugin unique identifier, must match the id parameter in the URL */
|
||||
identifier: string;
|
||||
/** 插件名称 */
|
||||
/** Plugin name */
|
||||
name: string;
|
||||
/** 插件版本 (semver) */
|
||||
/** Plugin version (semver) */
|
||||
version: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 协议URL解析结果
|
||||
* Protocol URL parsing result
|
||||
*/
|
||||
export interface ProtocolUrlParsed {
|
||||
/** Action type (e.g., 'install') */
|
||||
action: string;
|
||||
/** 原始URL */
|
||||
/** Original URL */
|
||||
originalUrl: string;
|
||||
/** 解析后的所有查询参数 */
|
||||
/** All parsed query parameters */
|
||||
params: Record<string, string>;
|
||||
/** URL类型 (如: 'plugin') */
|
||||
/** URL type (e.g., 'plugin') */
|
||||
urlType: string;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import { getDesktopEnv } from '@/env';
|
||||
electronLog.transports.file.level = 'info'; // Log info level and above in production
|
||||
electronLog.transports.console.level =
|
||||
getDesktopEnv().NODE_ENV === 'development'
|
||||
? 'debug' // 开发环境显示更多日志
|
||||
: 'info'; // 生产环境显示 info 及以上级别
|
||||
? 'debug' // Show more logs in development environment
|
||||
: 'info'; // Show info level and above in production environment
|
||||
|
||||
// Create namespaced debugger
|
||||
export const createLogger = (namespace: string) => {
|
||||
|
||||
Reference in New Issue
Block a user