오디오 댓글 문자열 리소스화

댓글/답글 화면 문구를 ko/en/ja 리소스로 정리했습니다.
This commit is contained in:
2025-12-03 17:32:16 +09:00
parent 1018b6426e
commit 764ca0f892
10 changed files with 84 additions and 39 deletions

View File

@@ -99,9 +99,12 @@ class AudioContentCommentAdapter(
binding.tvCommentNickname.text = item.nickname binding.tvCommentNickname.text = item.nickname
binding.tvWriteReply.text = if (item.replyCount > 0) { binding.tvWriteReply.text = if (item.replyCount > 0) {
"답글 ${item.replyCount}" context.getString(
R.string.audio_content_comment_reply_count_format,
item.replyCount
)
} else { } else {
"답글 쓰기" context.getString(R.string.audio_content_comment_write_reply)
} }
if ( if (

View File

@@ -106,9 +106,9 @@ class AudioContentCommentListFragment : BaseFragment<FragmentAudioContentComment
SodaDialog( SodaDialog(
activity = requireActivity(), activity = requireActivity(),
layoutInflater = layoutInflater, layoutInflater = layoutInflater,
title = "댓글 삭제", title = getString(R.string.audio_content_comment_delete_title),
desc = "삭제하시겠습니까?", desc = getString(R.string.audio_content_comment_delete_message),
confirmButtonTitle = "삭제", confirmButtonTitle = getString(R.string.screen_audio_content_detail_delete),
confirmButtonClick = { confirmButtonClick = {
viewModel.modifyComment( viewModel.modifyComment(
commentId = it, commentId = it,
@@ -116,7 +116,7 @@ class AudioContentCommentListFragment : BaseFragment<FragmentAudioContentComment
isActive = false isActive = false
) )
}, },
cancelButtonTitle = "취소", cancelButtonTitle = getString(R.string.cancel),
cancelButtonClick = {} cancelButtonClick = {}
).show(screenWidth) ).show(screenWidth)
}, },

View File

@@ -6,7 +6,9 @@ import com.orhanobut.logger.Logger
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers import io.reactivex.rxjava3.schedulers.Schedulers
import kr.co.vividnext.sodalive.base.BaseViewModel import kr.co.vividnext.sodalive.base.BaseViewModel
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
import kr.co.vividnext.sodalive.common.SharedPreferenceManager import kr.co.vividnext.sodalive.common.SharedPreferenceManager
import kr.co.vividnext.sodalive.R
class AudioContentCommentListViewModel( class AudioContentCommentListViewModel(
private val repository: AudioContentCommentRepository private val repository: AudioContentCommentRepository
@@ -27,6 +29,17 @@ class AudioContentCommentListViewModel(
val totalCommentCount: LiveData<Int> val totalCommentCount: LiveData<Int>
get() = _totalCommentCount get() = _totalCommentCount
private val unknownErrorMessage: String
get() = SodaLiveApplicationHolder.get().getString(R.string.common_error_unknown)
private val noChangeMessage: String
get() = SodaLiveApplicationHolder.get().getString(R.string.audio_content_comment_no_change)
private val inputRequiredMessage: String
get() = SodaLiveApplicationHolder.get().getString(
R.string.audio_content_comment_input_required
)
var page = 1 var page = 1
private var isLast = false private var isLast = false
private val size = 10 private val size = 10
@@ -59,9 +72,7 @@ class AudioContentCommentListViewModel(
if (it.message != null) { if (it.message != null) {
_toastLiveData.postValue(it.message) _toastLiveData.postValue(it.message)
} else { } else {
_toastLiveData.postValue( _toastLiveData.postValue(unknownErrorMessage)
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
)
} }
if (onFailure != null) { if (onFailure != null) {
@@ -74,7 +85,7 @@ class AudioContentCommentListViewModel(
{ {
_isLoading.value = false _isLoading.value = false
it.message?.let { message -> Logger.e(message) } it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.") _toastLiveData.postValue(unknownErrorMessage)
if (onFailure != null) { if (onFailure != null) {
onFailure() onFailure()
} }
@@ -110,16 +121,14 @@ class AudioContentCommentListViewModel(
if (it.message != null) { if (it.message != null) {
_toastLiveData.postValue(it.message) _toastLiveData.postValue(it.message)
} else { } else {
_toastLiveData.postValue( _toastLiveData.postValue(unknownErrorMessage)
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
)
} }
} }
}, },
{ {
_isLoading.value = false _isLoading.value = false
it.message?.let { message -> Logger.e(message) } it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.") _toastLiveData.postValue(unknownErrorMessage)
} }
) )
) )
@@ -132,12 +141,12 @@ class AudioContentCommentListViewModel(
isActive: Boolean? = null isActive: Boolean? = null
) { ) {
if (comment == null && isActive == null) { if (comment == null && isActive == null) {
_toastLiveData.postValue("변경사항이 없습니다.") _toastLiveData.postValue(noChangeMessage)
return return
} }
if (comment != null && comment.isBlank()) { if (comment != null && comment.isBlank()) {
_toastLiveData.postValue("내용을 입력하세요") _toastLiveData.postValue(inputRequiredMessage)
return return
} }
@@ -169,14 +178,14 @@ class AudioContentCommentListViewModel(
isLast = false isLast = false
getCommentList(audioContentId) getCommentList(audioContentId)
} else { } else {
val message = it.message ?: "알 수 없는 오류가 발생했습니다. 다시 시도해 주세요." val message = it.message ?: unknownErrorMessage
_toastLiveData.postValue(message) _toastLiveData.postValue(message)
} }
}, },
{ {
_isLoading.value = false _isLoading.value = false
it.message?.let { message -> Logger.e(message) } it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.") _toastLiveData.postValue(unknownErrorMessage)
} }
) )
) )

