Merge branch 'master' into 2.39.0

master
zhongweiguang 2022-11-25 13:03:43 +08:00
commit c9bee09b1b
4 changed files with 20 additions and 7 deletions

View File

@ -150,7 +150,8 @@ static NSString *scheme = @"fatae55433be2f62915";//App对应的scheme
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
message:nil message:nil
preferredStyle:UIAlertControllerStyleActionSheet]; preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *chooseAlbumAction = [UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) { NSString *album = [MOPTools fat_currentLanguageIsEn] ? @"Album" : @"从相册选择";
UIAlertAction *chooseAlbumAction = [UIAlertAction actionWithTitle:album style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
NSDictionary *params = @{@"name":@"chooseAvatarAlbum"}; NSDictionary *params = @{@"name":@"chooseAvatarAlbum"};
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
@ -158,7 +159,8 @@ static NSString *scheme = @"fatae55433be2f62915";//App对应的scheme
!bindChooseAvatar?: bindChooseAvatar(result); !bindChooseAvatar?: bindChooseAvatar(result);
}]; }];
}]; }];
UIAlertAction *photoAction = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) { NSString *camera = [MOPTools fat_currentLanguageIsEn] ? @"Camera" : @"拍照";
UIAlertAction *photoAction = [UIAlertAction actionWithTitle:camera style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
NSDictionary *params = @{@"name":@"chooseAvatarPhoto"}; NSDictionary *params = @{@"name":@"chooseAvatarPhoto"};
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
@ -166,8 +168,8 @@ static NSString *scheme = @"fatae55433be2f62915";//App对应的scheme
!bindChooseAvatar?: bindChooseAvatar(result); !bindChooseAvatar?: bindChooseAvatar(result);
}]; }];
}]; }];
NSString *cancel = [MOPTools fat_currentLanguageIsEn] ? @"Cancel" : @"取消";
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *_Nonnull action){ UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancel style:UIAlertActionStyleCancel handler:^(UIAlertAction *_Nonnull action){
bindChooseAvatar(@{}); bindChooseAvatar(@{});
}]; }];
[alertController addAction:chooseAlbumAction]; [alertController addAction:chooseAlbumAction];

View File

@ -7,7 +7,7 @@
#import "MOP_showBotomSheetModel.h" #import "MOP_showBotomSheetModel.h"
#import "MopPlugin.h" #import "MopPlugin.h"
#import "MOPTools.h"
@implementation MOP_showBotomSheetModel @implementation MOP_showBotomSheetModel
@ -75,7 +75,8 @@ returnInsets = inset;\
[self addSubview:self.contentView]; [self addSubview:self.contentView];
self.cancelButton = [UIButton buttonWithType:UIButtonTypeCustom]; self.cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.cancelButton setTitle:@"取消" forState:UIControlStateNormal]; NSString *cancel = [MOPTools fat_currentLanguageIsEn] ? @"Cancel" : @"取消";
[self.cancelButton setTitle:cancel forState:UIControlStateNormal];
[self.cancelButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [self.cancelButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[self.contentView addSubview:self.cancelButton]; [self.contentView addSubview:self.cancelButton];
self.cancelButton.frame = CGRectMake(0, self.contentView.frame.size.height - kFinoSafeAreaBottom - 50, self.contentView.frame.size.width, 50); self.cancelButton.frame = CGRectMake(0, self.contentView.frame.size.height - kFinoSafeAreaBottom - 50, self.contentView.frame.size.width, 50);
@ -211,7 +212,8 @@ static NSString *cellID = @"cellid";
- (void)setType:(NSInteger)type { - (void)setType:(NSInteger)type {
_type = type; _type = type;
if (_type == 0) { if (_type == 0) {
self.label.text = @"微信好友"; NSString *wechat = [MOPTools fat_currentLanguageIsEn] ? @"Wechat" : @"微信好友";
self.label.text = wechat;
self.imageView.image = [UIImage imageNamed:@"turkey_share_wechat"]; self.imageView.image = [UIImage imageNamed:@"turkey_share_wechat"];
} }
} }

View File

@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (UIColor *)colorWithRGBHex:(UInt32)hex; + (UIColor *)colorWithRGBHex:(UInt32)hex;
+ (UIColor *)fat_colorWithHexString:(NSString *)hexColor; + (UIColor *)fat_colorWithHexString:(NSString *)hexColor;
+ (BOOL)fat_currentLanguageIsEn;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@ -112,5 +112,12 @@
return [UIColor colorWithRed:red / 255.0f green:green / 255.0f blue:blue / 255.0f alpha:alpha / 255.0f]; return [UIColor colorWithRed:red / 255.0f green:green / 255.0f blue:blue / 255.0f alpha:alpha / 255.0f];
} }
+ (BOOL)fat_currentLanguageIsEn {
NSString *languageCode = [NSLocale preferredLanguages].firstObject; // Code+
if ([languageCode hasPrefix:@"zh"]) {
return NO;
}
return YES;
}
@end @end