Browse Source

多语言部分完善

桂欢 1 year ago
parent
commit
56488849b5

+ 1 - 1
SLAiELTS/Pods/BRPickerView/BRPickerView/Base/BRPickerStyle.m

@@ -192,7 +192,7 @@
 
 - (CGRect)doneBtnFrame {
     if (CGRectEqualToRect(_doneBtnFrame, CGRectZero) || _doneBtnFrame.size.height == 0) {
-        _doneBtnFrame = CGRectMake(BRGetKeyWindow().bounds.size.width - 60 - 5, 8, 60, 28);
+        _doneBtnFrame = CGRectMake(BRGetKeyWindow().bounds.size.width - 80 - 5, 8, 80, 28);
     }
     return _doneBtnFrame;
 }

+ 4 - 5
SLAiELTS/SLAiELTS/Tool/NetWorking/SLHttpCenter.m

@@ -10,10 +10,9 @@
 #import "AFNetworking.h"
 #import "SPRequestError.h"
 #import <CoreTelephony/CTCellularData.h>
-#define KTimeoutInterval 15;
-static NSString *const kNOConnect = @"网络无连接,请检查网络";
-
-static NSString *const SLResponseFailure = @"网络不给力 请稍后再试";
+#define KTimeoutInterval 15
+#define kNOConnect NSLocalizedString(@"网络无连接,请检查网络", nil)
+#define SLResponseFailure NSLocalizedString(@"网络不给力 请稍后再试", nil)
 
 @interface SLHttpCenter ()
 
@@ -249,7 +248,7 @@ static SLHttpCenter *handle;
         handle.responseSerializer = [AFHTTPResponseSerializer serializer];
         handle.requestSerializer = [AFJSONRequestSerializer serializer];
         handle.requestSerializer.timeoutInterval = KTimeoutInterval;
-        [handle.requestSerializer setValue:@"iOS" forHTTPHeaderField:@"OS"];
+        [handle.requestSerializer setValue:@"IOS" forHTTPHeaderField:@"OS"];
         handle.NetWorkIsOK = YES;
         [handle startMonitorNetWork];
         handle.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain", @"multipart/form-data", @"application/json", @"text/html", @"image/jpeg", @"image/png",@"application/octet-stream", @"text/json",@"application/x-www-form-urlencoded", nil];

+ 7 - 4
SLAiELTS/SLAiELTS/Vendor/Resources/en.lproj/Localizable.strings

@@ -15,7 +15,9 @@
 "设置生日" = "Set Birthday";
 "性别" = "Gender";
 "男性" = "Male";
+"男" = "Male";
 "女性" = "Female";
+"女" = "Female";
 "下一步" = "Next step";
 "为你的AI助教取名" = "Name your AI teaching assistant";
 "AI助教将使用此名称与你对话" = "The AI teaching assistant will use this name to talk to you";
@@ -44,6 +46,7 @@
 "只看女生" = "Only looking at girls";
 "选择好友" = "Choose friend";
 "完成" = "Complete";
+"完成  " = "Complete";
 "全文" = "Full text";
 "评论" = "Comment";
 "点赞" = "Like";
@@ -122,10 +125,10 @@
 "秒" = "s";
 "音" = "Accent";
 "性" = "male";
-"男性" = "male";
-"男性" = "male";
-"男性" = "male";
-"男性" = "male";
+"M月d日 H:mm" = "M/d H:mm";
+"网络不给力 请稍后再试" = "The network is not awesome, please try again later";
+"网络无连接,请检查网络" = "No network connection, please check the network";
+"请选择地区" = "Select Region";
 "男性" = "male";
 "男性" = "male";
 "男性" = "male";

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/Views/IMMessageView/YMIMBaseMessageCell.m

@@ -85,7 +85,7 @@
          
         CGFloat nowDate = [[NSDate date] timeIntervalSince1970];
         if (nowDate - msgModel.sendTime > 60 * 60 * 24) {
-            self.timeLabel.text = [NSString timeFromFormatter:@"M月d日 H:mm" timeString:timeStr];
+            self.timeLabel.text = [NSString timeFromFormatter:NSLocalizedString(@"M月d日 H:mm", nil) timeString:timeStr];
         }else {
             self.timeLabel.text = [NSString timeFromFormatter:@"H:mm" timeString:timeStr];
         }

+ 3 - 2
SLAiELTS/SLAiELTS/ViewControllers/Moments/Views/SLMoentsChatView.m

