mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-12 05:07:46 +02:00
ui: feature section preview
This commit is contained in:
@ -5,6 +5,7 @@ import com.google.gson.JsonObject
|
||||
import com.google.gson.JsonParser
|
||||
import me.rhunk.snapenhance.Logger
|
||||
import me.rhunk.snapenhance.bridge.BridgeClient
|
||||
import me.rhunk.snapenhance.config.ConfigProperty
|
||||
import me.rhunk.snapenhance.data.LocalePair
|
||||
import java.util.Locale
|
||||
|
||||
@ -79,6 +80,14 @@ class TranslationWrapper {
|
||||
return translationMap[key] ?: key.also { Logger.debug("Missing translation for $key") }
|
||||
}
|
||||
|
||||
fun propertyName(property: ConfigProperty): String {
|
||||
return get("property.${property.translationKey}.name")
|
||||
}
|
||||
|
||||
fun propertyDescription(property: ConfigProperty): String {
|
||||
return get("property.${property.translationKey}.description")
|
||||
}
|
||||
|
||||
fun format(key: String, vararg args: Pair<String, String>): String {
|
||||
return args.fold(get(key)) { acc, pair ->
|
||||
acc.replace("{${pair.first}}", pair.second)
|
||||
|
Reference in New Issue
Block a user