feat: translations (#1410)
Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com> Co-authored-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
@@ -334,7 +334,7 @@ class EditRule : Routes.Route() {
|
||||
onClick = { showDropdown.value = true },
|
||||
modifier = Modifier.menuAnchor(MenuAnchorType.PrimaryNotEditable)
|
||||
) {
|
||||
Text(currentEventType, overflow = TextOverflow.Ellipsis, maxLines = 1)
|
||||
Text(context.translation["tracker_events.$currentEventType"], overflow = TextOverflow.Ellipsis, maxLines = 1)
|
||||
}
|
||||
DropdownMenu(expanded = showDropdown.value, onDismissRequest = { showDropdown.value = false }) {
|
||||
TrackerEventType.entries.forEach { eventType ->
|
||||
@@ -342,7 +342,7 @@ class EditRule : Routes.Route() {
|
||||
currentEventType = eventType.key
|
||||
showDropdown.value = false
|
||||
}, text = {
|
||||
Text(eventType.key)
|
||||
Text(context.translation["tracker_events.${eventType.key}"])
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -357,7 +357,7 @@ class EditRule : Routes.Route() {
|
||||
.padding(2.dp),
|
||||
) {
|
||||
TrackerRuleAction.entries.forEach { action ->
|
||||
ActionCheckbox(action.name, checked = remember { mutableStateOf(addEventActions.contains(action)) }) {
|
||||
ActionCheckbox(context.translation["tracker_actions.${action.key}"], checked = remember { mutableStateOf(addEventActions.contains(action)) }) {
|
||||
if (it) {
|
||||
addEventActions += action
|
||||
} else {
|
||||
@@ -422,8 +422,8 @@ class EditRule : Routes.Route() {
|
||||
modifier = Modifier.size(24.dp)
|
||||
)
|
||||
Column {
|
||||
Text(event.eventType, lineHeight = 20.sp, fontSize = 18.sp, fontWeight = FontWeight.Bold)
|
||||
Text(text = event.actions.joinToString(", ") { it.name }, fontSize = 10.sp, fontWeight = FontWeight.Light, overflow = TextOverflow.Ellipsis, maxLines = 1, lineHeight = 14.sp)
|
||||
Text(context.translation["tracker_events.${event.eventType}"], lineHeight = 20.sp, fontSize = 18.sp, fontWeight = FontWeight.Bold)
|
||||
Text(text = event.actions.joinToString(", ") { context.translation["tracker_actions.${it.key}"] }, fontSize = 10.sp, fontWeight = FontWeight.Light, overflow = TextOverflow.Ellipsis, maxLines = 1, lineHeight = 14.sp)
|
||||
}
|
||||
}
|
||||
OutlinedIconButton(
|
||||
@@ -453,5 +453,4 @@ class EditRule : Routes.Route() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1541,7 +1541,39 @@
|
||||
"cancel": "Cancel",
|
||||
"open": "Open",
|
||||
"download": "Download",
|
||||
"send": "Send"
|
||||
"send": "Send",
|
||||
"restore_original": "Restore Original",
|
||||
"convert_external_media": "Convert External Media"
|
||||
},
|
||||
|
||||
"tracker_events": {
|
||||
"conversation_enter": "Conversation Enter",
|
||||
"conversation_exit": "Conversation Exit",
|
||||
"started_typing": "Started Typing",
|
||||
"stopped_typing": "Stopped Typing",
|
||||
"started_speaking": "Started Speaking",
|
||||
"stopped_speaking": "Stopped Speaking",
|
||||
"started_peeking": "Started Peeking",
|
||||
"stopped_peeking": "Stopped Peeking",
|
||||
"message_read": "Message Read",
|
||||
"message_deleted": "Message Deleted",
|
||||
"message_saved": "Message Saved",
|
||||
"message_unsaved": "Message Unsaved",
|
||||
"message_edited": "Message Edited",
|
||||
"message_reaction_add": "Message Reaction Add",
|
||||
"message_reaction_remove": "Message Reaction Remove",
|
||||
"snap_opened": "Snap Opened",
|
||||
"snap_replayed": "Snap Replayed",
|
||||
"snap_replayed_twice": "Snap Replayed Twice",
|
||||
"snap_screenshot": "Snap Screenshot",
|
||||
"snap_screen_record": "Snap Screen Record"
|
||||
},
|
||||
|
||||
"tracker_actions": {
|
||||
"log": "Log",
|
||||
"in_app_notification": "In-App Notification",
|
||||
"push_notification": "Push Notification",
|
||||
"custom": "Custom"
|
||||
},
|
||||
|
||||
"better_notifications": {
|
||||
|
||||
@@ -27,7 +27,7 @@ class ConvertMessageLocally : Feature("Convert Message Edit") {
|
||||
|
||||
fun convertMessageInterface(messageInstance: Message) {
|
||||
val actions = mutableMapOf<String, (Message) -> Unit>()
|
||||
actions["restore_original"] = actions@{ message ->
|
||||
actions[context.translation["button.restore_original"]] = actions@{ message ->
|
||||
val descriptor = message.messageDescriptor ?: return@actions
|
||||
messageCache.remove(descriptor.messageId!!)
|
||||
context.feature(Messaging::class).conversationManager?.fetchMessage(
|
||||
@@ -41,7 +41,7 @@ class ConvertMessageLocally : Feature("Convert Message Edit") {
|
||||
|
||||
val contentType = messageInstance.messageContent?.contentType
|
||||
if (contentType == ContentType.SNAP) {
|
||||
actions["convert_external_media"] = convert@{ message ->
|
||||
actions[context.translation["button.convert_external_media"]] = convert@{ message ->
|
||||
val snapMessageContent = ProtoReader(message.messageContent!!.content!!).followPath(11)
|
||||
?.getBuffer() ?: return@convert
|
||||
message.messageContent!!.content = ProtoWriter().apply {
|
||||
|
||||
Reference in New Issue
Block a user