iosMain.com.paoapps.fifi.localization.DefaultLanguageProvider.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fifi-framework Show documentation
Show all versions of fifi-framework Show documentation
Kotlin Multiplatform Mobile framework for optimal code sharing between iOS and Android.
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