Skip to content

Commit

Permalink
chore: Remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
Distractic committed Dec 20, 2023
1 parent b35071d commit 728ae87
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/main/kotlin/com/github/rushyverse/api/extension/_String.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@

package com.github.rushyverse.api.extension

import com.github.rushyverse.api.translation.Translator
import com.github.rushyverse.api.translation.getComponent
import java.math.BigInteger
import java.util.*
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.TextComponent
import net.kyori.adventure.text.format.NamedTextColor
import net.kyori.adventure.text.minimessage.MiniMessage
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver
import net.kyori.adventure.text.minimessage.tag.standard.StandardTags
import java.math.BigInteger
import java.util.*

/**
* MiniMessage instance to deserialize components without strict mode.
Expand Down Expand Up @@ -265,16 +263,3 @@ public fun StringBuilder.deleteLast(size: Int): StringBuilder {
else -> delete(length - size, length)
}
}

/**
* If the string contains a dot, it will be considered as a translation path, and will be translated.
* However, if the string doesn't contain a dot, it will be considered as a component.
* @receiver String to translate or to convert to a component.
* @param translator Translator.
* @param locale Locale to use for translation.
* @return The translated component or the component created from the string.
*/
public fun String.toTranslatedComponent(translator: Translator, locale: Locale): Component {
return if (this.contains('.')) translator.getComponent(this, locale)
else this.asComponent()
}

0 comments on commit 728ae87

Please sign in to comment.