Skip to content

Commit

Permalink
feat: Introduce common interface for SourceLang and TargetLang
Browse files Browse the repository at this point in the history
  • Loading branch information
Micha-ohne-el committed Dec 3, 2023
1 parent d3ee0a2 commit 023d51b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/commonMain/kotlin/moe/micha/deeplkt/Lang.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package moe.micha.deeplkt

interface Lang {
val name: String
val code: String
}
4 changes: 2 additions & 2 deletions src/commonMain/kotlin/moe/micha/deeplkt/SourceLang.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import kotlinx.serialization.encoding.Encoder

@Serializable(with = SourceLang.Serializer::class)
enum class SourceLang(
val code: String,
) {
override val code: String,
) : Lang {
Bulgarian("BG"),
ChineseSimplified("ZH"),
Czech("CS"),
Expand Down
4 changes: 2 additions & 2 deletions src/commonMain/kotlin/moe/micha/deeplkt/TargetLang.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import kotlinx.serialization.encoding.Encoder

@Serializable(with = TargetLang.Serializer::class)
enum class TargetLang(
val code: String,
) {
override val code: String,
) : Lang {
AmericanEnglish("EN-US"),
BrazilianPortuguese("PT-BR"),
BritishEnglish("EN-GB"),
Expand Down

0 comments on commit 023d51b

Please sign in to comment.