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

댓글/답글 화면 문구를 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.tvWriteReply.text = if (item.replyCount > 0) {
"답글 ${item.replyCount}"
context.getString(
R.string.audio_content_comment_reply_count_format,
item.replyCount
)
} else {
"답글 쓰기"
context.getString(R.string.audio_content_comment_write_reply)
}
if (

View File

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

View File

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

View File

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

View File

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