Skip to content
Browse files

Support for Internationalization

  • Loading branch information...
1 parent cedd121 commit b8f73eb6646b93ed0d8a9db7b52a052d75ea296e @yimajo yimajo committed Aug 18, 2012
View
1 src/TapkuLibrary/NSDate+TKCategory.h
@@ -79,6 +79,7 @@ typedef struct TKDateInformation TKDateInformation;
- (NSDate *) dateByAddingDays:(NSUInteger)days;
+ (NSDate *) dateWithDatePart:(NSDate *)aDate andTimePart:(NSDate *)aTime;
+- (NSString *) monthYearString;
- (NSString *) monthString;
- (NSString *) yearString;
View
7 src/TapkuLibrary/NSDate+TKCategory.m
@@ -120,6 +120,13 @@ + (NSDate *) dateWithDatePart:(NSDate *)aDate andTimePart:(NSDate *)aTime {
}
+- (NSString *) monthYearString {
+ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
+ dateFormatter.dateFormat = [NSDateFormatter dateFormatFromTemplate:@"yMMMM"
+ options:0
+ locale:[NSLocale currentLocale]];
+ return [dateFormatter stringFromDate:self];
+}
- (NSString*) monthString{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
View
6 src/TapkuLibrary/TKCalendarMonthView.m
@@ -663,7 +663,7 @@ - (id) initWithSundayAsFirst:(BOOL)s{
[self addSubview:self.tileBox];
NSDate *date = [NSDate date];
- self.monthYear.text = [NSString stringWithFormat:@"%@ %@",[date monthString],[date yearString]];
+ self.monthYear.text = [date monthYearString];
[self addSubview:self.monthYear];
@@ -820,7 +820,7 @@ - (void) changeMonthAnimation:(UIView*)sender{
- monthYear.text = [NSString stringWithFormat:@"%@ %@",[localNextMonth monthString],[localNextMonth yearString]];
+ monthYear.text = [localNextMonth monthYearString];
@@ -884,7 +884,7 @@ - (void) selectDate:(NSDate*)date{
self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.bounds.size.width, self.tileBox.frame.size.height+self.tileBox.frame.origin.y);
self.shadow.frame = CGRectMake(0, self.frame.size.height-self.shadow.frame.size.height+21, self.shadow.frame.size.width, self.shadow.frame.size.height);
- self.monthYear.text = [NSString stringWithFormat:@"%@ %@",[date monthString],[date yearString]];
+ self.monthYear.text = [date monthYearString];
[currentTile selectDay:info.day];
if([self.delegate respondsToSelector:@selector(calendarMonthView:monthDidChange:animated:)])

0 comments on commit b8f73eb

Please sign in to comment.
Something went wrong with that request. Please try again.