This commit is contained in:
2025-11-17 20:07:39 +08:00
parent ee433db4ad
commit 005e3c7581
43 changed files with 529 additions and 172 deletions

View File

@@ -46,7 +46,8 @@
self.title = KBLocalized(@"lang_test_title");
NSString *code = [KBLocalizationManager shared].currentLanguageCode ?: @"";
NSString *fmt = KBLocalized(@"current_lang");
self.label.text = [NSString stringWithFormat:fmt.length ? fmt : @"当前:%@", code];
NSString *fallback = KBLocalized(@"当前:%@");
self.label.text = [NSString stringWithFormat:fmt.length ? fmt : fallback, code];
[self.toggleBtn setTitle:KBLocalized(@"lang_toggle") forState:UIControlStateNormal];
}
@@ -57,4 +58,3 @@
}
@end

View File

@@ -17,7 +17,7 @@
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
_applyBtn = [UIButton buttonWithType:UIButtonTypeSystem];
[_applyBtn setTitle:@"下载并应用" forState:UIControlStateNormal];
[_applyBtn setTitle:KBLocalized(@"Download & Apply") forState:UIControlStateNormal];
_applyBtn.layer.cornerRadius = 6; _applyBtn.layer.borderWidth = 1;
_applyBtn.layer.borderColor = [UIColor colorWithWhite:0.85 alpha:1].CGColor;
[self.contentView addSubview:_applyBtn];
@@ -41,14 +41,14 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"皮肤中心";
self.title = KBLocalized(@"皮肤中心");
self.view.backgroundColor = [UIColor whiteColor];
// URL KB_BASE_URL
// 使 picsum.photos id访
self.skins = @[
@{ @"id": @"aurora", @"name": @"极光", @"img": @"https://picsum.photos/id/1018/1600/900.jpg" },
@{ @"id": @"alps", @"name": @"雪山", @"img": @"https://picsum.photos/id/1016/1600/900.jpg" },
@{ @"id": @"lake", @"name": @"湖面", @"img": @"https://picsum.photos/id/1039/1600/900.jpg" },
@{ @"id": @"aurora", @"name": KBLocalized(@"极光"), @"img": @"https://picsum.photos/id/1018/1600/900.jpg" },
@{ @"id": @"alps", @"name": KBLocalized(@"雪山"), @"img": @"https://picsum.photos/id/1016/1600/900.jpg" },
@{ @"id": @"lake", @"name": KBLocalized(@"湖面"), @"img": @"https://picsum.photos/id/1039/1600/900.jpg" },
];
self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleInsetGrouped];
@@ -124,7 +124,7 @@
payload = UIImageJPEGRepresentation(img, 0.9);
}
BOOL ok = (payload.length > 0) ? [[KBSkinManager shared] applyImageSkinWithData:payload skinId:skin[@"id"] name:skin[@"name"]] : NO;
[KBHUD showInfo:(ok ? @"已应用,切到键盘查看" : @"应用失败")];
[KBHUD showInfo:(ok ? KBLocalized(@"已应用,切到键盘查看") : KBLocalized(@"应用失败"))];
});
}];
}

View File

@@ -38,7 +38,7 @@
self.tableView.tableHeaderView = header;
[self.view addSubview:self.tableView];
self.items = @[ KBLocalized(@"home_item_lang_test"), KBLocalized(@"home_item_keyboard_permission"), @"皮肤中心" ];
self.items = @[ KBLocalized(@"home_item_lang_test"), KBLocalized(@"home_item_keyboard_permission"), KBLocalized(@"皮肤中心") ];
dispatch_async(dispatch_get_main_queue(), ^{ [self.textView becomeFirstResponder]; });
@@ -50,7 +50,7 @@
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
self.title = KBLocalized(@"home_title");
self.items = @[ KBLocalized(@"home_item_lang_test"), KBLocalized(@"home_item_keyboard_permission"), @"皮肤中心" ];
self.items = @[ KBLocalized(@"home_item_lang_test"), KBLocalized(@"home_item_keyboard_permission"), KBLocalized(@"皮肤中心") ];
[self.tableView reloadData];
}

View File

@@ -23,7 +23,12 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor clearColor];
self.titles = @[@"螃蟹啊斯柯达积分卡", @"小龙虾", @"苹果", @"胡萝卜", @"葡萄", @"西瓜"];
self.titles = @[KBLocalized(@"螃蟹啊斯柯达积分卡"),
KBLocalized(@"小龙虾"),
KBLocalized(@"苹果"),
KBLocalized(@"胡萝卜"),
KBLocalized(@"葡萄"),
KBLocalized(@"西瓜")];
[self.view addSubview:self.myCategoryView];
[self.view addSubview:self.listContainerView];
self.listContainerView.scrollView.scrollEnabled = false;

View File

@@ -137,7 +137,7 @@
//
self.hotButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.hotButton setTitle:@"热门" forState:UIControlStateNormal];
[self.hotButton setTitle:KBLocalized(@"热门") forState:UIControlStateNormal];
[self.hotButton setTitleColor:[UIColor darkTextColor] forState:UIControlStateNormal];
[self.hotButton setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
self.hotButton.titleLabel.font = [UIFont boldSystemFontOfSize:16];
@@ -146,7 +146,7 @@
[self.topBar addSubview:self.hotButton];
self.rankButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.rankButton setTitle:@"排行" forState:UIControlStateNormal];
[self.rankButton setTitle:KBLocalized(@"排行") forState:UIControlStateNormal];
[self.rankButton setTitleColor:[UIColor darkTextColor] forState:UIControlStateNormal];
[self.rankButton setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
self.rankButton.titleLabel.font = [UIFont boldSystemFontOfSize:16];