All Downloads are FREE. Search and download functionalities are using the official Maven repository.

iosMain.com.paoapps.fifi.localization.DefaultLanguageProvider.kt Maven / Gradle / Ivy

Go to download

Kotlin Multiplatform Mobile framework for optimal code sharing between iOS and Android.

There is a newer version: 0.0.31
Show newest version
package com.paoapps.fifi.localization

import com.paoapps.fifi.domain.Language
import platform.Foundation.NSBundle

actual fun getLanguage(fallbackLanguageCode: String): Language? {
    val preferred = (NSBundle.mainBundle.preferredLocalizations.first() as? String)
    return preferred?.let { Language.parse(it, fallbackLanguageCode) } ?: Language("en")
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy