Feat/review translation design - #532
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a review translation feature, adding the necessary data models, repository methods, use cases, and UI components to translate reviews into English. It also updates localization files for English, Japanese, and Vietnamese. The review feedback highlights several areas for improvement, including fixing encoding corruption (Mojibake) in test descriptions, addressing missing or awkward translations in Vietnamese and Japanese resources, correcting a potential layout issue in the sign-out activity, replacing hardcoded tooltip offsets with a more robust solution, and refining the translation action visibility logic to ensure it only triggers for Korean text.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| `when`("repository媛 由щ럭 踰덉뿭 寃곌낵瑜?諛섑솚?섎㈃") { | ||
| coEvery { reviewRepository.getReviewTranslation(1L, "EN") } returns translation | ||
|
|
||
| then("?숈씪 寃곌낵瑜?諛섑솚?쒕떎") { |
There was a problem hiding this comment.
테스트 설명에 인코딩 깨짐 현상(Mojibake)이 발생하여 한글이 올바르게 표시되지 않고 있습니다. 가독성과 유지보수성을 위해 올바른 한글 텍스트로 수정하는 것이 좋습니다.\n\n* repository媛� 由щ럭 踰덉뿭 寃곌낵瑜?諛섑솚?섎㈃ -> repository가 리뷰 번역 결과를 반환하면\n* ?숈씪 寃곌낵瑜?諛섑솚?쒕떎 -> 동일 결과를 반환한다
`when`("repository가 리뷰 번역 결과를 반환하면") {
coEvery { reviewRepository.getReviewTranslation(1L, "EN") } returns translation
then("동일 결과를 반환한다") {| <string name="mypage_push_activity_section_title">Notifications and Activity</string> | ||
| <string name="mypage_service_section_title">Service Info</string> | ||
| <string name="mypage_etc_section_title">và vân vân</string> |
There was a problem hiding this comment.
베트남어 번역 파일(values-vi/strings.xml)에서 일부 번역 누락 및 어색한 표현이 발견되었습니다.\n\n1. mypage_push_activity_section_title 및 mypage_service_section_title이 영어로 방치되어 있습니다. 베트남어로 번역이 필요합니다.\n2. mypage_etc_section_title의 và vân vân은 문장 끝에 쓰이는 '등등'의 직역 표현으로, 앱 메뉴의 '기타(Etc.)' 섹션 타이틀로는 매우 어색합니다. 'Khác'이 더 자연스럽습니다.\n\n추천 번역:\n* Notifications and Activity -> Thông báo và Hoạt động\n* Service Info -> Thông tin dịch vụ\n* và vân vân -> Khác
| <string name="mypage_push_activity_section_title">Notifications and Activity</string> | |
| <string name="mypage_service_section_title">Service Info</string> | |
| <string name="mypage_etc_section_title">và vân vân</string> | |
| <string name="mypage_push_activity_section_title">Thông báo và Hoạt động</string> | |
| <string name="mypage_service_section_title">Thông tin dịch vụ</string> | |
| <string name="mypage_etc_section_title">Khác</string> |
| <string name="mypage_push_activity_section_title">Notifications and Activity</string> | ||
| <string name="mypage_service_section_title">Service Info</string> |
There was a problem hiding this comment.
일본어 번역 파일(values-ja/strings.xml)에서 일부 타이틀이 영어로 누락되어 있습니다. 일관된 다국어 지원을 위해 일본어로 번역하는 것을 권장합니다.\n\n* Notifications and Activity -> 通知と活動 또는 お知らせと活動\n* Service Info -> サービス情報
| <string name="mypage_push_activity_section_title">Notifications and Activity</string> | |
| <string name="mypage_service_section_title">Service Info</string> | |
| <string name="mypage_push_activity_section_title">通知と活動</string> | |
| <string name="mypage_service_section_title">サービス情報</string> |
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="4dp" | ||
| android:layout_marginStart="24dp" |
There was a problem hiding this comment.
tv_sign_out_description 텍스트뷰의 가로 너비가 match_parent로 변경되고 layout_marginStart="24dp"가 추가되었으나, layout_marginEnd가 누락되어 있습니다. 이로 인해 텍스트가 우측 화면 가장자리에 완전히 밀착되어 비대칭적이고 답답한 레이아웃이 될 수 있습니다. 좌우 대칭을 위해 android:layout_marginEnd="24dp"를 추가하는 것이 좋습니다.
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:layout_marginTop="4dp" | |
| android:layout_marginStart="24dp" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:layout_marginTop="4dp" | |
| android:layout_marginStart="24dp" | |
| android:layout_marginEnd="24dp" |
| DropdownMenu( | ||
| expanded = showTooltip, | ||
| onDismissRequest = onTooltipDismiss, | ||
| offset = DpOffset(x = (-220).dp, y = (-72).dp), | ||
| shape = RoundedCornerShape(2.dp), | ||
| containerColor = White, | ||
| border = BorderStroke(1.dp, Gray300), | ||
| shadowElevation = 2.dp, | ||
| modifier = Modifier.widthIn(max = 280.dp), |
There was a problem hiding this comment.
툴팁 구현을 위해 DropdownMenu를 사용하면서 하드코딩된 매직 오프셋(offset = DpOffset(x = (-220).dp, y = (-72).dp))을 적용하고 있습니다. \n\n이 방식은 화면 크기가 작거나 레이아웃 배치가 달라질 경우 툴팁이 화면 밖으로 벗어나거나 잘리는 등 오작동할 위험이 큽니다. \n\nDropdownMenu 대신 Jetpack Compose의 공식 TooltipBox (또는 BasicTooltipBox)를 사용하거나, 커스텀 PopupPositionProvider를 구현하여 동적으로 안전하게 위치를 계산하도록 개선하는 것을 권장합니다.
| fun shouldShowReviewTranslationAction( | ||
| targetLanguage: String?, | ||
| isLoggedIn: Boolean, | ||
| content: String, | ||
| ): Boolean = isLoggedIn && | ||
| targetLanguage == ENGLISH_TARGET_LANGUAGE && | ||
| content.any { it.isLetter() && it.code > ASCII_MAX_CODE } |
There was a problem hiding this comment.
현재 shouldShowReviewTranslationAction은 ASCII 범위를 벗어나는 모든 문자(비ASCII 문자)가 포함되어 있으면 번역 버튼을 노출하도록 구현되어 있습니다. 이로 인해 일본어, 베트남어 등 한국어가 아닌 리뷰에서도 번역 버튼이 활성화됩니다.\n\n하지만 UI에 표시되는 안내 문구(review_translated_by_ai)는 **"Translated from Korean by AI" (AI가 한국어에서 번역함)로 한국어 번역임을 명시하고 있어, 타 언어 리뷰에서 이 문구가 노출되면 어색하고 오해의 소지가 있습니다.\n\n 해결 방안 1 (한국어 전용 번역인 경우): 아래와 같이 한국어(한글) 유니코드 범위만 체크하도록 조건을 좁힙니다.\n 해결 방안 2 (다국어 번역 지원인 경우): 번역 안내 문구를 "Translated by AI" 등으로 일반화하고, 다국어 감지 로직을 보완해야 합니다.
| fun shouldShowReviewTranslationAction( | |
| targetLanguage: String?, | |
| isLoggedIn: Boolean, | |
| content: String, | |
| ): Boolean = isLoggedIn && | |
| targetLanguage == ENGLISH_TARGET_LANGUAGE && | |
| content.any { it.isLetter() && it.code > ASCII_MAX_CODE } | |
| fun shouldShowReviewTranslationAction( | |
| targetLanguage: String?, | |
| isLoggedIn: Boolean, | |
| content: String, | |
| ): Boolean = isLoggedIn && | |
| targetLanguage == ENGLISH_TARGET_LANGUAGE && | |
| content.any { it.code in 0xAC00..0xD7A3 || it.code in 0x1100..0x11FF || it.code in 0x3130..0x318F } |
88ffb29 to
9c590b4
Compare
9c590b4 to
73d4978
Compare
Summary
리뷰 번역 기능의 상태별 UI와 디자인 보완
Describe your changes
Translate버튼과Translating...로딩 상태 추가Translated from Korean by AI · Show originalUI 추가Translation unavailable상태 추가