View File

@@ -112,9 +112,9 @@ class AudioContentCommentReplyFragment : BaseFragment<FragmentAudioContentCommen
SodaDialog( SodaDialog(
activity = requireActivity(), activity = requireActivity(),
layoutInflater = layoutInflater, layoutInflater = layoutInflater,
title = "댓글 삭제", title = getString(R.string.audio_content_comment_delete_title),
desc = "삭제하시겠습니까?", desc = getString(R.string.audio_content_comment_delete_message),
confirmButtonTitle = "삭제", confirmButtonTitle = getString(R.string.screen_audio_content_detail_delete),
confirmButtonClick = { confirmButtonClick = {
viewModel.modifyComment( viewModel.modifyComment(
commentId = it, commentId = it,
@@ -122,7 +122,7 @@ class AudioContentCommentReplyFragment : BaseFragment<FragmentAudioContentCommen
isActive = false isActive = false
) )
}, },
cancelButtonTitle = "취소", cancelButtonTitle = getString(R.string.cancel),
cancelButtonClick = {} cancelButtonClick = {}
).show(screenWidth) ).show(screenWidth)
} }

View File

@@ -6,7 +6,9 @@ import com.orhanobut.logger.Logger
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers import io.reactivex.rxjava3.schedulers.Schedulers
import kr.co.vividnext.sodalive.base.BaseViewModel import kr.co.vividnext.sodalive.base.BaseViewModel
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
import kr.co.vividnext.sodalive.common.SharedPreferenceManager import kr.co.vividnext.sodalive.common.SharedPreferenceManager
import kr.co.vividnext.sodalive.R
class AudioContentCommentReplyViewModel( class AudioContentCommentReplyViewModel(
private val repository: AudioContentCommentRepository private val repository: AudioContentCommentRepository
@@ -23,6 +25,17 @@ class AudioContentCommentReplyViewModel(
val commentList: LiveData<List<GetAudioContentCommentListItem>> val commentList: LiveData<List<GetAudioContentCommentListItem>>
get() = _commentList get() = _commentList
private val unknownErrorMessage: String
get() = SodaLiveApplicationHolder.get().getString(R.string.common_error_unknown)
private val noChangeMessage: String
get() = SodaLiveApplicationHolder.get().getString(R.string.audio_content_comment_no_change)
private val inputRequiredMessage: String
get() = SodaLiveApplicationHolder.get().getString(
R.string.audio_content_comment_input_required
)
var page = 1 var page = 1
private var isLast = false private var isLast = false
private val size = 10 private val size = 10
@@ -53,9 +66,7 @@ class AudioContentCommentReplyViewModel(
if (it.message != null) { if (it.message != null) {
_toastLiveData.postValue(it.message) _toastLiveData.postValue(it.message)
} else { } else {
_toastLiveData.postValue( _toastLiveData.postValue(unknownErrorMessage)
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
)
} }
if (onFailure != null) { if (onFailure != null) {
@@ -68,7 +79,7 @@ class AudioContentCommentReplyViewModel(
{ {
_isLoading.value = false _isLoading.value = false
it.message?.let { message -> Logger.e(message) } it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.") _toastLiveData.postValue(unknownErrorMessage)
if (onFailure != null) { if (onFailure != null) {
onFailure() onFailure()
} }
@@ -104,16 +115,14 @@ class AudioContentCommentReplyViewModel(
if (it.message != null) { if (it.message != null) {
_toastLiveData.postValue(it.message) _toastLiveData.postValue(it.message)
} else { } else {
_toastLiveData.postValue( _toastLiveData.postValue(unknownErrorMessage)
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
)
} }
} }
}, },
{ {
_isLoading.value = false _isLoading.value = false
it.message?.let { message -> Logger.e(message) } it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.") _toastLiveData.postValue(unknownErrorMessage)
} }
) )
) )
@@ -126,12 +135,12 @@ class AudioContentCommentReplyViewModel(
isActive: Boolean? = null isActive: Boolean? = null
) { ) {
if (comment == null && isActive == null) { if (comment == null && isActive == null) {
_toastLiveData.postValue("변경사항이 없습니다.") _toastLiveData.postValue(noChangeMessage)
return return
} }
if (comment != null && comment.isBlank()) { if (comment != null && comment.isBlank()) {
_toastLiveData.postValue("내용을 입력하세요") _toastLiveData.postValue(inputRequiredMessage)
return return
} }
@@ -163,14 +172,14 @@ class AudioContentCommentReplyViewModel(
isLast = false isLast = false
getCommentReplyList(parentCommentId) getCommentReplyList(parentCommentId)
} else { } else {
val message = it.message ?: "알 수 없는 오류가 발생했습니다. 다시 시도해 주세요." val message = it.message ?: unknownErrorMessage
_toastLiveData.postValue(message) _toastLiveData.postValue(message)
} }
}, },
{ {
_isLoading.value = false _isLoading.value = false
it.message?.let { message -> Logger.e(message) } it.message?.let { message -> Logger.e(message) }
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.") _toastLiveData.postValue(unknownErrorMessage)
} }
) )
) )