@@ -39,12 +39,12 @@ static const NSInteger btnTag = 20000;
     [self.rightSendBtn mas_makeConstraints:^(MASConstraintMaker *make) {
         make.centerY.equalTo(self.textBgView);
         make.right.equalTo(self.textBgView.mas_right).offset(-12 * KScaleW);
-        make.width.mas_equalTo(64);
+        make.width.mas_equalTo(74);
         make.height.mas_equalTo(32);
     }];
     
     [self.nextGrowingTextView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.mas_equalTo(24);
+        make.left.equalTo(self).offset(24);
         make.centerY.equalTo(self.textBgView).priority(500);
         make.top.greaterThanOrEqualTo(self.textBgView).offset(8).priority(1000);
         make.right.equalTo(self.rightSendBtn.mas_left).offset(-12);
@@ -77,6 +77,7 @@ static const NSInteger btnTag = 20000;
         [_rightSendBtn setBackgroundImage:ImageName(@"icon_btn_blue_sel") forState:UIControlStateHighlighted];
         [_rightSendBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
         _rightSendBtn.tag = btnTag + 2;
+        _rightSendBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
         [self.textBgView addSubview:_rightSendBtn];
     }
     return _rightSendBtn;

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLAiSetVc.m

@@ -145,7 +145,7 @@
         RoleModel *user = [SLGlobalInfo SharedInstance].roleModel;
         NSArray *arr = @[
         @[[SLPageModelDetail initWithTitle:NSLocalizedString(@"AI昵称", nil) subTitle:user.aiName bgImage:@""],
-          [SLPageModelDetail initWithTitle:NSLocalizedString(@"性别", nil) subTitle:user.aiSex bgImage:@""],],
+          [SLPageModelDetail initWithTitle:NSLocalizedString(@"性别", nil) subTitle:NSLocalizedString(user.aiSex, nil) bgImage:@""],],
           @[[SLPageModelDetail initWithTitle:NSLocalizedString(@"口音设置", nil) segments:@[NSLocalizedString(@"American Accent", nil), NSLocalizedString(@"British Accent", nil)]],
             [SLPageModelDetail initWithTitle:NSLocalizedString(@"难度设置", nil) segments:@[NSLocalizedString(@"简单", nil), NSLocalizedString(@"中等", nil), NSLocalizedString(@"困难", nil)]],
             [SLPageModelDetail initWithTitle:NSLocalizedString(@"语速设置", nil) segments:@[NSLocalizedString(@"slow", nil), NSLocalizedString(@"medium", nil), NSLocalizedString(@"fast", nil)]]],];

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLCitySetVc.m

@@ -86,7 +86,7 @@
     /// 地址选择器
     BRAddressPickerView *addressPickerView = [[BRAddressPickerView alloc]init];
     addressPickerView.pickerMode = BRAddressPickerModeCity;
-    addressPickerView.title = @"请选择地区";
+    addressPickerView.title = NSLocalizedString(@"请选择地区", nil);
     //addressPickerView.selectValues = @[@"浙江省", @"杭州市", @"西湖区"];
 //    addressPickerView.selectIndexs = @[@10, @0, @4];
 //    addressPickerView.isAutoSelect = YES;

+ 4 - 4
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLSexSetVc.m

@@ -20,7 +20,7 @@
     [super viewDidLoad];
     // Do any additional setup after loading the view from its nib.
     self.title = NSLocalizedString(@"设置性别", nil);
-    YMBarButtonItem *rightBarItem = [[YMBarButtonItem alloc] initWithTitle:@"完成  " target:self action:@selector(preserveBtnClick)];
+    YMBarButtonItem *rightBarItem = [[YMBarButtonItem alloc] initWithTitle:NSLocalizedString(@"完成  ", nil) target:self action:@selector(preserveBtnClick)];
     rightBarItem.titleInsets = UIEdgeInsetsMake(0, 0, 0, 20);
     self.navigationBar.rightBarButtonItem = rightBarItem;
     [self confignSexSetView];
@@ -33,7 +33,7 @@
         if ([obj isKindOfClass:SLBaseCellView.class]) {
             SLBaseCellView *baseCell = obj;
             baseCell.leftImageView.image = ImageName(@"check_circle");
-            if ([baseCell.titleLabel.text isEqualToString:self.currentSelSex]) {
+            if ([baseCell.titleLabel.text isEqualToString:NSLocalizedString(self.currentSelSex, nil)]) {
                 baseCell.leftImageView.image = ImageName(@"check_circle_filled");
             }
         }
@@ -41,8 +41,8 @@
 }
 
 - (void)confignSexSetView {
-    NSArray *arr = @[[SLPageModelDetail initWithTitle:@"男" bgImage:@"check_circle"],
-      [SLPageModelDetail initWithTitle:@"女" bgImage:@"check_circle"],];
+    NSArray *arr = @[[SLPageModelDetail initWithTitle:NSLocalizedString(@"男", nil) bgImage:@"check_circle"],
+      [SLPageModelDetail initWithTitle:NSLocalizedString(@"女", nil) bgImage:@"check_circle"],];
     [arr enumerateObjectsUsingBlock:^(SLPageModelDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
         SLBaseCellView *baseCell = [[SLBaseCellView alloc] initWithFrame:CGRectZero];
         baseCell.titleLabel.text = obj.title;

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLUserCenterViewController.m

@@ -169,7 +169,7 @@
           [SLPageModelDetail initWithTitle:NSLocalizedString(@"昵称", nil) subTitle:user.userName],
           [SLPageModelDetail initWithTitle:NSLocalizedString(@"手机号", nil) subTitle:user.phone],
           [SLPageModelDetail initWithTitle:@"DLid" subTitle:user.dlId canEdit:YES],
-          [SLPageModelDetail initWithTitle:NSLocalizedString(@"性别", nil) subTitle:user.sex canEdit:YES],
+          [SLPageModelDetail initWithTitle:NSLocalizedString(@"性别", nil) subTitle:NSLocalizedString(user.sex, nil) canEdit:YES],
           [SLPageModelDetail initWithTitle:NSLocalizedString(@"地区", nil) subTitle:[NSString stringWithFormat:@"%@%@",user.province,user.city]],
           [SLPageModelDetail initWithTitle:NSLocalizedString(@"星座", nil) subTitle:user.starSign canEdit:YES],],
           @[[SLPageModelDetail initWithTitle:NSLocalizedString(@"用户服务协议", nil) subTitle:@"" bgImage:@""],