{"record":{"id":"8a63fc7d37c3da08","repo":"maotoumao/MusicFree","slug":"error-8a63fc","errorCode":null,"errorMessage":"当前歌曲无翻译","messagePattern":"当前歌曲无翻译","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/pages/musicDetail/components/content/lyric/lyricOperations.tsx","lineNumber":104,"sourceCode":"                    //     });\r\n                    // } else {\r\n                    showPanel(\"SearchLrc\", {\r\n                        musicItem: currentMusic,\r\n                    });\r\n                    // }\r\n                }}\r\n            />\r\n            <TranslationIcon\r\n                width={iconSizeConst.normal}\r\n                height={iconSizeConst.normal}\r\n                opacity={!hasTranslation ? 0.2 : showTranslation ? 1 : 0.5}\r\n                color={\r\n                    showTranslation && hasTranslation ? colors.primary : \"white\"\r\n                }\r\n                // style={}\r\n                onPress={() => {\r\n                    if (!hasTranslation) {\r\n                        Toast.warn(\"当前歌曲无翻译\");\r\n                        return;\r\n                    }\r\n\r\n                    PersistStatus.set(\r\n                        \"lyric.showTranslation\",\r\n                        !showTranslation,\r\n                    );\r\n                    scrollToCurrentLrcItem();\r\n                }}\r\n            />\r\n            <Icon\r\n                name=\"ellipsis-vertical\"\r\n                size={iconSizeConst.normal}\r\n                color={\"white\"}\r\n                onPress={() => {\r\n                    const currentMusic = TrackPlayer.currentMusic;\r\n                    if (currentMusic) {\r\n                        showPanel(\"MusicItemLyricOptions\", {\r","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/maotoumao/MusicFree/blob/d118b18b3d0c904400f7eea7bf99c0ceec6c1aee/src/pages/musicDetail/components/content/lyric/lyricOperations.tsx#L86-L122","documentation":"Hardcoded Chinese warning '当前歌曲无翻译' ('current song has no translation') shown when tapping the translation toggle while the loaded lyrics contain no translation track. It is guarded by hasTranslation, so it fires only when the toggle is pressed without translation data.","triggerScenarios":"Pressing the translation button when hasTranslation is false — the current lyric source returned only an original lyric line set with no translation entries.","commonSituations":"Track's lyric provider does not supply translations; online lyric fetched lacks the translation field; lyrics loaded before translation fetch completed.","solutions":["Pick a lyric source that provides translations for this track","Wait for/verify the translation lyric finished loading before toggling","Localize the hardcoded string via i18n(t(...)) for consistency"],"exampleFix":"// before\nToast.warn(\"当前歌曲无翻译\");\n// after\nToast.warn(t(\"toast.noTranslationForCurrentMusic\"));","handlingStrategy":"validation","validationCode":"if (!hasTranslation) {\n    Toast.warn(t('toast.noTranslationForCurrentMusic'));\n    return;\n}","typeGuard":"function hasTranslationLyric(l: ILyric | null): boolean {\n    return !!l?.translation && Object.keys(l.translation).length > 0;\n}","tryCatchPattern":null,"preventionTips":["Disable the translation toggle when no translation is loaded","Move the hardcoded string into i18n resources","Verify translation data finished loading before enabling the toggle"],"tags":["lyrics","translation","i18n"],"backgroundTag":"translation-lyric-missing","analyzedSha":"d118b18b3d0c904400f7eea7bf99c0ceec6c1aee","analyzedAt":"2026-08-30T11:49:12.932Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}