View File

@@ -17,7 +17,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="13.3dp" android:layout_marginStart="13.3dp"
android:fontFamily="@font/gmarket_sans_medium" android:fontFamily="@font/gmarket_sans_medium"
android:text="댓글" android:text="@string/screen_audio_content_detail_comment_title"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14.7sp" android:textSize="14.7sp"
app:layout_constraintBottom_toBottomOf="@+id/iv_close" app:layout_constraintBottom_toBottomOf="@+id/iv_close"
@@ -75,7 +75,7 @@
android:fontFamily="@font/gmarket_sans_medium" android:fontFamily="@font/gmarket_sans_medium"
android:gravity="center" android:gravity="center"
android:layout_marginHorizontal="13.3dp" android:layout_marginHorizontal="13.3dp"
android:text="비밀댓글" android:text="@string/screen_audio_content_detail_comment_secret"
android:textColor="@color/color_eeeeee" android:textColor="@color/color_eeeeee"
android:textSize="13.3sp" android:textSize="13.3sp"
android:visibility="gone" android:visibility="gone"
@@ -109,7 +109,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_round_corner_10_232323_3bb9f1" android:background="@drawable/bg_round_corner_10_232323_3bb9f1"
android:hint="댓글을 입력해 보세요" android:hint="@string/screen_audio_content_detail_comment_hint"
android:importantForAutofill="no" android:importantForAutofill="no"
android:inputType="text|textMultiLine" android:inputType="text|textMultiLine"
android:paddingVertical="13.3dp" android:paddingVertical="13.3dp"

View File

@@ -20,7 +20,7 @@
android:drawablePadding="6.7dp" android:drawablePadding="6.7dp"
android:fontFamily="@font/gmarket_sans_medium" android:fontFamily="@font/gmarket_sans_medium"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="답글" android:text="@string/audio_content_comment_reply_title"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14.7sp" android:textSize="14.7sp"
app:drawableStartCompat="@drawable/ic_back" app:drawableStartCompat="@drawable/ic_back"
@@ -81,7 +81,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_round_corner_10_232323_3bb9f1" android:background="@drawable/bg_round_corner_10_232323_3bb9f1"
android:hint="답글을 입력해 보세요" android:hint="@string/audio_content_comment_reply_input_hint"
android:importantForAutofill="no" android:importantForAutofill="no"
android:inputType="text" android:inputType="text"
android:paddingVertical="13.3dp" android:paddingVertical="13.3dp"

View File

