This commit is contained in:
2025-11-17 21:35:25 +08:00
parent 0ef7b7d1d8
commit b2021dcb3c
9 changed files with 92 additions and 17 deletions

View File

@@ -234,7 +234,7 @@
- (UIButton *)buyButton {
if (!_buyButton) {
_buyButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_buyButton setTitle:@"Recharge Now" forState:UIControlStateNormal];
[_buyButton setTitle:KBLocalized(@"Recharge Now") forState:UIControlStateNormal];
[_buyButton setTitleColor:[UIColor colorWithHex:0x1B1F1A] forState:UIControlStateNormal];
_buyButton.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
[_buyButton setBackgroundImage:[UIImage imageNamed:@"recharge_now_icon"] forState:UIControlStateNormal];

View File

@@ -52,9 +52,44 @@
}
- (void)onToggle {
KBLocalizationManager *mgr = [KBLocalizationManager shared];
NSString *next = [mgr.currentLanguageCode.lowercaseString hasPrefix:@"zh"] ? @"en" : @"zh-Hans";
[mgr setCurrentLanguageCode:next persist:YES];
//
NSString *title = KBLocalized(@"Change Language");
NSString *msg = KBLocalized(@"Changing language will reload the Home screen.");
UIAlertController *ac = [UIAlertController alertControllerWithTitle:title
message:msg
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancel = [UIAlertAction actionWithTitle:KBLocalized(@"Cancel")
style:UIAlertActionStyleCancel
handler:nil];
__weak typeof(self) weakSelf = self;
UIAlertAction *ok = [UIAlertAction actionWithTitle:KBLocalized(@"Confirm")
style:UIAlertActionStyleDefault
handler:^(__unused UIAlertAction * _Nonnull action) {
__strong typeof(weakSelf) self = weakSelf;
if (!self) return;
KBLocalizationManager *mgr = [KBLocalizationManager shared];
NSString *next = [mgr.currentLanguageCode.lowercaseString hasPrefix:@"zh"] ? @"en" : @"zh-Hans";
[mgr setCurrentLanguageCode:next persist:YES];
//
dispatch_async(dispatch_get_main_queue(), ^{
id<UIApplicationDelegate> appDelegate = UIApplication.sharedApplication.delegate;
if ([appDelegate respondsToSelector:@selector(setupRootVC)]) {
// 使 AppDelegate
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[appDelegate performSelector:@selector(setupRootVC)];
#pragma clang diagnostic pop
}
});
}];
[ac addAction:cancel];
[ac addAction:ok];
[self presentViewController:ac animated:YES completion:nil];
}
@end

View File

@@ -107,7 +107,7 @@
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel new];
_titleLabel.text = @"Settings"; //
_titleLabel.text = KBLocalized(@"Settings"); //
_titleLabel.font = [UIFont systemFontOfSize:30 weight:UIFontWeightBold];
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
}
@@ -117,7 +117,7 @@
- (UIButton *)keyboardBtn {
if (!_keyboardBtn) {
_keyboardBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_keyboardBtn setTitle:@"My Keyboard" forState:UIControlStateNormal];
[_keyboardBtn setTitle:KBLocalized(@"My Keyboard") forState:UIControlStateNormal];
_keyboardBtn.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightSemibold];
[_keyboardBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_keyboardBtn.backgroundColor = [UIColor colorWithHex:KBColorValue];

View File

@@ -260,7 +260,7 @@ static NSString * const kKBMyKeyboardCellId = @"kKBMyKeyboardCellId";
- (UIButton *)saveButton {
if (!_saveButton) {
_saveButton = [UIButton buttonWithType:UIButtonTypeSystem];
[_saveButton setTitle:@"Save" forState:UIControlStateNormal];
[_saveButton setTitle:KBLocalized(@"Save") forState:UIControlStateNormal];
_saveButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
[_saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_saveButton.backgroundColor = [UIColor colorWithHex:KBColorValue];

View File

@@ -35,12 +35,12 @@
// title + SF Symbols +
self.data = @[
@[@{ @"title": @"Notice", @"icon": @"my_notice_icon", @"color": @(0x60A3FF) }],
@[@{ @"title": @"Share App", @"icon": @"my_share_icon", @"color": @(0xF5A623) }],
@[@{ @"title": @"Feedback", @"icon": @"my_feedback_icon", @"color": @(0xB06AFD) },
@{ @"title": @"E-mail", @"icon": @"my_email_icon", @"color": @(0xFF8A65) },
@{ @"title": @"Agreement", @"icon": @"my_agreement_icon", @"color": @(0x4CD964) },
@{ @"title": @"Privacy Policy", @"icon": @"my_privacy_icon", @"color": @(0x5AC8FA) }]
@[@{ @"title": KBLocalized(@"Notice"), @"icon": @"my_notice_icon", @"color": @(0x60A3FF) }],
@[@{ @"title": KBLocalized(@"Share App"), @"icon": @"my_share_icon", @"color": @(0xF5A623) }],
@[@{ @"title": KBLocalized(@"Feedback"), @"icon": @"my_feedback_icon", @"color": @(0xB06AFD) },
@{ @"title": KBLocalized(@"E-mail"), @"icon": @"my_email_icon", @"color": @(0xFF8A65) },
@{ @"title": KBLocalized(@"Agreement"), @"icon": @"my_agreement_icon", @"color": @(0x4CD964) },
@{ @"title": KBLocalized(@"Privacy Policy"), @"icon": @"my_privacy_icon", @"color": @(0x5AC8FA) }]
];
[self.view addSubview:self.tableView];

View File

@@ -331,7 +331,7 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
- (UIButton *)payButton {
if (!_payButton) {
_payButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_payButton setTitle:@"Recharge Now" forState:UIControlStateNormal];
[_payButton setTitle:KBLocalized(@"Recharge Now") forState:UIControlStateNormal];
[_payButton setTitleColor:[UIColor colorWithHex:KBBlackValue] forState:UIControlStateNormal];
_payButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
// 使退
@@ -350,7 +350,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
- (UILabel *)agreementLabel {
if (!_agreementLabel) {
_agreementLabel = [UILabel new];
_agreementLabel.text = @"By clicking Pay, you indicate your agreement to the"; //
_agreementLabel.text = KBLocalized(@"By clicking Pay, you indicate your agreement to the"); //
_agreementLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightRegular];
_agreementLabel.textColor = [UIColor colorWithWhite:0.45 alpha:1.0];
}
@@ -359,7 +360,7 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
- (UIButton *)agreementButton {
if (!_agreementButton) {
_agreementButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_agreementButton setTitle:@"《Embership Agreement》" forState:UIControlStateNormal];
[_agreementButton setTitle:KBLocalized(@"《Embership Agreement》") forState:UIControlStateNormal];
[_agreementButton setTitleColor:[UIColor colorWithHex:KBColorValue] forState:UIControlStateNormal];
_agreementButton.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightSemibold];

View File

@@ -265,7 +265,7 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
- (UIButton *)payButton {
if (!_payButton) {
_payButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_payButton setTitle:@"Recharge Now" forState:UIControlStateNormal];
[_payButton setTitle:KBLocalized(@"Recharge Now") forState:UIControlStateNormal];
[_payButton setTitleColor:[UIColor colorWithHex:KBBlackValue] forState:UIControlStateNormal];
_payButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
UIImage *bg = [UIImage imageNamed:@"recharge_now_icon"];