This commit is contained in:
2026-03-09 17:34:08 +08:00
parent c1ace5f53e
commit 0af7428353
55 changed files with 1630 additions and 665 deletions

View File

@@ -85,13 +85,16 @@
NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:date];
if (interval < 60) {
return @"刚刚";
return KBLocalized(@"Just now");
} else if (interval < 3600) {
return [NSString stringWithFormat:@"%.0f分钟前", interval / 60];
return [NSString stringWithFormat:KBLocalized(@"%.0f minutes ago"),
interval / 60];
} else if (interval < 86400) {
return [NSString stringWithFormat:@"%.0f小时前", interval / 3600];
return [NSString stringWithFormat:KBLocalized(@"%.0f hours ago"),
interval / 3600];
} else if (interval < 86400 * 30) {
return [NSString stringWithFormat:@"%.0f天前", interval / 86400];
return [NSString stringWithFormat:KBLocalized(@"%.0f days ago"),
interval / 86400];
} else {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"MM-dd";

View File

@@ -68,13 +68,16 @@
NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:date];
if (interval < 60) {
return @"刚刚";
return KBLocalized(@"Just now");
} else if (interval < 3600) {
return [NSString stringWithFormat:@"%.0f分钟前", interval / 60];
return [NSString stringWithFormat:KBLocalized(@"%.0f minutes ago"),
interval / 60];
} else if (interval < 86400) {
return [NSString stringWithFormat:@"%.0f小时前", interval / 3600];
return [NSString stringWithFormat:KBLocalized(@"%.0f hours ago"),
interval / 3600];
} else if (interval < 86400 * 30) {
return [NSString stringWithFormat:@"%.0f天前", interval / 86400];
return [NSString stringWithFormat:KBLocalized(@"%.0f days ago"),
interval / 86400];
} else {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"MM-dd";
@@ -95,7 +98,8 @@
// "回复 @xxx"
NSMutableString *userNameText = [NSMutableString stringWithString:self.userName ?: @""];
if (self.replyToUserName.length > 0) {
[userNameText appendFormat:@" 回复 @%@", self.replyToUserName];
[userNameText appendFormat:@" %@ @%@", KBLocalized(@"Reply"),
self.replyToUserName];
}
UIFont *userNameFont = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
CGRect userNameRect = [userNameText boundingRectWithSize:CGSizeMake(contentWidth, CGFLOAT_MAX)