diff --git a/CHANGELOG_CHERRYPICK.md b/CHANGELOG_CHERRYPICK.md index 49a2958664..d5b77a77ce 100644 --- a/CHANGELOG_CHERRYPICK.md +++ b/CHANGELOG_CHERRYPICK.md @@ -39,6 +39,7 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE ### Server - 이모티콘 중복 체크 (misskey-dev/misskey#11941) +- Enhance: '내용 숨기기'로 설정된 노트의 주석도 번역에 포함됨 --- diff --git a/packages/backend/src/server/api/endpoints/notes/translate.ts b/packages/backend/src/server/api/endpoints/notes/translate.ts index bf7398c08d..44885bad07 100644 --- a/packages/backend/src/server/api/endpoints/notes/translate.ts +++ b/packages/backend/src/server/api/endpoints/notes/translate.ts @@ -103,12 +103,12 @@ export default class extends Endpoint { // eslint- if (instance.deeplAuthKey == null) { return 204; // TODO: 良い感じのエラー返す } - translationResult = await this.translateDeepL(note.text, targetLang, instance.deeplAuthKey, instance.deeplIsPro, instance.translatorType); + translationResult = await this.translateDeepL((note.cw ? note.cw + '\n' : '') + note.text, targetLang, instance.deeplAuthKey, instance.deeplIsPro, instance.translatorType); } else if (instance.translatorType === 'google_no_api') { let targetLang = ps.targetLang; if (targetLang.includes('-')) targetLang = targetLang.split('-')[0]; - const { text, raw } = await translate(note.text, { to: targetLang }); + const { text, raw } = await translate((note.cw ? note.cw + '\n' : '') + note.text, { to: targetLang }); return { sourceLang: raw.src, @@ -119,7 +119,7 @@ export default class extends Endpoint { // eslint- if (instance.ctav3SaKey == null) { return 204; } else if (instance.ctav3ProjectId == null) { return 204; } else if (instance.ctav3Location == null) { return 204; } translationResult = await this.apiCloudTranslationAdvanced( - note.text, targetLang, instance.ctav3SaKey, instance.ctav3ProjectId, instance.ctav3Location, instance.ctav3Model, instance.ctav3Glossary, instance.translatorType, + (note.cw ? note.cw + '\n' : '') + note.text, targetLang, instance.ctav3SaKey, instance.ctav3ProjectId, instance.ctav3Location, instance.ctav3Model, instance.ctav3Glossary, instance.translatorType, ); } else { throw new Error('Unsupported translator type');