feat: localized content types

This commit is contained in:
rhunk
2023-11-21 19:29:08 +01:00
parent 82a3847573
commit c0740877fa
5 changed files with 6 additions and 12 deletions

View File

@ -672,13 +672,6 @@
"progress": "Progress",
"failure": "Failure"
},
"auto_save_messages_in_conversations": {
"NOTE": "Audio Note",
"CHAT": "Chat",
"EXTERNAL_MEDIA": "External Media",
"SNAP": "Snap",
"STICKER": "Sticker"
},
"notifications": {
"chat_screenshot": "Screenshot",
"chat_screen_record": "Screen Record",

View File

@ -80,6 +80,7 @@ class LocaleWrapper {
}
operator fun get(key: String) = translationMap[key] ?: key.also { AbstractLogger.directDebug("Missing translation for $key") }
fun getOrNull(key: String) = translationMap[key]
fun format(key: String, vararg args: Pair<String, String>): String {
return args.fold(get(key)) { acc, pair ->

View File

@ -21,7 +21,7 @@ class MessagingTweaks : ConfigContainer() {
"NOTE",
"EXTERNAL_MEDIA",
"STICKER"
) { requireRestart() }
) { requireRestart(); customOptionTranslationPath = "content_type" }
val preventMessageSending = multiple("prevent_message_sending", *NotificationType.getOutgoingValues().map { it.key }.toTypedArray()) {
customOptionTranslationPath = "features.options.notifications"
nativeHooks()