Skip to content

Feat/ai review translate - #530

Merged
chlwhdtn03 merged 30 commits into
developfrom
feat/ai-review-translate
Jul 24, 2026
Merged

Feat/ai review translate#530
chlwhdtn03 merged 30 commits into
developfrom
feat/ai-review-translate

Conversation

@jelleoo

@jelleoo jelleoo commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

AI 리뷰 번역 기능 추가

  • 리뷰 목록/내 리뷰 화면에서 번역 보기 및 원문 보기 토글 제공
  • 앱 locale 기준으로 번역 대상 언어를 결정해 리뷰 번역 API 호출
  • 실제 태블릿에서 로그인, 리뷰 화면 진입, 번역 버튼 노출까지 확인

Describe your changes

  • 리뷰 번역 응답 DTO, domain model, usecase 추가
  • ReviewService, ReviewRepository에 리뷰 번역 API 호출 추가
  • 리뷰 목록/내 리뷰 ViewModel에 번역 상태 관리 로직 추가
  • ReviewItem에 번역 보기/원문 보기 UI 추가
  • 다국어 string 및 관련 테스트 추가

Issue

  • Resolves #

To reviewers

서버 API 미배포 상태라 현재 dev 서버에서는 번역 버튼 클릭 시 404 발생

리뷰 시에는 번역 상태 관리, locale별 targetLanguage 처리, 리뷰 목록/내 리뷰 화면에서의 UI 연결 부분을 중점적으로 요먕.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a review translation feature to the EAT-SSU Android application, adding remote DTOs, domain models, use cases, and UI integration across the review list and my reviews screens. It also updates localizations (including a new Vietnamese translation) and adjusts various layout components. The review feedback highlights several improvement opportunities: resolving corrupted Korean characters (mojibake) in the test suite, caching fetched translations in the view models to prevent redundant network requests, disabling translation actions when the target language is Korean to avoid UI clutter, and replacing match_parent with 0dp in a ConstraintLayout within the sign-out activity layout.

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.

Comment on lines +126 to +129
`when`("repository媛€ 由щ럭 踰덉뿭 寃곌낵瑜?諛섑솚?섎㈃") {
coEvery { reviewRepository.getReviewTranslation(1L, "EN") } returns translation

then("?숈씪 寃곌낵瑜?諛섑솚?쒕떎") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The test descriptions contain corrupted Korean characters (mojibake) due to an encoding issue. Please restore the original Korean text to keep the test suite readable and maintainable:

  • Line 126: `when`("repository가 리뷰 번역 결과를 반환하면") {
  • Line 129: then("동일 결과를 반환한다") {

Comment on lines +120 to +125
if (currentState?.isTranslated == true) {
_translationStates.value = _translationStates.value + (
review.reviewId to currentState.copy(isTranslated = false)
)
return
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When toggling the translation back on, the view model launches a coroutine to fetch the translation from the network again, even if it was already fetched and stored in _translationStates. Checking if translatedContent is already cached allows toggling the translation state locally without making redundant network calls, saving user data and reducing server load.

Suggested change
if (currentState?.isTranslated == true) {
_translationStates.value = _translationStates.value + (
review.reviewId to currentState.copy(isTranslated = false)
)
return
}
if (currentState?.translatedContent != null) {
_translationStates.value = _translationStates.value + (
review.reviewId to currentState.copy(isTranslated = !currentState.isTranslated)
)
return
}

Comment on lines +103 to +108
if (currentState?.isTranslated == true) {
_translationStates.value = _translationStates.value + (
review.reviewId to currentState.copy(isTranslated = false)
)
return
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When toggling the translation back on, the view model launches a coroutine to fetch the translation from the network again, even if it was already fetched and stored in _translationStates. Checking if translatedContent is already cached allows toggling the translation state locally without making redundant network calls, saving user data and reducing server load.

Suggested change
if (currentState?.isTranslated == true) {
_translationStates.value = _translationStates.value + (
review.reviewId to currentState.copy(isTranslated = false)
)
return
}
if (currentState?.translatedContent != null) {
_translationStates.value = _translationStates.value + (
review.reviewId to currentState.copy(isTranslated = !currentState.isTranslated)
)
return
}

}
}

fun shouldShowReviewTranslationAction(targetLanguage: String): Boolean = targetLanguage in setOf("KO", "EN", "JA", "VI")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since EAT-SSU is primarily used by Soongsil University students, the vast majority of reviews are written in Korean. If targetLanguage is "KO", showing the 'Show translation' button on every review will create significant UI clutter for Korean users, who do not need translation for Korean reviews. Consider disabling the translation action when the target language is "KO", or only enabling it for foreign languages ("EN", "JA", "VI").

Suggested change
fun shouldShowReviewTranslationAction(targetLanguage: String): Boolean = targetLanguage in setOf("KO", "EN", "JA", "VI")
fun shouldShowReviewTranslationAction(targetLanguage: String): Boolean = targetLanguage in setOf("EN", "JA", "VI")

android:id="@+id/tv_sign_out_description"
style="@style/Caption2"
android:layout_width="wrap_content"
android:layout_width="match_parent"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using match_parent for android:layout_width inside a ConstraintLayout is an anti-pattern and can cause constraints (like layout_marginStart) or margins to be ignored or behave unexpectedly. Use 0dp (match_constraint) instead to let the view fill the available width while respecting constraints and margins.

Suggested change
android:layout_width="match_parent"
android:layout_width="0dp"

- 오탈자 수정
- 인스타그램 추적 추가
- 베트남어 변경 추적 추가
@jelleoo
jelleoo force-pushed the feat/ai-review-translate branch from 8069fb1 to da49a87 Compare July 21, 2026 17:02
jelleoo and others added 9 commits July 22, 2026 09:21
# Conflicts:
#	app/src/main/java/com/eatssu/android/data/remote/dto/response/ReviewTranslationResponse.kt
#	app/src/main/java/com/eatssu/android/data/remote/service/ReviewService.kt
#	app/src/main/java/com/eatssu/android/domain/model/ReviewTranslation.kt
#	app/src/main/java/com/eatssu/android/presentation/cafeteria/review/list/ReviewListScreen.kt
#	app/src/main/java/com/eatssu/android/presentation/cafeteria/review/list/ReviewListViewModel.kt
#	app/src/main/java/com/eatssu/android/presentation/cafeteria/review/translation/ReviewTranslationLanguage.kt
#	app/src/main/java/com/eatssu/android/presentation/cafeteria/review/translation/ReviewTranslationUiState.kt
#	app/src/main/java/com/eatssu/android/presentation/mypage/myreview/MyReviewListScreen.kt
#	app/src/main/java/com/eatssu/android/presentation/mypage/myreview/MyReviewViewModel.kt
#	app/src/test/java/com/eatssu/android/data/remote/repository/ReviewRepositoryImplBehaviorSpec.kt
#	app/src/test/java/com/eatssu/android/domain/usecase/review/ReviewDelegatingUseCasesBehaviorSpec.kt
#	app/src/test/java/com/eatssu/android/presentation/cafeteria/review/list/ReviewListViewModelBehaviorSpec.kt
#	app/src/test/java/com/eatssu/android/presentation/mypage/myreview/MyReviewViewModelBehaviorSpec.kt
@chlwhdtn03
chlwhdtn03 merged commit 36437b8 into develop Jul 24, 2026
2 checks passed
@chlwhdtn03
chlwhdtn03 deleted the feat/ai-review-translate branch July 24, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants