diff --git a/app/src/main/java/ani/dantotsu/media/comments/CommentItem.kt b/app/src/main/java/ani/dantotsu/media/comments/CommentItem.kt index 2b4e42b6..6f2c794c 100644 --- a/app/src/main/java/ani/dantotsu/media/comments/CommentItem.kt +++ b/app/src/main/java/ani/dantotsu/media/comments/CommentItem.kt @@ -53,7 +53,6 @@ class CommentItem(val comment: Comment, adapter.add(repliesSection) } - @SuppressLint("SetTextI18n") override fun bind(viewBinding: ItemCommentsBinding, position: Int) { binding = viewBinding setAnimation(binding.root.context, binding.root) @@ -95,10 +94,15 @@ class CommentItem(val comment: Comment, if (repliesVisible) { repliesSection.clear() removeSubCommentIds() - viewBinding.commentTotalReplies.text = "View ${comment.replyCount} repl${if (comment.replyCount == 1) "y" else "ies"}" + viewBinding.commentTotalReplies.context.run { + viewBinding.commentTotalReplies.text = if (comment.replyCount == 1) + getString(R.string.view_reply) + else + getString(R.string.view_replies, comment.replyCount) + } repliesVisible = false } else { - viewBinding.commentTotalReplies.text = "Hide Replies" + viewBinding.commentTotalReplies.setText(R.string.hide_replies) repliesSection.clear() commentsFragment.viewReplyCallback(this) repliesVisible = true @@ -220,7 +224,8 @@ class CommentItem(val comment: Comment, } comment.profilePictureUrl?.let { viewBinding.commentUserAvatar.loadImage(it) } viewBinding.commentUserName.text = comment.username - viewBinding.commentUserLevel.text = "[${levelColor.second}]" + val userColor = "[${levelColor.second}]" + viewBinding.commentUserLevel.text = userColor viewBinding.commentUserLevel.setTextColor(levelColor.first) viewBinding.commentUserTime.text = formatTimestamp(comment.timestamp) } diff --git a/app/src/main/java/ani/dantotsu/media/comments/CommentsFragment.kt b/app/src/main/java/ani/dantotsu/media/comments/CommentsFragment.kt index 5e699799..0ec2d3bf 100644 --- a/app/src/main/java/ani/dantotsu/media/comments/CommentsFragment.kt +++ b/app/src/main/java/ani/dantotsu/media/comments/CommentsFragment.kt @@ -523,11 +523,10 @@ class CommentsFragment : Fragment() { } - @SuppressLint("SetTextI18n") fun replyTo(comment: CommentItem, username: String) { if (comment.isReplying) { activity.binding.commentReplyToContainer.visibility = View.VISIBLE - activity.binding.commentReplyTo.text = "Replying to $username" + activity.binding.commentReplyTo.text = getString(R.string.replying_to, username) activity.binding.commentReplyToCancel.setOnClickListener { comment.replying(false) replyCallback(comment) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3f6971cf..a789dd04 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -717,6 +717,7 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc Hide Replies View reply View %1$d replies + Replying to %1$s Delete Comment Are you sure you want to delete this comment?