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

iosMain.com.vanniktech.locale.Multiplatform.kt Maven / Gradle / Ivy

The newest version!
package com.vanniktech.locale

import platform.Foundation.NSLocale
import platform.Foundation.currentLocale
import platform.Foundation.localizedStringForCountryCode
import platform.Foundation.localizedStringForLanguageCode

actual fun Language.displayName(): String =
  NSLocale.currentLocale.localizedStringForLanguageCode(code).orEmpty().capitalized()

actual fun Territory.displayName() = when (this) {
  Region.INTERNATIONAL_WATERS -> "International Waters"
  else -> NSLocale.currentLocale.localizedStringForCountryCode(code).orEmpty().capitalized()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy