diff --git a/app/src/main/java/kr/co/vividnext/sodalive/live/room/detail/LiveRoomDetailFragment.kt b/app/src/main/java/kr/co/vividnext/sodalive/live/room/detail/LiveRoomDetailFragment.kt index e356a8a0..596b3536 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/live/room/detail/LiveRoomDetailFragment.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/live/room/detail/LiveRoomDetailFragment.kt @@ -28,7 +28,10 @@ import kr.co.vividnext.sodalive.databinding.ItemLiveDetailUserSummaryBinding import kr.co.vividnext.sodalive.explorer.profile.UserProfileActivity import kr.co.vividnext.sodalive.extensions.convertDateFormat import kr.co.vividnext.sodalive.extensions.dpToPx +import kr.co.vividnext.sodalive.settings.language.LanguageManager +import kr.co.vividnext.sodalive.settings.language.LocaleHelper import org.koin.android.ext.android.inject +import java.util.Locale import java.util.TimeZone class LiveRoomDetailFragment( @@ -116,6 +119,9 @@ class LiveRoomDetailFragment( @SuppressLint("SetTextI18n", "NotifyDataSetChanged") private fun setRoomDetail(response: GetRoomDetailResponse) { + val locale = Locale(LanguageManager.getEffectiveLanguage(requireContext())) + val wrappedContext = LocaleHelper.wrap(requireContext()) + binding.tv19.visibility = if (response.isAdult) { View.VISIBLE } else { @@ -125,7 +131,8 @@ class LiveRoomDetailFragment( binding.tvTitle.text = response.title binding.tvDate.text = response.beginDateTimeUtc.convertDateFormat( from = "yyyy-MM-dd'T'HH:mm:ss", - to = getString(R.string.screen_live_room_detail_date_format), + to = wrappedContext.getString(R.string.screen_live_room_detail_date_format), + outputLocale = locale, inputTimeZone = TimeZone.getTimeZone("UTC") ) @@ -138,7 +145,7 @@ class LiveRoomDetailFragment( 0 ) } else { - binding.tvCan.text = getString(R.string.screen_live_room_free) + binding.tvCan.text = wrappedContext.getString(R.string.screen_live_room_free) binding.tvCan.setCompoundDrawablesWithIntrinsicBounds( 0, 0, @@ -226,7 +233,7 @@ class LiveRoomDetailFragment( binding.rvParticipate.visibility = View.VISIBLE binding.tvParticipateExpression.visibility = View.VISIBLE binding.tvOpenAllProfile.text = - getString(R.string.screen_live_room_collapse) + wrappedContext.getString(R.string.screen_live_room_collapse) binding.tvOpenAllProfile.setCompoundDrawablesWithIntrinsicBounds( R.drawable.ic_live_detail_top, 0, @@ -238,7 +245,7 @@ class LiveRoomDetailFragment( binding.rvParticipate.visibility = View.GONE binding.tvParticipateExpression.visibility = View.GONE binding.tvOpenAllProfile.text = - getString(R.string.screen_live_room_expand) + wrappedContext.getString(R.string.screen_live_room_expand) binding.tvOpenAllProfile.setCompoundDrawablesWithIntrinsicBounds( R.drawable.ic_live_detail_bottom, 0, @@ -351,6 +358,7 @@ class LiveRoomDetailFragment( } private fun shareRoom(response: GetRoomDetailResponse) { + val wrappedContext = LocaleHelper.wrap(requireContext()) viewModel.shareRoomLink( response.roomId, response.isPrivateRoom, @@ -362,7 +370,7 @@ class LiveRoomDetailFragment( val shareIntent = Intent.createChooser( intent, - getString(R.string.screen_live_room_share_title) + wrappedContext.getString(R.string.screen_live_room_share_title) ) startActivity(shareIntent) }