캐릭터 상세 - 폰 언어 설정에 따라 번역 데이터를 조회하도록 수정
This commit is contained in:
@@ -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" 등
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user