|
@@ -150,7 +150,7 @@
|
|
|
|
|
|
if (self.conversation.type == Chatroom_Type) {
|
|
|
__block MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:ws.view animated:YES];
|
|
|
- hud.label.text = @"进入聊天室。。。";
|
|
|
+ hud.label.text = WFCString(@"JoinChatroom");
|
|
|
[hud showAnimated:YES];
|
|
|
|
|
|
[[WFCCIMService sharedWFCIMService] joinChatroom:ws.conversation.target success:^{
|
|
@@ -161,7 +161,7 @@
|
|
|
} error:^(int error_code) {
|
|
|
NSLog(@"join chatroom error");
|
|
|
hud.mode = MBProgressHUDModeText;
|
|
|
- hud.label.text = @"进入聊天室失败";
|
|
|
+ hud.label.text = WFCString(@"JoinChatroomFailure");
|
|
|
// hud.offset = CGPointMake(0.f, MBProgressMaxOffset);
|
|
|
[hud hideAnimated:YES afterDelay:1.f];
|
|
|
hud.completionBlock = ^{
|
|
@@ -298,7 +298,7 @@
|
|
|
- (void)sendChatroomWelcomeMessage {
|
|
|
WFCCTipNotificationContent *tip = [[WFCCTipNotificationContent alloc] init];
|
|
|
WFCCUserInfo *userInfo = [[WFCCIMService sharedWFCIMService] getUserInfo:[WFCCNetworkService sharedInstance].userId refresh:NO];
|
|
|
- tip.tip = [NSString stringWithFormat:@"欢迎 %@ 加入聊天室", userInfo.displayName];
|
|
|
+ tip.tip = [NSString stringWithFormat:WFCString(@"WelcomeJoinChatroomHint"), userInfo.displayName];
|
|
|
[self sendMessage:tip];
|
|
|
}
|
|
|
|
|
@@ -307,7 +307,7 @@
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
WFCCTipNotificationContent *tip = [[WFCCTipNotificationContent alloc] init];
|
|
|
WFCCUserInfo *userInfo = [[WFCCIMService sharedWFCIMService] getUserInfo:[WFCCNetworkService sharedInstance].userId refresh:NO];
|
|
|
- tip.tip = [NSString stringWithFormat:@"%@ 离开了聊天室", userInfo.displayName];
|
|
|
+ tip.tip = [NSString stringWithFormat:WFCString(@"LeaveChatroomHint"), userInfo.displayName];
|
|
|
|
|
|
[[WFCCIMService sharedWFCIMService] send:strongConv content:tip success:^(long long messageUid, long long timestamp) {
|
|
|
[[WFCCIMService sharedWFCIMService] quitChatroom:strongConv.target success:nil error:nil];
|
|
@@ -346,7 +346,7 @@
|
|
|
if(targetUser.friendAlias.length) {
|
|
|
self.title = targetUser.friendAlias;
|
|
|
} else if(targetUser.displayName.length == 0) {
|
|
|
- self.title = [NSString stringWithFormat:@"用户<%@>", self.conversation.target];
|
|
|
+ self.title = [NSString stringWithFormat:@"%@<%@>", WFCString(@"User"), self.conversation.target];
|
|
|
} else {
|
|
|
self.title = targetUser.displayName;
|
|
|
}
|
|
@@ -357,9 +357,9 @@
|
|
|
- (void)setTargetGroup:(WFCCGroupInfo *)targetGroup {
|
|
|
_targetGroup = targetGroup;
|
|
|
if(targetGroup.name.length == 0) {
|
|
|
- self.title = [NSString stringWithFormat:@"群组<%@>", self.conversation.target];
|
|
|
+ self.title = [NSString stringWithFormat:@"%@<%@>", WFCString(@"Group"), self.conversation.target];
|
|
|
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] init];
|
|
|
- self.navigationItem.backBarButtonItem.title = @"消息";
|
|
|
+ self.navigationItem.backBarButtonItem.title = WFCString(@"Message");
|
|
|
} else {
|
|
|
self.title = [NSString stringWithFormat:@"%@(%d)", targetGroup.name, (int)targetGroup.memberCount];
|
|
|
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] init];
|
|
@@ -385,9 +385,9 @@
|
|
|
- (void)setTargetChannel:(WFCCChannelInfo *)targetChannel {
|
|
|
_targetChannel = targetChannel;
|
|
|
if(targetChannel.name.length == 0) {
|
|
|
- self.title = [NSString stringWithFormat:@"频道<%@>", self.conversation.target];
|
|
|
+ self.title = [NSString stringWithFormat:@"%@<%@>", WFCString(@"Channel"), self.conversation.target];
|
|
|
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] init];
|
|
|
- self.navigationItem.backBarButtonItem.title = @"消息";
|
|
|
+ self.navigationItem.backBarButtonItem.title = WFCString(@"Message");
|
|
|
} else {
|
|
|
self.title = targetChannel.name;
|
|
|
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] init];
|
|
@@ -398,9 +398,9 @@
|
|
|
- (void)setTargetChatroom:(WFCCChatroomInfo *)targetChatroom {
|
|
|
_targetChatroom = targetChatroom;
|
|
|
if(targetChatroom.title.length == 0) {
|
|
|
- self.title = [NSString stringWithFormat:@"聊天室<%@>", self.conversation.target];
|
|
|
+ self.title = [NSString stringWithFormat:@"<%@>", WFCString(@"Chatroom"), self.conversation.target];
|
|
|
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] init];
|
|
|
- self.navigationItem.backBarButtonItem.title = @"消息";
|
|
|
+ self.navigationItem.backBarButtonItem.title = WFCString(@"Message");
|
|
|
} else {
|
|
|
self.title = targetChatroom.title;
|
|
|
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] init];
|
|
@@ -521,15 +521,15 @@
|
|
|
|
|
|
[[NSRunLoop mainRunLoop] addTimer:self.showTypingTimer forMode:NSDefaultRunLoopMode];
|
|
|
if (typingType == Typing_TEXT) {
|
|
|
- self.title = @"对方正在输入...";
|
|
|
+ self.title = WFCString(@"TypingHint");
|
|
|
} else if(typingType == Typing_VOICE) {
|
|
|
- self.title = @"对方正在录音...";
|
|
|
+ self.title = WFCString(@"RecordingHint");
|
|
|
} else if(typingType == Typing_CAMERA) {
|
|
|
- self.title = @"对方正在拍照...";
|
|
|
+ self.title = WFCString(@"PhotographingHint");
|
|
|
} else if(typingType == Typing_LOCATION) {
|
|
|
- self.title = @"对方正在选取位置...";
|
|
|
+ self.title = WFCString(@"GetLocationHint");
|
|
|
} else if(typingType == Typing_FILE) {
|
|
|
- self.title = @"对方正在选取文件...";
|
|
|
+ self.title = WFCString(@"SelectingFileHint");
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1010,7 +1010,7 @@
|
|
|
if (gm.type != Member_Type_Manager) {
|
|
|
WFCCGroupMember *gm = [[WFCCIMService sharedWFCIMService] getGroupMember:self.conversation.target memberId:model.message.fromUser];
|
|
|
if (gm.type != Member_Type_Manager) {
|
|
|
- [self.view makeToast:@"管理员关闭了群组私聊权限" duration:1 position:CSToastPositionCenter];
|
|
|
+ [self.view makeToast:WFCString(@"NotAllowTemporarySession") duration:1 position:CSToastPositionCenter];
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -1042,8 +1042,8 @@
|
|
|
} else if(self.conversation.type == Channel_Type) {
|
|
|
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
|
|
|
|
|
- UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
|
|
|
- UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"与订阅者私聊" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
+ UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:WFCString(@"Cancel") style:UIAlertActionStyleCancel handler:nil];
|
|
|
+ UIAlertAction *okAction = [UIAlertAction actionWithTitle:WFCString(@"ChatWithSubscriber") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
if (model.message.direction == MessageDirection_Receive) {
|
|
|
WFCCChannelInfo *channelInfo = [[WFCCIMService sharedWFCIMService] getChannelInfo:self.conversation.target refresh:NO];
|
|
|
if ([channelInfo.owner isEqualToString:[WFCCNetworkService sharedInstance].userId]) {
|
|
@@ -1078,24 +1078,19 @@
|
|
|
}
|
|
|
|
|
|
- (void)didSelectPhoneNumber:(WFCUMessageCellBase *)cell withModel:(WFCUMessageModel *)model withPhoneNumber:(NSString *)phoneNumber {
|
|
|
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:@"我猜%@是一个电话号码", phoneNumber] message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
|
|
+ UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:WFCString(@"PhoneNumberHint"), phoneNumber] message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
|
|
|
|
|
- UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
|
|
|
- UIAlertAction *callAction = [UIAlertAction actionWithTitle:@"呼叫" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
+ UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:WFCString(@"Cancel") style:UIAlertActionStyleCancel handler:nil];
|
|
|
+ UIAlertAction *callAction = [UIAlertAction actionWithTitle:WFCString(@"Call") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
NSURL *url = [[NSURL alloc] initWithString:[NSString stringWithFormat:@"telprompt:%@", phoneNumber]];
|
|
|
[[UIApplication sharedApplication] openURL:url];
|
|
|
}];
|
|
|
|
|
|
- UIAlertAction *copyAction = [UIAlertAction actionWithTitle:@"复制号码" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
+ UIAlertAction *copyAction = [UIAlertAction actionWithTitle:WFCString(@"CopyNumber") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
|
|
pasteboard.string = phoneNumber;
|
|
|
}];
|
|
|
|
|
|
-// UIAlertAction *addContactAction = [UIAlertAction actionWithTitle:@"添加到通讯录" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
-//
|
|
|
-//
|
|
|
-// }];
|
|
|
-
|
|
|
[alertController addAction:cancelAction];
|
|
|
[alertController addAction:callAction];
|
|
|
[alertController addAction:copyAction];
|
|
@@ -1110,7 +1105,7 @@
|
|
|
|
|
|
- (void)audioPlayerDecodeErrorDidOccur:(AVAudioPlayer *)player error:(NSError *)error {
|
|
|
NSLog(@"player decode error");
|
|
|
- [[[UIAlertView alloc] initWithTitle:@"警告" message:@"网络错误" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil] show];
|
|
|
+ [[[UIAlertView alloc] initWithTitle:WFCString(@"Warning") message:WFCString(@"NetworkError") delegate:nil cancelButtonTitle:WFCString(@"Ok") otherButtonTitles:nil, nil] show];
|
|
|
[self stopPlayer];
|
|
|
}
|
|
|
|
|
@@ -1307,11 +1302,11 @@
|
|
|
- (void)displayMenu:(WFCUMessageCellBase *)baseCell {
|
|
|
UIMenuController *menu = [UIMenuController sharedMenuController];
|
|
|
|
|
|
- UIMenuItem *deleteItem = [[UIMenuItem alloc]initWithTitle:@"删除" action:@selector(performDelete:)];
|
|
|
- UIMenuItem *copyItem = [[UIMenuItem alloc]initWithTitle:@"复制" action:@selector(performCopy:)];
|
|
|
- UIMenuItem *forwardItem = [[UIMenuItem alloc]initWithTitle:@"转发" action:@selector(performForward:)];
|
|
|
- UIMenuItem *recallItem = [[UIMenuItem alloc]initWithTitle:@"撤回" action:@selector(performRecall:)];
|
|
|
- UIMenuItem *complainItem = [[UIMenuItem alloc]initWithTitle:@"举报" action:@selector(performComplain:)];
|
|
|
+ UIMenuItem *deleteItem = [[UIMenuItem alloc]initWithTitle:WFCString(@"Delete") action:@selector(performDelete:)];
|
|
|
+ UIMenuItem *copyItem = [[UIMenuItem alloc]initWithTitle:WFCString(@"Copy") action:@selector(performCopy:)];
|
|
|
+ UIMenuItem *forwardItem = [[UIMenuItem alloc]initWithTitle:WFCString(@"Forward") action:@selector(performForward:)];
|
|
|
+ UIMenuItem *recallItem = [[UIMenuItem alloc]initWithTitle:WFCString(@"Recall") action:@selector(performRecall:)];
|
|
|
+ UIMenuItem *complainItem = [[UIMenuItem alloc]initWithTitle:WFCString(@"Complain") action:@selector(performComplain:)];
|
|
|
|
|
|
CGRect menuPos;
|
|
|
if ([baseCell isKindOfClass:[WFCUMessageCell class]]) {
|
|
@@ -1441,7 +1436,7 @@
|
|
|
-(void)performRecall:(UIMenuItem *)sender {
|
|
|
if (self.cell4Menu.model.message) {
|
|
|
__block MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
- hud.label.text = @"撤回中。。。";
|
|
|
+ hud.label.text = WFCString(@"Recalling");
|
|
|
[hud showAnimated:YES];
|
|
|
__weak typeof(self) ws = self;
|
|
|
[[WFCCIMService sharedWFCIMService] recall:self.cell4Menu.model.message success:^{
|
|
@@ -1453,7 +1448,7 @@
|
|
|
} error:^(int error_code) {
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
hud.mode = MBProgressHUDModeText;
|
|
|
- hud.label.text = @"撤回失败";
|
|
|
+ hud.label.text = WFCString(@"RecallFailure");
|
|
|
[hud hideAnimated:YES afterDelay:1.f];
|
|
|
});
|
|
|
}];
|
|
@@ -1461,9 +1456,9 @@
|
|
|
}
|
|
|
|
|
|
- (void)performComplain:(UIMenuItem *)sender {
|
|
|
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"举报" message:@"如果您发现有违反法律和道德的内容,或者您的合法权益受到侵犯,请截图之后发送给我们。我们会在24小时之内处理。处理办法包括不限于删除内容,对作者进行警告,冻结账号,甚至报警处理。举报请到\"设置->设置->举报\"联系我们!" preferredStyle:UIAlertControllerStyleAlert];
|
|
|
+ UIAlertController *alertController = [UIAlertController alertControllerWithTitle:WFCString(@"Complain") message:@"如果您发现有违反法律和道德的内容,或者您的合法权益受到侵犯,请截图之后发送给我们。我们会在24小时之内处理。处理办法包括不限于删除内容,对作者进行警告,冻结账号,甚至报警处理。举报请到\"设置->设置->举报\"联系我们!" preferredStyle:UIAlertControllerStyleAlert];
|
|
|
|
|
|
- UIAlertAction *action = [UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
|
|
+ UIAlertAction *action = [UIAlertAction actionWithTitle:WFCString(WFCString(@"Ok")) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
|
|
|
|
|
}];
|
|
|
[alertController addAction:action];
|