앱 내 다국어 언어설정 기능 추가

This commit is contained in:
2025-12-12 14:39:00 +09:00
parent ebd557ff71
commit a75a11c9f6
12 changed files with 366 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import android.content.Context
import android.os.Build
import java.net.URLEncoder
import java.nio.charset.StandardCharsets
import kr.co.vividnext.sodalive.settings.language.LanguageManager
object Utils {
fun convertDurationToString(duration: Int, showHours: Boolean = true): String {
@@ -42,13 +43,7 @@ object Utils {
}
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" 등
// 효과적 언어 코드(사용자 설정 > 시스템 지원 언어 > ko)를 반환한다.
return LanguageManager.getEffectiveLanguage(context)
}
}