캐릭터 상세 - 폰 언어 설정에 따라 번역 데이터를 조회하도록 수정

This commit is contained in:
2025-12-11 20:09:58 +09:00
parent 6f67c4e8e1
commit e2c7134f61
6 changed files with 73 additions and 17 deletions

View File

@@ -1,5 +1,7 @@
package kr.co.vividnext.sodalive.common
import android.content.Context
import android.os.Build
import java.net.URLEncoder
import java.nio.charset.StandardCharsets
@@ -38,4 +40,15 @@ object Utils {
return "https://voiceon.onelink.me/RkTm?$encodedParams"
}
fun getCurrentLanguageCode(context: Context): String {
val config = context.resources.configuration
val locale = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
config.locales.get(0)
} else {
@Suppress("DEPRECATION")
config.locale
}
return locale.language // "ko", "en" 등
}
}