|
|
@@ -13,7 +13,7 @@ extension V2TIMMessage {
|
|
|
let hasRisk = hasRiskContent
|
|
|
let isRevoked = status == .MSG_STATUS_LOCAL_REVOKED
|
|
|
if hasRisk, !isRevoked {
|
|
|
- return TIMCommonLocalizedString("TUIKitMessageDisplayRiskContent")
|
|
|
+ return TIMLocalizedText.shared.commonText("TUIKitMessageDisplayRiskContent")
|
|
|
}
|
|
|
if isRevoked {
|
|
|
return revokeDisplayString
|
|
|
@@ -27,39 +27,39 @@ extension V2TIMMessage {
|
|
|
if let revokerInfo {
|
|
|
revoker = revokerInfo.userID
|
|
|
}
|
|
|
- var content = TIMCommonLocalizedString("TUIKitMessageTipsNormalRecallMessage")
|
|
|
+ var content = TIMLocalizedText.shared.commonText("TUIKitMessageTipsNormalRecallMessage")
|
|
|
if revoker == sender {
|
|
|
if isSelf {
|
|
|
- content = TIMCommonLocalizedString("TUIKitMessageTipsYouRecallMessage")
|
|
|
+ content = TIMLocalizedText.shared.commonText("TUIKitMessageTipsYouRecallMessage")
|
|
|
} else {
|
|
|
if userID?.isEmpty == false {
|
|
|
- content = TIMCommonLocalizedString("TUIKitMessageTipsOthersRecallMessage")
|
|
|
+ content = TIMLocalizedText.shared.commonText("TUIKitMessageTipsOthersRecallMessage")
|
|
|
} else if groupID?.isEmpty == false {
|
|
|
- content = String(format: TIMCommonLocalizedString("TUIKitMessageTipsRecallMessageFormat"), showName)
|
|
|
+ content = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsRecallMessageFormat"), showName)
|
|
|
} else { }
|
|
|
}
|
|
|
} else {
|
|
|
var userName = showName
|
|
|
if let revokerInfo {
|
|
|
- userName = revokerInfo.showName()
|
|
|
+ userName = revokerInfo.nickName ?? ""
|
|
|
}
|
|
|
- content = String(format: TIMCommonLocalizedString("TUIKitMessageTipsRecallMessageFormat"), userName)
|
|
|
+ content = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsRecallMessageFormat"), userName)
|
|
|
}
|
|
|
return content
|
|
|
}
|
|
|
|
|
|
private var displayStringForMessageElement: String? {
|
|
|
switch elemType {
|
|
|
- case .ELEM_TYPE_TEXT: textElem?.text?.getLocalizableStringWithFaceContent()
|
|
|
- case .ELEM_TYPE_IMAGE: TIMCommonLocalizedString("TUIkitMessageTypeImage")
|
|
|
- case .ELEM_TYPE_SOUND: TIMCommonLocalizedString("TUIKitMessageTypeVoice")
|
|
|
- case .ELEM_TYPE_VIDEO: TIMCommonLocalizedString("TUIkitMessageTypeVideo")
|
|
|
- case .ELEM_TYPE_FILE: TIMCommonLocalizedString("TUIkitMessageTypeFile")
|
|
|
- case .ELEM_TYPE_FACE: TIMCommonLocalizedString("TUIKitMessageTypeAnimateEmoji")
|
|
|
- case .ELEM_TYPE_MERGER: String(format: "[%@]", TIMCommonLocalizedString("TUIKitRelayChatHistory"))
|
|
|
+ case .ELEM_TYPE_TEXT: textElem?.text?.getEmojiDescContent
|
|
|
+ case .ELEM_TYPE_IMAGE: TIMLocalizedText.shared.commonText("TUIkitMessageTypeImage")
|
|
|
+ case .ELEM_TYPE_SOUND: TIMLocalizedText.shared.commonText("TUIKitMessageTypeVoice")
|
|
|
+ case .ELEM_TYPE_VIDEO: TIMLocalizedText.shared.commonText("TUIkitMessageTypeVideo")
|
|
|
+ case .ELEM_TYPE_FILE: TIMLocalizedText.shared.commonText("TUIkitMessageTypeFile")
|
|
|
+ case .ELEM_TYPE_FACE: TIMLocalizedText.shared.commonText("TUIKitMessageTypeAnimateEmoji")
|
|
|
+ case .ELEM_TYPE_MERGER: String(format: "[%@]", TIMLocalizedText.shared.commonText("TUIKitRelayChatHistory"))
|
|
|
case .ELEM_TYPE_GROUP_TIPS: groupTipsDisplayString
|
|
|
- case .ELEM_TYPE_CUSTOM: TIMCommonLocalizedString("TUIKitMessageTipsUnsupportCustomMessage")
|
|
|
- default: TIMCommonLocalizedString("TUIKitMessageTipsUnsupportCustomMessage")
|
|
|
+ case .ELEM_TYPE_CUSTOM: TIMLocalizedText.shared.commonText("TUIKitMessageTipsUnsupportCustomMessage")
|
|
|
+ default: TIMLocalizedText.shared.commonText("TUIKitMessageTipsUnsupportCustomMessage")
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -75,35 +75,35 @@ extension V2TIMMessage {
|
|
|
if userList.isEmpty
|
|
|
|| (userList.count == 1
|
|
|
&& opUser == userList.first) {
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsJoinGroupFormat"), opUser)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsJoinGroupFormat"), opUser)
|
|
|
} else {
|
|
|
let users = userList.joined(separator: "、")
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsInviteJoinGroupFormat"), opUser, users)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsInviteJoinGroupFormat"), opUser, users)
|
|
|
}
|
|
|
}
|
|
|
case .GROUP_TIPS_TYPE_INVITE:
|
|
|
if !userList.isEmpty {
|
|
|
let users = userList.joined(separator: "、")
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsInviteJoinGroupFormat"), opUser, users)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsInviteJoinGroupFormat"), opUser, users)
|
|
|
}
|
|
|
case .GROUP_TIPS_TYPE_QUIT:
|
|
|
if !opUser.isEmpty {
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsLeaveGroupFormat"), opUser)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsLeaveGroupFormat"), opUser)
|
|
|
}
|
|
|
case .GROUP_TIPS_TYPE_KICKED:
|
|
|
if !userList.isEmpty {
|
|
|
let users = userList.joined(separator: "、")
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsKickoffGroupFormat"), opUser, users)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsKickoffGroupFormat"), opUser, users)
|
|
|
}
|
|
|
case .GROUP_TIPS_TYPE_SET_ADMIN:
|
|
|
if !userList.isEmpty {
|
|
|
let users = userList.joined(separator: "、")
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsSettAdminFormat"), users)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsSettAdminFormat"), users)
|
|
|
}
|
|
|
case .GROUP_TIPS_TYPE_CANCEL_ADMIN:
|
|
|
if !userList.isEmpty {
|
|
|
let users = userList.joined(separator: "、")
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsCancelAdminFormat"), users)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsCancelAdminFormat"), users)
|
|
|
}
|
|
|
case .GROUP_TIPS_TYPE_GROUP_INFO_CHANGE:
|
|
|
str = opGroupInfoChangedFormatStr(opUser: opUser, userList: userList, tips: tips)
|
|
|
@@ -116,15 +116,15 @@ extension V2TIMMessage {
|
|
|
} else {
|
|
|
""
|
|
|
}
|
|
|
- str = String(format: "%@ %@", userId?.isMyUid == true ? TIMCommonLocalizedString("You") : showName, muteTime == 0 ? TIMCommonLocalizedString("TUIKitMessageTipsUnmute") : TIMCommonLocalizedString("TUIKitMessageTipsMute"))
|
|
|
+ str = String(format: "%@ %@", userId?.isMyUid == true ? TIMLocalizedText.shared.commonText("You") : showName, muteTime == 0 ? TIMLocalizedText.shared.commonText("TUIKitMessageTipsUnmute") : TIMLocalizedText.shared.commonText("TUIKitMessageTipsMute"))
|
|
|
}
|
|
|
case .GROUP_TIPS_TYPE_PINNED_MESSAGE_ADDED:
|
|
|
if !opUser.isEmpty {
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsGroupPinMessage"), opUser)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsGroupPinMessage"), opUser)
|
|
|
}
|
|
|
case .GROUP_TIPS_TYPE_PINNED_MESSAGE_DELETED:
|
|
|
if !opUser.isEmpty {
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsGroupUnPinMessage"), opUser)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsGroupUnPinMessage"), opUser)
|
|
|
}
|
|
|
default:
|
|
|
break
|
|
|
@@ -166,53 +166,53 @@ extension V2TIMMessage {
|
|
|
for info in tips.groupChangeInfoList {
|
|
|
switch info.type {
|
|
|
case .GROUP_INFO_CHANGE_TYPE_NAME:
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIkitMessageTipsEditGroupNameFormat"), str, info.value ?? "")
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIkitMessageTipsEditGroupNameFormat"), str, info.value ?? "")
|
|
|
case .GROUP_INFO_CHANGE_TYPE_INTRODUCTION:
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsEditGroupIntroFormat"), str, info.value ?? "")
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsEditGroupIntroFormat"), str, info.value ?? "")
|
|
|
case .GROUP_INFO_CHANGE_TYPE_NOTIFICATION:
|
|
|
if let value = info.value, !value.isEmpty {
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsEditGroupAnnounceFormat"), str, value)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsEditGroupAnnounceFormat"), str, value)
|
|
|
} else {
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsDeleteGroupAnnounceFormat"), str)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsDeleteGroupAnnounceFormat"), str)
|
|
|
}
|
|
|
case .GROUP_INFO_CHANGE_TYPE_FACE:
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsEditGroupAvatarFormat"), str)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsEditGroupAvatarFormat"), str)
|
|
|
case .GROUP_INFO_CHANGE_TYPE_OWNER:
|
|
|
if !userList.isEmpty {
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsEditGroupOwnerFormat"), str, userList.first!)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsEditGroupOwnerFormat"), str, userList.first!)
|
|
|
} else {
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsEditGroupOwnerFormat"), str, info.value ?? "")
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsEditGroupOwnerFormat"), str, info.value ?? "")
|
|
|
}
|
|
|
case .GROUP_INFO_CHANGE_TYPE_SHUT_UP_ALL:
|
|
|
if info.boolValue {
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitSetShutupAllFormat"), opUser)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitSetShutupAllFormat"), opUser)
|
|
|
} else {
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitCancelShutupAllFormat"), opUser)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitCancelShutupAllFormat"), opUser)
|
|
|
}
|
|
|
case .GROUP_INFO_CHANGE_TYPE_GROUP_ADD_OPT:
|
|
|
let addOpt = info.intValue
|
|
|
var addOptDesc = "unknown"
|
|
|
if addOpt == V2TIMGroupAddOpt.GROUP_ADD_FORBID.rawValue {
|
|
|
- addOptDesc = TIMCommonLocalizedString("TUIKitGroupProfileJoinDisable")
|
|
|
+ addOptDesc = TIMLocalizedText.shared.commonText("TUIKitGroupProfileJoinDisable")
|
|
|
} else if addOpt == V2TIMGroupAddOpt.GROUP_ADD_AUTH.rawValue {
|
|
|
- addOptDesc = TIMCommonLocalizedString("TUIKitGroupProfileAdminApprove")
|
|
|
+ addOptDesc = TIMLocalizedText.shared.commonText("TUIKitGroupProfileAdminApprove")
|
|
|
} else if addOpt == V2TIMGroupAddOpt.GROUP_ADD_ANY.rawValue {
|
|
|
- addOptDesc = TIMCommonLocalizedString("TUIKitGroupProfileAutoApproval")
|
|
|
+ addOptDesc = TIMLocalizedText.shared.commonText("TUIKitGroupProfileAutoApproval")
|
|
|
}
|
|
|
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsEditGroupAddOptFormat"), str, addOptDesc)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsEditGroupAddOptFormat"), str, addOptDesc)
|
|
|
case .GROUP_INFO_CHANGE_TYPE_GROUP_APPROVE_OPT:
|
|
|
let addOpt = info.intValue
|
|
|
var addOptDesc = "unknown"
|
|
|
if addOpt == V2TIMGroupAddOpt.GROUP_ADD_FORBID.rawValue {
|
|
|
- addOptDesc = TIMCommonLocalizedString("TUIKitGroupProfileInviteDisable")
|
|
|
+ addOptDesc = TIMLocalizedText.shared.commonText("TUIKitGroupProfileInviteDisable")
|
|
|
} else if addOpt == V2TIMGroupAddOpt.GROUP_ADD_AUTH.rawValue {
|
|
|
- addOptDesc = TIMCommonLocalizedString("TUIKitGroupProfileAdminApprove")
|
|
|
+ addOptDesc = TIMLocalizedText.shared.commonText("TUIKitGroupProfileAdminApprove")
|
|
|
} else if addOpt == V2TIMGroupAddOpt.GROUP_ADD_ANY.rawValue {
|
|
|
- addOptDesc = TIMCommonLocalizedString("TUIKitGroupProfileAutoApproval")
|
|
|
+ addOptDesc = TIMLocalizedText.shared.commonText("TUIKitGroupProfileAutoApproval")
|
|
|
}
|
|
|
|
|
|
- str = String(format: TIMCommonLocalizedString("TUIKitMessageTipsEditGroupInviteOptFormat"), str, addOptDesc)
|
|
|
+ str = String(format: TIMLocalizedText.shared.commonText("TUIKitMessageTipsEditGroupInviteOptFormat"), str, addOptDesc)
|
|
|
default:
|
|
|
break
|
|
|
}
|