99 * @param {string } logType - 日志类型 (info, warning, error, success)
1010 */
1111const sendDebugLog = ( message , logType = 'info' ) => {
12- // 早期返回模式 - 验证输入
12+ // 验证输入
1313 if ( ! message ) return ;
1414
1515 try {
@@ -192,6 +192,7 @@ const getFallbackTranslation = (key, params = {}) => {
192192 // 完整的 fallback 翻译
193193 const fallbackTranslations = {
194194 en : {
195+ // Update checker related keys
195196 'check_for_updates' : 'Check for updates' ,
196197 'checking_updates' : 'Checking for updates...' ,
197198 'update_available' : 'Update available: v{version}' ,
@@ -206,6 +207,31 @@ const getFallbackTranslation = (key, params = {}) => {
206207 'invalid_response' : 'Invalid response from server' ,
207208 'update_check_success' : 'Update check completed successfully' ,
208209 'update_notification_title' : 'Extension Update Available' ,
210+ 'using_persistent_cached_update_info' : 'Using persistent cached update information' ,
211+ 'update_check_completed' : 'Update check completed. Update available: {updateAvailable}' ,
212+ 'update_check_cancelled' : 'Update check was cancelled' ,
213+ 'update_check_attempt' : 'Update check attempt {attempt}/{maxAttempts}' ,
214+ 'update_check_succeeded_on_attempt' : 'Update check succeeded on attempt {attempt}' ,
215+ 'version_comparison_failed' : 'Version comparison failed: {error}' ,
216+ 'error_details' : 'Error details - Type: {type}, Original: {message}, Stack: {stack}' ,
217+ 'update_check_failed_after_attempts' : 'Update check failed after {attempt} attempts. Error: {error}' ,
218+ 'update_check_retry_delay' : 'Update check attempt {attempt} failed ({error}), retrying in {delay}ms...' ,
219+ 'update_info_cached_persistently' : 'Update information cached persistently' ,
220+ 'failed_cache_update_info' : 'Failed to cache update info persistently: {error}' ,
221+ 'invalid_persistent_cache_structure' : 'Invalid persistent cache structure, clearing' ,
222+ 'persistent_cache_different_version' : 'Persistent cache is for different version, clearing' ,
223+ 'persistent_cache_expired' : 'Persistent cache expired, clearing' ,
224+ 'failed_load_persistent_cache' : 'Failed to load persistent cache: {error}' ,
225+ 'persistent_cache_cleared' : 'Persistent cache cleared' ,
226+ 'failed_clear_persistent_cache' : 'Failed to clear persistent cache: {error}' ,
227+ 'update_checker_cache_cleared' : 'Update checker cache cleared' ,
228+ 'error_getting_cache_status' : 'Error getting persistent cache status: {error}' ,
229+ 'expired_memory_cache_cleaned' : 'Expired memory cache cleaned up' ,
230+ 'persistent_cache_optimization_completed' : 'Persistent cache optimization completed - no cleanup needed' ,
231+ 'cache_optimization_failed' : 'Cache optimization failed: {error}' ,
232+ 'cache_preload_failed' : 'Cache preload failed: {error}' ,
233+ 'providing_graceful_fallback' : 'Providing graceful fallback for update check' ,
234+ 'using_graceful_fallback' : 'Using graceful fallback due to {error}' ,
209235 'update_check_initiated' : 'Update check initiated for repository: {repo}' ,
210236 'update_check_api_request' : 'Making API request to GitHub releases endpoint' ,
211237 'update_check_network_error' : 'Network error during update check: {error}' ,
@@ -282,20 +308,46 @@ const getFallbackTranslation = (key, params = {}) => {
282308 'debug_log_started' : 'Debug log started'
283309 } ,
284310 zh : {
311+ // Update checker related keys
285312 'check_for_updates' : '检查更新' ,
286313 'checking_updates' : '正在检查更新...' ,
287- 'update_available' : '发现可用更新 : v{version}' ,
314+ 'update_available' : '发现新版本 : v{version}' ,
288315 'no_updates_available' : '您正在使用最新版本' ,
289- 'current_version' : '当前 : v{current}' ,
290- 'latest_version' : '最新 : v{latest}' ,
291- 'view_release' : '查看发布 ' ,
316+ 'current_version' : '当前版本 : v{current}' ,
317+ 'latest_version' : '最新版本 : v{latest}' ,
318+ 'view_release' : '查看发布页面 ' ,
292319 'download_update' : '下载更新' ,
293320 'update_check_failed' : '检查更新失败' ,
294- 'network_error' : '发生网络错误 ' ,
295- 'rate_limit_exceeded' : '请求频率超限,请稍后重试 ' ,
321+ 'network_error' : '网络错误 ' ,
322+ 'rate_limit_exceeded' : '请求频率超限,请稍后再试 ' ,
296323 'invalid_response' : '服务器响应无效' ,
297- 'update_check_success' : '更新检查成功完成 ' ,
324+ 'update_check_success' : '更新检查完成 ' ,
298325 'update_notification_title' : '扩展更新可用' ,
326+ 'using_persistent_cached_update_info' : '使用持久化缓存的更新信息' ,
327+ 'update_check_completed' : '更新检查完成。有可用更新: {updateAvailable}' ,
328+ 'update_check_cancelled' : '更新检查已取消' ,
329+ 'update_check_attempt' : '更新检查尝试 {attempt}/{maxAttempts}' ,
330+ 'update_check_succeeded_on_attempt' : '更新检查在第 {attempt} 次尝试时成功' ,
331+ 'version_comparison_failed' : '版本比较失败: {error}' ,
332+ 'error_details' : '错误详情 - 类型: {type}, 原始: {message}, 堆栈: {stack}' ,
333+ 'update_check_failed_after_attempts' : '更新检查在 {attempt} 次尝试后失败。错误: {error}' ,
334+ 'update_check_retry_delay' : '更新检查第 {attempt} 次尝试失败 ({error}),将在 {delay}ms 后重试...' ,
335+ 'update_info_cached_persistently' : '更新信息已持久化缓存' ,
336+ 'failed_cache_update_info' : '持久化缓存更新信息失败: {error}' ,
337+ 'invalid_persistent_cache_structure' : '持久化缓存结构无效,正在清除' ,
338+ 'persistent_cache_different_version' : '持久化缓存版本不同,正在清除' ,
339+ 'persistent_cache_expired' : '持久化缓存已过期,正在清除' ,
340+ 'failed_load_persistent_cache' : '加载持久化缓存失败: {error}' ,
341+ 'persistent_cache_cleared' : '持久化缓存已清除' ,
342+ 'failed_clear_persistent_cache' : '清除持久化缓存失败: {error}' ,
343+ 'update_checker_cache_cleared' : '更新检查器缓存已清除' ,
344+ 'error_getting_cache_status' : '获取持久化缓存状态时出错: {error}' ,
345+ 'expired_memory_cache_cleaned' : '过期内存缓存已清理' ,
346+ 'persistent_cache_optimization_completed' : '持久化缓存优化完成 - 无需清理' ,
347+ 'cache_optimization_failed' : '缓存优化失败: {error}' ,
348+ 'cache_preload_failed' : '缓存预加载失败: {error}' ,
349+ 'providing_graceful_fallback' : '为更新检查提供优雅降级' ,
350+ 'using_graceful_fallback' : '由于 {error} 使用优雅降级' ,
299351 'update_check_initiated' : '为仓库启动更新检查: {repo}' ,
300352 'update_check_api_request' : '向 GitHub releases 端点发起 API 请求' ,
301353 'update_check_network_error' : '更新检查时发生网络错误: {error}' ,
0 commit comments