mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-26 20:18:48 +00:00
commit
36c09feaf2
@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## 0.16.11
|
||||
|
||||
* `LanguageCodes`:
|
||||
* In android and JVM targets now available `toJavaLocale` and from Java `Locale` conversations from/to
|
||||
`IetfLanguageCode`
|
||||
|
||||
## 0.16.10
|
||||
|
||||
* `Repos`:
|
||||
|
@ -14,5 +14,5 @@ crypto_js_version=4.1.1
|
||||
# Project data
|
||||
|
||||
group=dev.inmo
|
||||
version=0.16.10
|
||||
android_code_version=178
|
||||
version=0.16.11
|
||||
android_code_version=179
|
||||
|
@ -5,3 +5,11 @@ plugins {
|
||||
}
|
||||
|
||||
apply from: "$mppProjectWithSerializationPresetPath"
|
||||
|
||||
kotlin {
|
||||
sourceSets {
|
||||
androidMain {
|
||||
dependsOn jvmMain
|
||||
}
|
||||
}
|
||||
}
|
||||
|
8
language_codes/src/jvmMain/kotlin/Locale.kt
Normal file
8
language_codes/src/jvmMain/kotlin/Locale.kt
Normal file
@ -0,0 +1,8 @@
|
||||
package dev.inmo.micro_utils.language_codes
|
||||
|
||||
import java.util.Locale
|
||||
|
||||
fun IetfLanguageCode.toJavaLocale(): Locale = Locale.forLanguageTag(code)
|
||||
fun IetfLanguageCode?.toJavaLocaleOrDefault(): Locale = this ?.toJavaLocale() ?: Locale.getDefault()
|
||||
|
||||
fun Locale.toIetfLanguageCode(): IetfLanguageCode = IetfLanguageCode(toLanguageTag())
|
Loading…
Reference in New Issue
Block a user