Skip to content

Commit 9868617

Browse files
committed
部分文案/图标国际化
1 parent c0c266b commit 9868617

File tree

8 files changed

+36
-2
lines changed

8 files changed

+36
-2
lines changed

TZImagePickerController/TZImagePickerController/TZAssetCell.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,8 @@ typedef enum : NSUInteger {
5454
@interface TZAssetCameraCell : UICollectionViewCell
5555
@property (nonatomic, strong) UIImageView *imageView;
5656
@end
57+
58+
59+
@interface TZAssetAddMoreCell : TZAssetCameraCell
60+
@property (nonatomic, strong) UILabel *tipLabel;
61+
@end

TZImagePickerController/TZImagePickerController/TZAssetCell.m

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,3 +519,30 @@ - (void)layoutSubviews {
519519
}
520520

521521
@end
522+
523+
524+
@implementation TZAssetAddMoreCell
525+
526+
- (instancetype)initWithFrame:(CGRect)frame {
527+
self = [super initWithFrame:frame];
528+
if (self) {
529+
_tipLabel = [[UILabel alloc] init];
530+
_tipLabel.numberOfLines = 2;
531+
_tipLabel.textAlignment = NSTextAlignmentCenter;
532+
_tipLabel.font = [UIFont systemFontOfSize:12];
533+
_tipLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
534+
CGFloat rgb = 156 / 255.0;
535+
_tipLabel.textColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:1.0];
536+
[self.contentView addSubview:_tipLabel];
537+
538+
self.clipsToBounds = YES;
539+
}
540+
return self;
541+
}
542+
543+
- (void)layoutSubviews {
544+
[super layoutSubviews];
545+
_tipLabel.frame = CGRectMake(5, self.tz_centerY, self.tz_width - 10, self.tz_height / 2 - 5);
546+
}
547+
548+
@end

TZImagePickerController/TZImagePickerController/TZAuthLimitedFooterTipView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ - (UILabel *)tipLable {
6767
if (!_tipLable) {
6868
_tipLable = [[UILabel alloc] init];
6969
NSString *appName = [TZCommonTools tz_getAppName];
70-
_tipLable.text = [NSString stringWithFormat:@"你已设置%@只能访问相册部分照片,建议允许访问「所有照片」",appName];
70+
_tipLable.text = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Allow %@ to access your all photos"], appName];
7171
_tipLable.numberOfLines = 0;
7272
_tipLable.font = [UIFont systemFontOfSize:14];
7373
_tipLable.textColor = [UIColor colorWithRed:0.40 green:0.40 blue:0.40 alpha:1.0];

TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ - (void)configCollectionView {
191191
[self.view addSubview:_collectionView];
192192
[_collectionView registerClass:[TZAssetCell class] forCellWithReuseIdentifier:@"TZAssetCell"];
193193
[_collectionView registerClass:[TZAssetCameraCell class] forCellWithReuseIdentifier:@"TZAssetCameraCell"];
194+
[_collectionView registerClass:[TZAssetAddMoreCell class] forCellWithReuseIdentifier:@"TZAssetAddMoreCell"];
194195
} else {
195196
[_collectionView reloadData];
196197
}
@@ -576,8 +577,9 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
576577
TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
577578
// the cell lead to add more photo / 去添加更多照片的cell
578579
if (indexPath.item == [self getAddMorePhotoCellIndex]) {
579-
TZAssetCameraCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZAssetCameraCell" forIndexPath:indexPath];
580+
TZAssetAddMoreCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZAssetAddMoreCell" forIndexPath:indexPath];
580581
cell.imageView.image = tzImagePickerVc.addMorePhotoImage;
582+
cell.tipLabel.text = [NSBundle tz_localizedStringForKey:@"Add more accessible photos"];
581583
cell.imageView.contentMode = UIViewContentModeScaleAspectFit;
582584
cell.imageView.backgroundColor = [UIColor colorWithWhite:1.000 alpha:0.500];
583585
return cell;

0 commit comments

Comments
 (0)