오디오 댓글 문자열 리소스화
댓글/답글 화면 문구를 ko/en/ja 리소스로 정리했습니다.
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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)
|
||||
},
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="13.3dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:text="댓글"
|
||||
android:text="@string/screen_audio_content_detail_comment_title"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14.7sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_close"
|
||||
@@ -75,7 +75,7 @@
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:layout_marginHorizontal="13.3dp"
|
||||
android:text="비밀댓글"
|
||||
android:text="@string/screen_audio_content_detail_comment_secret"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="13.3sp"
|
||||
android:visibility="gone"
|
||||
@@ -109,7 +109,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_round_corner_10_232323_3bb9f1"
|
||||
android:hint="댓글을 입력해 보세요"
|
||||
android:hint="@string/screen_audio_content_detail_comment_hint"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="text|textMultiLine"
|
||||
android:paddingVertical="13.3dp"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
android:drawablePadding="6.7dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center_vertical"
|
||||
android:text="답글"
|
||||
android:text="@string/audio_content_comment_reply_title"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14.7sp"
|
||||
app:drawableStartCompat="@drawable/ic_back"
|
||||
@@ -81,7 +81,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_round_corner_10_232323_3bb9f1"
|
||||
android:hint="답글을 입력해 보세요"
|
||||
android:hint="@string/audio_content_comment_reply_input_hint"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="text"
|
||||
android:paddingVertical="13.3dp"
|
||||
|
||||
@@ -889,6 +889,14 @@
|
||||
<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_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_free">New free content</string>
|
||||
<string name="screen_audio_content_new_all_notice">New short content posted in the last two weeks.</string>
|
||||
|
||||
@@ -889,6 +889,14 @@
|
||||
<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_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_free">新しい無料コンテンツ</string>
|
||||
<string name="screen_audio_content_new_all_notice">過去2週間に登録された新しい短編です。</string>
|
||||
|
||||
@@ -888,6 +888,14 @@
|
||||
<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_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_free">새로운 무료 콘텐츠</string>
|
||||
<string name="screen_audio_content_new_all_notice">※ 최근 2주간 등록된 새로운 단편 입니다.</string>
|
||||
|
||||
Reference in New Issue
Block a user