
iosMain.com.vanniktech.locale.Multiplatform.ios.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multiplatform-locale Show documentation
Show all versions of multiplatform-locale Show documentation
Type Safe Kotlin Multiplatform Locale implementation
The newest version!
package com.vanniktech.locale
import platform.Foundation.NSLocale
import platform.Foundation.currentLocale
import platform.Foundation.localizedStringForCountryCode
import platform.Foundation.localizedStringForLanguageCode
internal actual fun Language.commonDisplayName(): String = NSLocale.currentLocale.localizedStringForLanguageCode(code).orEmpty().capitalized()
internal actual fun Territory.commonDisplayName() = when (this) {
Region.INTERNATIONAL_WATERS -> "International Waters"
else -> NSLocale.currentLocale.localizedStringForCountryCode(code).orEmpty().capitalized()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy