1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

WithOptionalLanguageCode?.javaLocale

This commit is contained in:
InsanusMokrassar 2021-08-08 17:47:18 +06:00
parent 1d37a7446c
commit 95abc72bf3

View File

@ -1,8 +1,8 @@
package dev.inmo.tgbotapi.types package dev.inmo.tgbotapi.types
import dev.inmo.micro_utils.language_codes.IetfLanguageCode import dev.inmo.micro_utils.language_codes.IetfLanguageCode
import dev.inmo.tgbotapi.types.abstracts.WithLanguageCode import dev.inmo.tgbotapi.types.abstracts.WithOptionalLanguageCode
import java.util.* import java.util.*
fun IetfLanguageCode?.javaLocale() = this ?.code ?.let { Locale.forLanguageTag(it) } fun IetfLanguageCode?.javaLocale() = this ?.code ?.let { Locale.forLanguageTag(it) }
fun WithLanguageCode?.javaLocale() = this ?.ietfLanguageCode.javaLocale() fun WithOptionalLanguageCode?.javaLocale() = this ?.ietfLanguageCode ?.javaLocale()