From 008c0b180f3711c78548e47098965812e700efd9 Mon Sep 17 00:00:00 2001 From: Lukellmann <47486203+Lukellmann@users.noreply.github.com> Date: Mon, 23 Jan 2023 21:13:22 +0100 Subject: [PATCH] Add Locale.INDONESIAN (#738) see https://github.com/discord/discord-api-docs/pull/5643 --- common/api/common.api | 1 + common/src/main/kotlin/Locale.kt | 7 ++++++- common/src/test/kotlin/LocaleTest.kt | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/api/common.api b/common/api/common.api index 1370df3256da..3589016dc718 100644 --- a/common/api/common.api +++ b/common/api/common.api @@ -128,6 +128,7 @@ public final class dev/kord/common/Locale$Companion { public final fun getGREEK ()Ldev/kord/common/Locale; public final fun getHINDI ()Ldev/kord/common/Locale; public final fun getHUNGARIAN ()Ldev/kord/common/Locale; + public final fun getINDONESIAN ()Ldev/kord/common/Locale; public final fun getITALIAN ()Ldev/kord/common/Locale; public final fun getJAPANESE ()Ldev/kord/common/Locale; public final fun getKOREAN ()Ldev/kord/common/Locale; diff --git a/common/src/main/kotlin/Locale.kt b/common/src/main/kotlin/Locale.kt index 3c3b165a0d93..63e922ddb2ed 100644 --- a/common/src/main/kotlin/Locale.kt +++ b/common/src/main/kotlin/Locale.kt @@ -22,9 +22,13 @@ public data class Locale(val language: String, val country: String? = null) { */ public fun asJavaLocale(): JLocale = JLocale(language, country ?: "") - @Suppress("MemberVisibilityCanBePrivate") public companion object { + /** + * Indonesian. + */ + public val INDONESIAN: Locale = Locale("id") + /** * Danish. */ @@ -180,6 +184,7 @@ public data class Locale(val language: String, val country: String? = null) { * All languages [supported by Discord](https://discord.com/developers/docs/reference#locales). */ public val ALL: List = listOf( + INDONESIAN, DANISH, GERMAN, ENGLISH_GREAT_BRITAIN, diff --git a/common/src/test/kotlin/LocaleTest.kt b/common/src/test/kotlin/LocaleTest.kt index 027a989ed9df..e8f29c8b4ba3 100644 --- a/common/src/test/kotlin/LocaleTest.kt +++ b/common/src/test/kotlin/LocaleTest.kt @@ -9,6 +9,7 @@ class LocaleTest { private val all = with(Locale) { listOf( + "id" to INDONESIAN, "da" to DANISH, "de" to GERMAN, "en-GB" to ENGLISH_GREAT_BRITAIN,