提交 f5d384a0 编写于 作者: X xieguobiyi

多语言文案更新

上级 3f0f777e
......@@ -63,7 +63,7 @@
UIButton *closeBtn = [[UIButton alloc] initWithFrame:CGRectMake(kDoraemonSizeFrom750(30), offsetY, self.view.doraemon_width-2*kDoraemonSizeFrom750(30), kDoraemonSizeFrom750(100))];
closeBtn.tag = scrollViewTagStartSubscript + _dataArray.count;
closeBtn.backgroundColor = [UIColor whiteColor];
[closeBtn setTitle:@"关闭DoraemonKit" forState:UIControlStateNormal];
[closeBtn setTitle:DoraemonLocalizedString(@"关闭DoraemonKit") forState:UIControlStateNormal];
[closeBtn setTitleColor:[UIColor doraemon_colorWithString:@"#CC3A4B"] forState:UIControlStateNormal];
[closeBtn addTarget:self action:@selector(close) forControlEvents:UIControlEventTouchUpInside];
[_scrollView addSubview:closeBtn];
......
......@@ -318,148 +318,148 @@ typedef void (^DoraemonPerformanceBlock)(NSDictionary *);
NSArray *dataArray = @{
// 常用工具
@(DoraemonManagerPluginType_DoraemonAppInfoPlugin) : @[
@{kTitle:@"App信息"},
@{kDesc:@"App的一些基本信息"},
@{kTitle:DoraemonLocalizedString(@"App信息")},
@{kDesc:DoraemonLocalizedString(@"App的一些基本信息")},
@{kIcon:@"doraemon_app_info"},
@{kPluginName:@"DoraemonAppInfoPlugin"},
@{kAtModule:@"常用工具"}
@{kAtModule:DoraemonLocalizedString(@"常用工具")}
],
@(DoraemonManagerPluginType_DoraemonSandboxPlugin) : @[
@{kTitle:@"沙盒浏览"},
@{kDesc:@"沙盒浏览"},
@{kTitle:DoraemonLocalizedString(@"沙盒浏览")},
@{kDesc:DoraemonLocalizedString(@"沙盒浏览")},
@{kIcon:@"doraemon_file"},
@{kPluginName:@"DoraemonSandboxPlugin"},
@{kAtModule:@"常用工具"}
@{kAtModule:DoraemonLocalizedString(@"常用工具")}
],
@(DoraemonManagerPluginType_DoraemonGPSPlugin) : @[
@{kTitle:@"MockGPS"},
@{kDesc:@"MockGPS"},
@{kIcon:@"doraemon_mock_gps"},
@{kPluginName:@"DoraemonGPSPlugin"},
@{kAtModule:@"常用工具"}
@{kAtModule:DoraemonLocalizedString(@"常用工具")}
],
@(DoraemonManagerPluginType_DoraemonH5Plugin) : @[
@{kTitle:@"H5任意门"},
@{kDesc:@"H5通用跳转"},
@{kTitle:DoraemonLocalizedString(@"H5任意门")},
@{kDesc:DoraemonLocalizedString(@"H5通用跳转")},
@{kIcon:@"doraemon_h5"},
@{kPluginName:@"DoraemonH5Plugin"},
@{kAtModule:@"常用工具"}
@{kAtModule:DoraemonLocalizedString(@"常用工具")}
],
@(DoraemonManagerPluginType_DoraemonCrashPlugin) : @[
@{kTitle:@"Crash查看"},
@{kDesc:@"Crash本地查看"},
@{kTitle:DoraemonLocalizedString(@"Crash查看")},
@{kDesc:DoraemonLocalizedString(@"Crash本地查看")},
@{kIcon:@"doraemon_crash"},
@{kPluginName:@"DoraemonCrashPlugin"},
@{kAtModule:@"常用工具"}
@{kAtModule:DoraemonLocalizedString(@"常用工具")}
],
@(DoraemonManagerPluginType_DoraemonSubThreadUICheckPlugin) : @[
@{kTitle:@"子线程UI"},
@{kDesc:@"非主线程UI渲染检查"},
@{kTitle:DoraemonLocalizedString(@"子线程UI")},
@{kDesc:DoraemonLocalizedString(@"非主线程UI渲染检查")},
@{kIcon:@"doraemon_ui"},
@{kPluginName:@"DoraemonSubThreadUICheckPlugin"},
@{kAtModule:@"常用工具"}
@{kAtModule:DoraemonLocalizedString(@"常用工具")}
],
@(DoraemonManagerPluginType_DoraemonDeleteLocalDataPlugin) : @[
@{kTitle:@"清除本地数据"},
@{kDesc:@"清除本地数据"},
@{kTitle:DoraemonLocalizedString(@"清除本地数据")},
@{kDesc:DoraemonLocalizedString(@"清除本地数据")},
@{kIcon:@"doraemon_qingchu"},
@{kPluginName:@"DoraemonDeleteLocalDataPlugin"},
@{kAtModule:@"常用工具"}
@{kAtModule:DoraemonLocalizedString(@"常用工具")}
],
@(DoraemonManagerPluginType_DoraemonNSLogPlugin) : @[
@{kTitle:@"NSLog"},
@{kDesc:@"NSLog"},
@{kIcon:@"doraemon_nslog"},
@{kPluginName:@"DoraemonNSLogPlugin"},
@{kAtModule:@"常用工具"}
@{kAtModule:DoraemonLocalizedString(@"常用工具")}
],
@(DoraemonManagerPluginType_DoraemonCocoaLumberjackPlugin) : @[
@{kTitle:@"Lumberjack"},
@{kDesc:@"日志显示"},
@{kDesc:DoraemonLocalizedString(@"日志显示")},
@{kIcon:@"doraemon_log"},
@{kPluginName:@"DoraemonCocoaLumberjackPlugin"},
@{kAtModule:@"常用工具"}
@{kAtModule:DoraemonLocalizedString(@"常用工具")}
],
// 性能检测
@(DoraemonManagerPluginType_DoraemonFPSPlugin) : @[
@{kTitle:@"帧率"},
@{kDesc:@"帧率监控"},
@{kTitle:DoraemonLocalizedString(@"帧率")},
@{kDesc:DoraemonLocalizedString(@"帧率监控")},
@{kIcon:@"doraemon_fps"},
@{kPluginName:@"DoraemonFPSPlugin"},
@{kAtModule:@"性能检测"}
@{kAtModule:DoraemonLocalizedString(@"性能检测")}
],
@(DoraemonManagerPluginType_DoraemonCPUPlugin) : @[
@{kTitle:@"CPU"},
@{kDesc:@"CPU监控"},
@{kDesc:DoraemonLocalizedString(@"CPU监控")},
@{kIcon:@"doraemon_cpu"},
@{kPluginName:@"DoraemonCPUPlugin"},
@{kAtModule:@"性能检测"}
@{kAtModule:DoraemonLocalizedString(@"性能检测")}
],
@(DoraemonManagerPluginType_DoraemonMemoryPlugin) : @[
@{kTitle:@"内存"},
@{kDesc:@"内存监控"},
@{kTitle:DoraemonLocalizedString(@"内存")},
@{kDesc:DoraemonLocalizedString(@"内存监控")},
@{kIcon:@"doraemon_memory"},
@{kPluginName:@"DoraemonMemoryPlugin"},
@{kAtModule:@"性能检测"}
@{kAtModule:DoraemonLocalizedString(@"性能检测")}
],
@(DoraemonManagerPluginType_DoraemonNetFlowPlugin) : @[
@{kTitle:@"流量"},
@{kDesc:@"流量监控"},
@{kTitle:DoraemonLocalizedString(@"流量")},
@{kDesc:DoraemonLocalizedString(@"流量监控")},
@{kIcon:@"doraemon_net"},
@{kPluginName:@"DoraemonNetFlowPlugin"},
@{kAtModule:@"性能检测"}
@{kAtModule:DoraemonLocalizedString(@"性能检测")}
],
@(DoraemonManagerPluginType_DoraemonANRPlugin) : @[
@{kTitle:@"卡顿"},
@{kDesc:@"卡顿监控"},
@{kTitle:DoraemonLocalizedString(@"卡顿")},
@{kDesc:DoraemonLocalizedString(@"卡顿监控")},
@{kIcon:@"doraemon_kadun"},
@{kPluginName:@"DoraemonANRPlugin"},
@{kAtModule:@"性能检测"}
@{kAtModule:DoraemonLocalizedString(@"性能检测")}
],
@(DoraemonManagerPluginType_DoraemonAllTestPlugin) : @[
@{kTitle:@"自定义"},
@{kDesc:@"性能数据保存到本地"},
@{kTitle:DoraemonLocalizedString(@"自定义")},
@{kDesc:DoraemonLocalizedString(@"性能数据保存到本地")},
@{kIcon:@"doraemon_default"},
@{kPluginName:@"DoraemonAllTestPlugin"},
@{kAtModule:@"性能检测"}
@{kAtModule:DoraemonLocalizedString(@"性能检测")}
],
@(DoraemonManagerPluginType_DoraemonMethodUseTimePlugin) : @[
@{kTitle:@"Load耗时"},
@{kDesc:@"Load方法消耗时间"},
@{kTitle:DoraemonLocalizedString(@"Load耗时")},
@{kDesc:DoraemonLocalizedString(@"Load方法消耗时间")},
@{kIcon:@"doraemon_method_use_time"},
@{kPluginName:@"DoraemonMethodUseTimePlugin"},
@{kAtModule:@"性能检测"}
@{kAtModule:DoraemonLocalizedString(@"性能检测")}
],
// 视觉工具
@(DoraemonManagerPluginType_DoraemonColorPickPlugin) : @[
@{kTitle:@"颜色吸管"},
@{kDesc:@"颜色拾取器"},
@{kTitle:DoraemonLocalizedString(@"颜色吸管")},
@{kDesc:DoraemonLocalizedString(@"颜色拾取器")},
@{kIcon:@"doraemon_straw"},
@{kPluginName:@"DoraemonColorPickPlugin"},
@{kAtModule:@"视觉工具"}
@{kAtModule:DoraemonLocalizedString(@"视觉工具")}
],
@(DoraemonManagerPluginType_DoraemonViewCheckPlugin) : @[
@{kTitle:@"组件检查"},
@{kDesc:@"View查看器"},
@{kTitle:DoraemonLocalizedString(@"组件检查")},
@{kDesc:DoraemonLocalizedString(@"View查看器")},
@{kIcon:@"doraemon_view_check"},
@{kPluginName:@"DoraemonViewCheckPlugin"},
@{kAtModule:@"视觉工具"}
@{kAtModule:DoraemonLocalizedString(@"视觉工具")}
],
@(DoraemonManagerPluginType_DoraemonViewAlignPlugin) : @[
@{kTitle:@"对齐标尺"},
@{kDesc:@"查看组件是否对齐"},
@{kTitle:DoraemonLocalizedString(@"对齐标尺")},
@{kDesc:DoraemonLocalizedString(@"查看组件是否对齐")},
@{kIcon:@"doraemon_align"},
@{kPluginName:@"DoraemonViewAlignPlugin"},
@{kAtModule:@"视觉工具"}
@{kAtModule:DoraemonLocalizedString(@"视觉工具")}
],
@(DoraemonManagerPluginType_DoraemonViewMetricsPlugin) : @[
@{kTitle:@"元素边框线"},
@{kDesc:@"显示元素边框线"},
@{kTitle:DoraemonLocalizedString(@"元素边框线")},
@{kDesc:DoraemonLocalizedString(@"显示元素边框线")},
@{kIcon:@"doraemon_viewmetrics"},
@{kPluginName:@"DoraemonViewMetricsPlugin"},
@{kAtModule:@"视觉工具"}
@{kAtModule:DoraemonLocalizedString(@"视觉工具")}
]
}[@(pluginType)];
......
......@@ -31,10 +31,10 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"自定义测试";
self.title = DoraemonLocalizedString(@"自定义测试");
_fpsSwitchView = [[DoraemonCellSwitch alloc] initWithFrame:CGRectMake(0, self.bigTitleView.doraemon_bottom, self.view.doraemon_width, kDoraemonSizeFrom750(104))];
[_fpsSwitchView renderUIWithTitle:@"帧率" switchOn:[DoraemonAllTestManager shareInstance].fpsSwitchOn];
[_fpsSwitchView renderUIWithTitle:DoraemonLocalizedString(@"帧率") switchOn:[DoraemonAllTestManager shareInstance].fpsSwitchOn];
[_fpsSwitchView.switchView addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:_fpsSwitchView];
......@@ -44,12 +44,12 @@
[self.view addSubview:_cpuSwitchView];
_memorySwitchView = [[DoraemonCellSwitch alloc] initWithFrame:CGRectMake(0, self.cpuSwitchView.doraemon_bottom, self.view.doraemon_width, kDoraemonSizeFrom750(104))];
[_memorySwitchView renderUIWithTitle:@"内存" switchOn:[DoraemonAllTestManager shareInstance].memorySwitchOn];
[_memorySwitchView renderUIWithTitle:DoraemonLocalizedString(@"内存") switchOn:[DoraemonAllTestManager shareInstance].memorySwitchOn];
[_memorySwitchView.switchView addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:_memorySwitchView];
_flowSwitchView = [[DoraemonCellSwitch alloc] initWithFrame:CGRectMake(0, self.memorySwitchView.doraemon_bottom, self.view.doraemon_width, kDoraemonSizeFrom750(104))];
[_flowSwitchView renderUIWithTitle:@"流量" switchOn:[DoraemonAllTestManager shareInstance].flowSwitchOn];
[_flowSwitchView renderUIWithTitle:DoraemonLocalizedString(@"流量") switchOn:[DoraemonAllTestManager shareInstance].flowSwitchOn];
[_flowSwitchView.switchView addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:_flowSwitchView];
......
......@@ -45,13 +45,13 @@
NSString *cnValue = nil;
if([value isEqualToString:@"NotDetermined"]){
cnValue = @"用户没有选择";
cnValue = DoraemonLocalizedString(@"用户没有选择");
}else if([value isEqualToString:@"Restricted"]){
cnValue = @"家长控制";
cnValue = DoraemonLocalizedString(@"家长控制");
}else if([value isEqualToString:@"Denied"]){
cnValue = @"用户没有授权";
cnValue = DoraemonLocalizedString(@"用户没有授权");
}else if([value isEqualToString:@"Authorized"]){
cnValue = @"用户已经授权";
cnValue = DoraemonLocalizedString(@"用户已经授权");
}else{
cnValue = value;
}
......
......@@ -16,12 +16,12 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"检测记录";
self.title = DoraemonLocalizedString(@"检测记录");
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, IPHONE_NAVIGATIONBAR_HEIGHT+kDoraemonSizeFrom750(40), self.view.doraemon_width, kDoraemonSizeFrom750(40))];
titleLabel.font = [UIFont systemFontOfSize:kDoraemonSizeFrom750(32)];
titleLabel.textColor = [UIColor doraemon_black_1];
titleLabel.text = @"正在开发中,敬请期待";
titleLabel.text = DoraemonLocalizedString(@"正在开发中,敬请期待");
titleLabel.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:titleLabel];
}
......
......@@ -24,7 +24,7 @@
self.title = DoraemonLocalizedString(@"清除本地数据");
_cellBtn = [[DoraemonCellButton alloc] initWithFrame:CGRectMake(0, self.bigTitleView.doraemon_bottom, self.view.doraemon_width, kDoraemonSizeFrom750(104))];
[_cellBtn renderUIWithTitle:@"清除本地数据"];
[_cellBtn renderUIWithTitle:DoraemonLocalizedString(@"清除本地数据")];
[_cellBtn renderUIWithRightContent:[self getHomeDirFileSize]];
_cellBtn.delegate = self;
[_cellBtn needDownLine];
......@@ -45,7 +45,7 @@
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:DoraemonLocalizedString(@"提示") message:DoraemonLocalizedString(@"确定要删除本地数据") preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:DoraemonLocalizedString(@"取消") style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:DoraemonLocalizedString(@"确定") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[weakSelf.cellBtn renderUIWithRightContent:@"正在清理中"];
[weakSelf.cellBtn renderUIWithRightContent:DoraemonLocalizedString(@"正在清理中")];
[DoraemonUtil clearLocalDatas];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakSelf.cellBtn renderUIWithRightContent:[self getHomeDirFileSize]];
......
......@@ -16,12 +16,12 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"检测记录";
self.title = DoraemonLocalizedString(@"检测记录");
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, IPHONE_NAVIGATIONBAR_HEIGHT+kDoraemonSizeFrom750(40), self.view.doraemon_width, kDoraemonSizeFrom750(40))];
titleLabel.font = [UIFont systemFontOfSize:kDoraemonSizeFrom750(32)];
titleLabel.textColor = [UIColor doraemon_black_1];
titleLabel.text = @"正在开发中,敬请期待";
titleLabel.text = DoraemonLocalizedString(@"正在开发中,敬请期待");
titleLabel.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:titleLabel];
}
......
......@@ -15,7 +15,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Doraemon内置浏览器";
self.title = DoraemonLocalizedString(@"Doraemon内置浏览器");
UIWebView * view = [[UIWebView alloc] initWithFrame:self.view.frame];
[view loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.h5Url]]];
[self.view addSubview:view];
......
......@@ -30,7 +30,7 @@
_h5UrlTextView = [[UITextView alloc] initWithFrame:CGRectMake(0, self.bigTitleView.doraemon_bottom, self.view.doraemon_width, kDoraemonSizeFrom750(358))];
_h5UrlTextView.font = [UIFont systemFontOfSize:kDoraemonSizeFrom750(32)];
_h5UrlTextView.placeholder = @"请输入网址";
_h5UrlTextView.placeholder = DoraemonLocalizedString(@"请输入网址");
[self.view addSubview:_h5UrlTextView];
_h5UrlTextView.keyboardType = UIKeyboardTypeURL;
_h5UrlTextView.autocorrectionType = UITextAutocorrectionTypeNo;
......
......@@ -25,7 +25,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"内存检测";
self.title = DoraemonLocalizedString(@"内存检测");
_switchView = [[DoraemonCellSwitch alloc] initWithFrame:CGRectMake(0, self.bigTitleView.doraemon_bottom, self.view.doraemon_width, kDoraemonSizeFrom750(104))];
[_switchView renderUIWithTitle:DoraemonLocalizedString(@"内存检测开关") switchOn:[[DoraemonCacheManager sharedInstance] memorySwitch]];
......
......@@ -16,12 +16,12 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"检测记录";
self.title = DoraemonLocalizedString(@"检测记录");
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, IPHONE_NAVIGATIONBAR_HEIGHT+kDoraemonSizeFrom750(40), self.view.doraemon_width, kDoraemonSizeFrom750(40))];
titleLabel.font = [UIFont systemFontOfSize:kDoraemonSizeFrom750(32)];
titleLabel.textColor = [UIColor doraemon_black_1];
titleLabel.text = @"正在开发中,敬请期待";
titleLabel.text = DoraemonLocalizedString(@"正在开发中,敬请期待");
titleLabel.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:titleLabel];
}
......
......@@ -42,7 +42,7 @@
NSString *log = model.content;
NSTimeInterval timeInterval = model.timeInterval;
NSString *time = [DoraemonUtil dateFormatTimeInterval:timeInterval];
content = [NSString stringWithFormat:@"%@\n触发时间: %@",log,time];
content = [NSString stringWithFormat:DoraemonLocalizedString(@"%@\n触发时间: %@"),log,time];
_logLabel.numberOfLines = 0;
_logLabel.text = content;
CGSize size = [_logLabel sizeThatFits:CGSizeMake(DoraemonScreenWidth-kDoraemonSizeFrom750(32)*2-kDoraemonSizeFrom750(25)-kDoraemonSizeFrom750(12)*2, MAXFLOAT)];
......@@ -66,7 +66,7 @@
NSString *log = model.content;
NSTimeInterval timeInterval = model.timeInterval;
NSString *time = [DoraemonUtil dateFormatTimeInterval:timeInterval];
NSString *content = [NSString stringWithFormat:@"%@\n触发时间: %@",log,time];
NSString *content = [NSString stringWithFormat:DoraemonLocalizedString(@"%@\n触发时间: %@"),log,time];
UILabel *logLabel = [[UILabel alloc] init];
logLabel.textColor = [UIColor doraemon_black_1];
......
......@@ -25,7 +25,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"NSLog日志记录";
self.title = DoraemonLocalizedString(@"NSLog日志记录");
//按照时间倒序排列
self.dataArray = [[[DoraemonNSLogManager sharedInstance].dataArray reverseObjectEnumerator] allObjects];
......
......@@ -29,7 +29,7 @@
[self addSubview:_searchIcon];
_textField = [[UITextField alloc] initWithFrame:CGRectMake(_searchIcon.doraemon_right+kDoraemonSizeFrom750(20), self.doraemon_height/2-kDoraemonSizeFrom750(50)/2, self.doraemon_width-_searchIcon.doraemon_right-kDoraemonSizeFrom750(20), kDoraemonSizeFrom750(50))];
_textField.placeholder = @"请输入您要搜索的关键字";
_textField.placeholder = DoraemonLocalizedString(@"请输入您要搜索的关键字");
[_textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
[self addSubview:_textField];
}
......
......@@ -25,7 +25,7 @@
_leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.doraemon_width/2, self.doraemon_height)];
_leftLabel.textColor = [UIColor doraemon_colorWithHexString:@"337CC4"];
_leftLabel.font = [UIFont systemFontOfSize:kDoraemonSizeFrom750(32)];
_leftLabel.text = @"请求";
_leftLabel.text = DoraemonLocalizedString(@"请求");
_leftLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:_leftLabel];
......@@ -36,7 +36,7 @@
_rightLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.doraemon_width/2, 0, self.doraemon_width/2, self.doraemon_height)];
_rightLabel.textColor = [UIColor doraemon_colorWithHexString:@"333333"];
_rightLabel.font = [UIFont systemFontOfSize:kDoraemonSizeFrom750(32)];
_rightLabel.text = @"响应";
_rightLabel.text = DoraemonLocalizedString(@"响应");
_rightLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:_rightLabel];
......
......@@ -16,12 +16,12 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"检测记录";
self.title = DoraemonLocalizedString(@"检测记录");
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, IPHONE_NAVIGATIONBAR_HEIGHT+kDoraemonSizeFrom750(40), self.view.doraemon_width, kDoraemonSizeFrom750(40))];
titleLabel.font = [UIFont systemFontOfSize:kDoraemonSizeFrom750(32)];
titleLabel.textColor = [UIColor doraemon_black_1];
titleLabel.text = @"正在开发中,敬请期待";
titleLabel.text = DoraemonLocalizedString(@"正在开发中,敬请期待");
titleLabel.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:titleLabel];
}
......
......@@ -143,7 +143,7 @@ static CGFloat const kViewCheckSize = 62;
}
- (void)configInfoLblText {
_infoWindow.infoText = [NSString stringWithFormat:@"位置:左%@ 右%@ 上%@ 下%@", _leftLabel.text, _rightLabel.text, _topLabel.text, _bottomLabel.text];
_infoWindow.infoText = [NSString stringWithFormat:DoraemonLocalizedString(@"位置:左%@ 右%@ 上%@ 下%@"), _leftLabel.text, _rightLabel.text, _topLabel.text, _bottomLabel.text];
}
......
......@@ -150,7 +150,7 @@ static CGFloat const kViewCheckSize = 62;
-(NSMutableAttributedString *)viewInfo:(UIView *)view{
if (view) {
NSMutableString *showString = [[NSMutableString alloc] init];
NSString *tempString = [NSString stringWithFormat:DoraemonLocalizedString(@"控件名称:%@"),NSStringFromClass([view class])];
NSString *tempString = [NSString stringWithFormat:@"%@:%@",DoraemonLocalizedString(@"控件名称"),NSStringFromClass([view class])];
[showString appendString:tempString];
tempString = [NSString stringWithFormat:DoraemonLocalizedString(@"\n控件位置:左%0.1lf 上%0.1lf 宽%0.1lf 高%0.1lf"),view.frame.origin.x,view.frame.origin.y,view.frame.size.width,view.frame.size.height];
......
......@@ -7,38 +7,17 @@
#import "Doraemoni18NUtil.h"
NSString *const DoraemonlanguageZHCN = @"zh-CN";/**< 中文(大陆) */
NSString *const DoraemonlanguageZHHansCN = @"zh-Hans-CN";/**< 中文(大陆)简体中文 */
NSString *const DoraemonlanguageENUS = @"en-US";/**< 英语(美国) */
NSString *const DoraemonlanguageENCN = @"en-CN";/**< 英语(美国) */
NSString *const DoraemonlanguageZHHK = @"zh-HK";/**< 中文(香港)*/
NSDictionary *DoraemonLanguageCode_ISO639CodeMap() {
NSDictionary *dict = @{DoraemonlanguageZHCN:@"zh-Hans"
,DoraemonlanguageZHHansCN:@"zh-Hans"
,DoraemonlanguageZHHK:@"zh-Han"
,DoraemonlanguageENUS:@"en"
,DoraemonlanguageENCN:@"en"};
return dict;
}
@implementation Doraemoni18NUtil
+ (NSString *)localizedString:(NSString *)key {
return key;
//暂时不支持国际化
NSString *language = [[NSLocale preferredLanguages] firstObject];
if (language.length == 0) {
return key;
}
NSString *fileNamePrefix = DoraemonLanguageCode_ISO639CodeMap()[language];
if (fileNamePrefix.length == 0) {
if ([language hasPrefix:@"zh-"]) {
fileNamePrefix = @"zh-Hans";
} else if ([language hasPrefix:@"en-"]) {
fileNamePrefix = @"en";
}
NSString *fileNamePrefix = @"zh-Hans";
if([language hasPrefix:@"en"]) {
fileNamePrefix = @"en";
}
NSBundle *tmp = [NSBundle bundleWithPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.bundle/", @"DoraemonKit"]]];
NSString *path = [tmp pathForResource:fileNamePrefix ofType:@"lproj"];
......
......@@ -137,7 +137,7 @@
CLLocation *loc = [[CLLocation alloc] initWithLatitude:coordinate.latitude longitude:coordinate.longitude];
[[DoraemonGPSMocker shareInstance] mockPoint:loc];
}else{
[DoraemonToastUtil showToast:@"格式不正确"];
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"格式不正确")];
return;
}
......
......@@ -27,7 +27,7 @@
self.layer.cornerRadius = kDoraemonSizeFrom750(8);
_textField = [[UITextField alloc] initWithFrame:CGRectMake(kDoraemonSizeFrom750(32), kDoraemonSizeFrom750(40), self.doraemon_width-2*kDoraemonSizeFrom750(32), kDoraemonSizeFrom750(45))];
_textField.placeholder = @"请输入经纬度";
_textField.placeholder = DoraemonLocalizedString(@"请输入经纬度");
[_textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
[self addSubview:_textField];
......@@ -44,7 +44,7 @@
_exampleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kDoraemonSizeFrom750(32),_lineView.doraemon_bottom+kDoraemonSizeFrom750(15), self.doraemon_width-kDoraemonSizeFrom750(32), kDoraemonSizeFrom750(33))];
_exampleLabel.textColor = [UIColor doraemon_black_3];
_exampleLabel.font = [UIFont systemFontOfSize:kDoraemonSizeFrom750(24)];
_exampleLabel.text = @"(示例: 120.15 30.28)";
_exampleLabel.text = DoraemonLocalizedString(@"(示例: 120.15 30.28)");
[self addSubview:_exampleLabel];
}
return self;
......
......@@ -25,7 +25,7 @@
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:kDoraemonSizeFrom750(32)];
_titleLabel.textColor = [UIColor doraemon_black_1];
_titleLabel.text = @"打开Mock GPS";
_titleLabel.text = DoraemonLocalizedString(@"打开Mock GPS");
[self addSubview:_titleLabel];
[_titleLabel sizeToFit];
_titleLabel.frame = CGRectMake(kDoraemonSizeFrom750(32), self.doraemon_height/2-_titleLabel.doraemon_height/2, _titleLabel.doraemon_width, _titleLabel.doraemon_height);
......
......@@ -41,7 +41,7 @@
if (model && model.expand){
NSString *log = model.message;
NSString *time = [DoraemonUtil dateFormatNSDate:model.timestamp];
content = [NSString stringWithFormat:@"%@\n触发时间: %@\n文件名称: %@\n所在行: %zi\n线程id: %@ \n线程名称: %@",log,time,model.fileName,model.line,model.threadId,model.threadName];
content = [NSString stringWithFormat:DoraemonLocalizedString(@"%@\n触发时间: %@\n文件名称: %@\n所在行: %zi\n线程id: %@ \n线程名称: %@"),log,time,model.fileName,model.line,model.threadId,model.threadName];
_logLabel.numberOfLines = 0;
_logLabel.text = content;
CGSize size = [_logLabel sizeThatFits:CGSizeMake(DoraemonScreenWidth-kDoraemonSizeFrom750(32)*2-kDoraemonSizeFrom750(25)-kDoraemonSizeFrom750(12)*2, MAXFLOAT)];
......@@ -64,7 +64,7 @@
if (model && model.expand) {
NSString *log = model.message;
NSString *time = [DoraemonUtil dateFormatNSDate:model.timestamp];
NSString *content = [NSString stringWithFormat:@"%@\n触发时间: %@\n文件名称: %@\n所在行: %zi\n线程id: %@\n线程名称: %@ ",log,time,model.fileName,model.line,model.threadId,model.threadName];
NSString *content = [NSString stringWithFormat:DoraemonLocalizedString(@"%@\n触发时间: %@\n文件名称: %@\n所在行: %zi\n线程id: %@\n线程名称: %@ "),log,time,model.fileName,model.line,model.threadId,model.threadName];
UILabel *logLabel = [[UILabel alloc] init];
logLabel.textColor = [UIColor doraemon_black_1];
......
......@@ -28,7 +28,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"CocoaLumberjack日志记录";
self.title = DoraemonLocalizedString(@"CocoaLumberjack日志记录");
self.origArray = [NSArray arrayWithArray:[DoraemonCocoaLumberjackLogger sharedInstance].messages];
self.dataArray = [NSArray arrayWithArray:self.origArray];
......
......@@ -9,6 +9,7 @@
#import "AppDelegate.h"
#import <DoraemonKit/DoraemonKit.h>
#import "DoraemonDemoHomeViewController.h"
#import "Doraemoni18NUtil.h"
//#import <CocoaLumberjack/CocoaLumberjack.h>
@interface AppDelegate ()
......@@ -25,7 +26,7 @@
for (int i=0; i<10; i++) {
//DDLogInfo(@"点击添加埋点11111");
}
[[DoraemonManager shareInstance] addPluginWithTitle:@"测试插件" icon:@"doraemon_default" desc:@"测试插件" pluginName:@"TestPlugin" atModule:@"业务工具"];
[[DoraemonManager shareInstance] addPluginWithTitle:DoraemonLocalizedString(@"测试插件") icon:@"doraemon_default" desc:DoraemonLocalizedString(@"测试插件") pluginName:@"TestPlugin" atModule:DoraemonLocalizedString(@"业务工具")];
[[DoraemonManager shareInstance] addStartPlugin:@"StartPlugin"];
[[DoraemonManager shareInstance] install];
......
......@@ -18,11 +18,11 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"通用测试";
self.title = DoraemonLocalizedString(@"通用测试");
UIButton *btn0 = [[UIButton alloc] initWithFrame:CGRectMake(0, IPHONE_NAVIGATIONBAR_HEIGHT, self.view.doraemon_width, 60)];
btn0.backgroundColor = [UIColor orangeColor];
[btn0 setTitle:@"子线程UI操作" forState:UIControlStateNormal];
[btn0 setTitle:DoraemonLocalizedString(@"子线程UI操作") forState:UIControlStateNormal];
[btn0 addTarget:self action:@selector(addSubViewAtOtherThread) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn0];
......
......@@ -34,7 +34,7 @@ typedef struct Test
[super viewDidLoad];
// Do any additional setup after loading the view.
self.title = @"crash查看";
self.title = DoraemonLocalizedString(@"crash查看");
[self.view addSubview:self.uncaughtExceptionBtn];
[self.view addSubview:self.signalExceptionBtn];
......
......@@ -16,6 +16,7 @@
#import "DoraemonDemoCrashViewController.h"
#import "DoraemonDemoCommonViewController.h"
#import <objc/runtime.h>
#import "Doraemoni18NUtil.h"
@interface DoraemonDemoHomeViewController ()<UITableViewDelegate,UITableViewDataSource>
......@@ -25,7 +26,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"DoraemonKit";
self.title = DoraemonLocalizedString(@"DoraemonKit");
self.navigationItem.leftBarButtonItems = nil;
UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds];
......@@ -47,21 +48,21 @@
NSString *txt = nil;
NSInteger row = indexPath.row;
if (row==0) {
txt = @"沙盒测试Demo";
txt = DoraemonLocalizedString(@"沙盒测试Demo");
}else if(row==1){
txt = @"日记测试Demo";
txt = DoraemonLocalizedString(@"日记测试Demo");
}else if(row==2){
txt = @"性能测试Demo";
txt = DoraemonLocalizedString(@"性能测试Demo");
}else if(row==3){
txt = @"视觉测试Demo";
txt = DoraemonLocalizedString(@"视觉测试Demo");
}else if(row==4){
txt = @"网络测试Demo";
txt = DoraemonLocalizedString(@"网络测试Demo");
}else if(row==5){
txt = @"模拟位置Demo";
txt = DoraemonLocalizedString(@"模拟位置Demo");
}else if(row==6){
txt = @"crash触发Demo";
txt = DoraemonLocalizedString(@"crash触发Demo");
}else if(row==7){
txt = @"通用测试Demo";
txt = DoraemonLocalizedString(@"通用测试Demo");
}
cell.textLabel.text = txt;
return cell;
......
......@@ -19,17 +19,17 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"日记测试Demo";
self.title = DoraemonLocalizedString(@"日记测试Demo");
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, IPHONE_NAVIGATIONBAR_HEIGHT, self.view.doraemon_width, 60)];
btn.backgroundColor = [UIColor orangeColor];
[btn setTitle:@"添加一条CocoaLumberjack日志" forState:UIControlStateNormal];
[btn setTitle:DoraemonLocalizedString(@"添加一条CocoaLumberjack日志") forState:UIControlStateNormal];
[btn addTarget:self action:@selector(addLogger) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
UIButton *btn_2 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn_2.backgroundColor = [UIColor orangeColor];
[btn_2 setTitle:@"添加一条NSLog日志" forState:UIControlStateNormal];
[btn_2 setTitle:DoraemonLocalizedString(@"添加一条NSLog日志") forState:UIControlStateNormal];
[btn_2 addTarget:self action:@selector(addLogger2) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn_2];
}
......
......@@ -25,7 +25,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"模拟位置";
self.title = DoraemonLocalizedString(@"模拟位置");
//初始化地图
MKMapView *mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0, IPHONE_NAVIGATIONBAR_HEIGHT, self.view.doraemon_width, self.view.doraemon_height)];
......
......@@ -30,45 +30,45 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"网络测试Demo";
self.title = DoraemonLocalizedString(@"网络测试Demo");
UIButton *btn0 = [[UIButton alloc] initWithFrame:CGRectMake(0, IPHONE_NAVIGATIONBAR_HEIGHT, self.view.doraemon_width, 60)];
btn0.backgroundColor = [UIColor orangeColor];
[btn0 setTitle:@"发送一条URLConnection请求" forState:UIControlStateNormal];
[btn0 setTitle:DoraemonLocalizedString(@"发送一条URLConnection请求") forState:UIControlStateNormal];
[btn0 addTarget:self action:@selector(netForURLConnection) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn0];
_btn0 = btn0;
UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn0.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn1.backgroundColor = [UIColor orangeColor];
[btn1 setTitle:@"发送一条NSURLSession请求" forState:UIControlStateNormal];
[btn1 setTitle:DoraemonLocalizedString(@"发送一条NSURLSession请求") forState:UIControlStateNormal];
[btn1 addTarget:self action:@selector(netForNSURLSession) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn1];
_btn1 = btn1;
UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn1.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn2.backgroundColor = [UIColor orangeColor];
[btn2 setTitle:@"发送一条AFNetworking请求" forState:UIControlStateNormal];
[btn2 setTitle:DoraemonLocalizedString(@"发送一条AFNetworking请求") forState:UIControlStateNormal];
[btn2 addTarget:self action:@selector(netForAFNetworking) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn2];
_btn2 = btn2;
UIButton *btn3 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn2.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn3.backgroundColor = [UIColor orangeColor];
[btn3 setTitle:@"发送一条AFNetworking请求2" forState:UIControlStateNormal];
[btn3 setTitle:DoraemonLocalizedString(@"发送一条AFNetworking请求2") forState:UIControlStateNormal];
[btn3 addTarget:self action:@selector(netForAFNetworking2) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn3];
_btn3 = btn3;
UIButton *btn4 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn3.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn4.backgroundColor = [UIColor orangeColor];
[btn4 setTitle:@"打开UIWebView" forState:UIControlStateNormal];
[btn4 setTitle:DoraemonLocalizedString(@"打开UIWebView") forState:UIControlStateNormal];
[btn4 addTarget:self action:@selector(openUIWebView) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn4];
UIButton *btn5 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn4.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn5.backgroundColor = [UIColor orangeColor];
[btn5 setTitle:@"打开WKWebView" forState:UIControlStateNormal];
[btn5 setTitle:DoraemonLocalizedString(@"打开WKWebView") forState:UIControlStateNormal];
[btn5 addTarget:self action:@selector(openWKWebView) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn5];
......
......@@ -7,6 +7,7 @@
//
#import "DoraemonUIWebViewViewController.h"
#import "Doraemoni18NUtil.h"
@interface DoraemonUIWebViewViewController ()
......@@ -17,7 +18,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"UIWebView";
self.title = DoraemonLocalizedString(@"UIWebView");
UIWebView * view = [[UIWebView alloc] initWithFrame:self.view.frame];
[view loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.baidu.com"]]];
[self.view addSubview:view];
......
......@@ -8,7 +8,7 @@
#import "DoraemonWKWebViewViewController.h"
#import <WebKit/WebKit.h>
#import "Doraemoni18NUtil.h"
@interface DoraemonWKWebViewViewController ()
......@@ -19,7 +19,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"WKWebView";
self.title = DoraemonLocalizedString(@"WKWebView");
WKWebView *webView = [[WKWebView alloc]initWithFrame:self.view.frame];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.baidu.com"]]];
[self.view addSubview:webView];
......
......@@ -32,42 +32,42 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"性能测试Demo";
self.title = DoraemonLocalizedString(@"性能测试Demo");
_highCPU = NO;
_highMemory = NO;
UIButton *btn0 = [[UIButton alloc] initWithFrame:CGRectMake(0, IPHONE_NAVIGATIONBAR_HEIGHT, self.view.doraemon_width, 60)];
btn0.backgroundColor = [UIColor orangeColor];
[btn0 setTitle:@"低FPS操作打开" forState:UIControlStateNormal];
[btn0 setTitle:DoraemonLocalizedString(@"低FPS操作打开") forState:UIControlStateNormal];
[btn0 addTarget:self action:@selector(fpsClick) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn0];
_btn0 = btn0;
UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn0.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn1.backgroundColor = [UIColor orangeColor];
[btn1 setTitle:@"高CPU操作打开" forState:UIControlStateNormal];
[btn1 setTitle:DoraemonLocalizedString(@"高CPU操作打开") forState:UIControlStateNormal];
[btn1 addTarget:self action:@selector(cpuClick) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn1];
_btn1 = btn1;
UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn1.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn2.backgroundColor = [UIColor orangeColor];
[btn2 setTitle:@"高内存操作打开" forState:UIControlStateNormal];
[btn2 setTitle:DoraemonLocalizedString(@"高内存操作打开") forState:UIControlStateNormal];
[btn2 addTarget:self action:@selector(memoryClick) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn2];
_btn2 = btn2;
UIButton *btn3 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn2.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn3.backgroundColor = [UIColor orangeColor];
[btn3 setTitle:@"高流量操作打开" forState:UIControlStateNormal];
[btn3 setTitle:DoraemonLocalizedString(@"高流量操作打开") forState:UIControlStateNormal];
[btn3 addTarget:self action:@selector(flowClick) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn3];
_btn3 = btn3;
UIButton *btn4 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn3.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn4.backgroundColor = [UIColor orangeColor];
[btn4 setTitle:@"卡顿操作打开" forState:UIControlStateNormal];
[btn4 setTitle:DoraemonLocalizedString(@"卡顿操作打开") forState:UIControlStateNormal];
[btn4 addTarget:self action:@selector(anrClick) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn4];
_btn4 = btn4;
......@@ -92,12 +92,12 @@
_cpuThread.name = @"HighCPUThread";
[_cpuThread start];
[_btn1 setTitle:@"高CPU操作关闭" forState:UIControlStateNormal];
[_btn1 setTitle:DoraemonLocalizedString(@"高CPU操作关闭") forState:UIControlStateNormal];
}else{
[_cpuThread cancel];
_cpuThread = nil;
[_btn1 setTitle:@"高CPU操作打开" forState:UIControlStateNormal];
[_btn1 setTitle:DoraemonLocalizedString(@"高CPU操作打开") forState:UIControlStateNormal];
}
}
......@@ -108,12 +108,12 @@
_memoryThread.name = @"HighMemoryThread";
[_memoryThread start];
[_btn2 setTitle:@"高内存操作关闭" forState:UIControlStateNormal];
[_btn2 setTitle:DoraemonLocalizedString(@"高内存操作关闭") forState:UIControlStateNormal];
}else{
[_memoryThread cancel];
_memoryThread = nil;
[_btn2 setTitle:@"高内存操作打开" forState:UIControlStateNormal];
[_btn2 setTitle:DoraemonLocalizedString(@"高内存操作打开") forState:UIControlStateNormal];
}
}
......
......@@ -19,41 +19,41 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"沙盒测试Demo";
self.title = DoraemonLocalizedString(@"沙盒测试Demo");
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, IPHONE_NAVIGATIONBAR_HEIGHT, self.view.doraemon_width, 60)];
btn.backgroundColor = [UIColor orangeColor];
[btn setTitle:@"添加一条json到沙盒中" forState:UIControlStateNormal];
[btn setTitle:DoraemonLocalizedString(@"添加一条json到沙盒中") forState:UIControlStateNormal];
[btn addTarget:self action:@selector(addFile) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn1.backgroundColor = [UIColor orangeColor];
[btn1 setTitle:@"添加一张图片到沙盒中" forState:UIControlStateNormal];
[btn1 setTitle:DoraemonLocalizedString(@"添加一张图片到沙盒中") forState:UIControlStateNormal];
[btn1 addTarget:self action:@selector(addImageFile) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn1];
UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn1.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn2.backgroundColor = [UIColor orangeColor];
[btn2 setTitle:@"添加一段mp4到沙盒中" forState:UIControlStateNormal];
[btn2 setTitle:DoraemonLocalizedString(@"添加一段mp4到沙盒中") forState:UIControlStateNormal];
[btn2 addTarget:self action:@selector(addMP4File) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn2];
UIButton *btn3 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn2.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn3.backgroundColor = [UIColor orangeColor];
[btn3 setTitle:@"添加doc、xlsx、pdf到沙盒中" forState:UIControlStateNormal];
[btn3 setTitle:DoraemonLocalizedString(@"添加doc、xlsx、pdf到沙盒中") forState:UIControlStateNormal];
[btn3 addTarget:self action:@selector(addOtherFile) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn3];
UIButton *btn4 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn3.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn4.backgroundColor = [UIColor orangeColor];
[btn4 setTitle:@"添加html到沙盒中" forState:UIControlStateNormal];
[btn4 setTitle:DoraemonLocalizedString(@"添加html到沙盒中") forState:UIControlStateNormal];
[btn4 addTarget:self action:@selector(addHtmlFile) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn4];
UIButton *btn5 = [[UIButton alloc] initWithFrame:CGRectMake(0, btn4.doraemon_bottom+20, self.view.doraemon_width, 60)];
btn5.backgroundColor = [UIColor orangeColor];
[btn5 setTitle:@"添加DB到沙盒中" forState:UIControlStateNormal];
[btn5 setTitle:DoraemonLocalizedString(@"添加DB到沙盒中") forState:UIControlStateNormal];
[btn5 addTarget:self action:@selector(addDBFile) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn5];
}
......
......@@ -18,7 +18,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"视觉测试Demo";
self.title = DoraemonLocalizedString(@"视觉测试Demo");
UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(100, 200, 60, 60)];
redView.backgroundColor = [UIColor redColor];
......@@ -30,7 +30,7 @@
// [self.view addSubview:alphaView];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 400, 200, 60)];
titleLabel.text = @"我是来测试的";
titleLabel.text = DoraemonLocalizedString(@"我是来测试的");
titleLabel.backgroundColor = [UIColor doraemon_colorWithString:@"#00FF00"];
titleLabel.textColor = [UIColor doraemon_colorWithString:@"#FF0000"];
[self.view addSubview:titleLabel];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册