Nurlibay
10/07/2025, 8:31 AMprivate fun applyAppLocale(languageCode: String) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
        // Android 13+: Use LocaleManager for per-app persistence
        val localeManager = context.getSystemService(LocaleManager::class.java)
        localeManager.applicationLocales = LocaleList.forLanguageTags(languageCode)
    } else {
        // Pre-Android 13: Use AppCompatDelegate
        val locales = LocaleListCompat.forLanguageTags(languageCode)
        AppCompatDelegate.setApplicationLocales(locales)
    }
    // Immediate update for resources (affects View-based UI)
    val config = Configuration(context.resources.configuration)
    config.setLocale(Locale(languageCode))
    @Suppress("DEPRECATION")
    context.resources.updateConfiguration(config, context.resources.displayMetrics)
}Chrimaeon
10/07/2025, 10:10 AMJack Boswell
10/10/2025, 3:43 AM