@@ -889,6 +889,14 @@
<string name="audio_content_playlist_detail_delete_title">Delete playlist</string> <string name="audio_content_playlist_detail_delete_title">Delete playlist</string>
<string name="audio_content_playlist_detail_delete_message">Delete \'%1$s\'?</string> <string name="audio_content_playlist_detail_delete_message">Delete \'%1$s\'?</string>
<string name="audio_content_playlist_detail_delete_success">Deleted.</string> <string name="audio_content_playlist_detail_delete_success">Deleted.</string>
<string name="audio_content_comment_reply_title">Replies</string>
<string name="audio_content_comment_reply_input_hint">Write a reply</string>
<string name="audio_content_comment_write_reply">Write a reply</string>
<string name="audio_content_comment_reply_count_format">%1$d replies</string>
<string name="audio_content_comment_delete_title">Delete comment</string>
<string name="audio_content_comment_delete_message">Delete this comment?</string>
<string name="audio_content_comment_no_change">No changes to update.</string>
<string name="audio_content_comment_input_required">Enter content.</string>
<string name="screen_audio_content_new_all_title">New short content</string> <string name="screen_audio_content_new_all_title">New short content</string>
<string name="screen_audio_content_new_all_title_free">New free content</string> <string name="screen_audio_content_new_all_title_free">New free content</string>
<string name="screen_audio_content_new_all_notice">New short content posted in the last two weeks.</string> <string name="screen_audio_content_new_all_notice">New short content posted in the last two weeks.</string>

View File

@@ -889,6 +889,14 @@
<string name="audio_content_playlist_detail_delete_title">プレイリストを削除</string> <string name="audio_content_playlist_detail_delete_title">プレイリストを削除</string>
<string name="audio_content_playlist_detail_delete_message">「%1$s」を削除しますか?</string> <string name="audio_content_playlist_detail_delete_message">「%1$s」を削除しますか?</string>
<string name="audio_content_playlist_detail_delete_success">削除しました。</string> <string name="audio_content_playlist_detail_delete_success">削除しました。</string>
<string name="audio_content_comment_reply_title">返信</string>
<string name="audio_content_comment_reply_input_hint">返信を入力してください</string>
<string name="audio_content_comment_write_reply">返信を書く</string>
<string name="audio_content_comment_reply_count_format">返信 %1$d件</string>
<string name="audio_content_comment_delete_title">コメント削除</string>
<string name="audio_content_comment_delete_message">このコメントを削除しますか?</string>
<string name="audio_content_comment_no_change">変更事項がありません。</string>
<string name="audio_content_comment_input_required">内容を入力してください。</string>
<string name="screen_audio_content_new_all_title">新しい短編</string> <string name="screen_audio_content_new_all_title">新しい短編</string>
<string name="screen_audio_content_new_all_title_free">新しい無料コンテンツ</string> <string name="screen_audio_content_new_all_title_free">新しい無料コンテンツ</string>
<string name="screen_audio_content_new_all_notice">過去2週間に登録された新しい短編です。</string> <string name="screen_audio_content_new_all_notice">過去2週間に登録された新しい短編です。</string>

View File

@@ -888,6 +888,14 @@
<string name="audio_content_playlist_detail_delete_title">재생목록 삭제</string> <string name="audio_content_playlist_detail_delete_title">재생목록 삭제</string>
<string name="audio_content_playlist_detail_delete_message">\'%1$s\'을 삭제하시겠습니까?</string> <string name="audio_content_playlist_detail_delete_message">\'%1$s\'을 삭제하시겠습니까?</string>
<string name="audio_content_playlist_detail_delete_success">삭제되었습니다.</string> <string name="audio_content_playlist_detail_delete_success">삭제되었습니다.</string>
<string name="audio_content_comment_reply_title">답글</string>
<string name="audio_content_comment_reply_input_hint">답글을 입력해 보세요</string>
<string name="audio_content_comment_write_reply">답글 쓰기</string>
<string name="audio_content_comment_reply_count_format">답글 %1$d개</string>
<string name="audio_content_comment_delete_title">댓글 삭제</string>
<string name="audio_content_comment_delete_message">삭제하시겠습니까?</string>
<string name="audio_content_comment_no_change">변경사항이 없습니다.</string>
<string name="audio_content_comment_input_required">내용을 입력하세요</string>
<string name="screen_audio_content_new_all_title">새로운 단편</string> <string name="screen_audio_content_new_all_title">새로운 단편</string>
<string name="screen_audio_content_new_all_title_free">새로운 무료 콘텐츠</string> <string name="screen_audio_content_new_all_title_free">새로운 무료 콘텐츠</string>
<string name="screen_audio_content_new_all_notice">※ 최근 2주간 등록된 새로운 단편 입니다.</string> <string name="screen_audio_content_new_all_notice">※ 최근 2주간 등록된 새로운 단편 입니다.</string>