Tôi đang sử dụng functionnality iOS mới dịch cốt truyện (http://developer.apple.com/library/ios/#referencelibrary/GettingStarted/RoadMapiOS/chapters/InternationalizeYourApp/InternationalizeYourApp/InternationalizeYourApp.html)iOS Storyboard chuỗi bản địa hóa không làm việc trên UILabel lớp con
Vấn đề với giải pháp này, nó không làm việc với các lớp con UILabel tôi.
Dưới đây là các mã cho lớp con UILabel tôi:
.h:
#import <UIKit/UIKit.h>
@interface LabelThinText : UILabel
- (void)awakeFromNib;
-(id)initWithFrame:(CGRect)frame;
@end
.m:
@implementation LabelThinText
- (void)awakeFromNib
{
[super awakeFromNib];
[self setFont:[UIFont fontWithName:@"Raleway-Light" size:[[self font] pointSize]]];
}
-(id)initWithFrame:(CGRect)frame
{
id result = [super initWithFrame:frame];
if (result) {
[self setFont:[UIFont fontWithName:@"Raleway-Light" size:[[self font] pointSize]]];
}
return result;
}
@end
Tôi đoán tôi đang thiếu một cái gì đó để có được những bản dịch tự động từ tệp Storyboard.strings của tôi.
Có ai có ý tưởng không?
Cảm ơn!
Bạn có thể tải xuống dự án thử nghiệm của mình: https://github.com/arn00s/iOS_BaseLocalization Chỉ cần chuyển đổi thiết bị lang từ EN sang FR và bạn sẽ thấy sự khác biệt. –