- Plugs the Total duration text to macOS's localization technology - Adds a proper Spanish translation - Adapts certain dialogs to make them more suitable for translation Signed-off-by: Kevin López Brante <kevin@kddlb.cl>
33 lines
690 B
Objective-C
33 lines
690 B
Objective-C
//
|
|
// TotalTimeTransformer.m
|
|
// Cog
|
|
//
|
|
// Created by Christopher Snowhill on 6/15/22.
|
|
//
|
|
|
|
#import "TotalTimeTransformer.h"
|
|
|
|
@implementation TotalTimeTransformer
|
|
|
|
+ (Class)transformedValueClass {
|
|
return [NSString class];
|
|
}
|
|
+ (BOOL)allowsReverseTransformation {
|
|
return NO;
|
|
}
|
|
|
|
- (id)transformedValue:(id)value {
|
|
if(value == nil) return @"";
|
|
|
|
if([value isKindOfClass:[NSString class]]) {
|
|
NSString *string = (NSString *)value;
|
|
if([string length] > 0) {
|
|
//return [@"Total Duration: " stringByAppendingString:string];
|
|
return [NSString localizedStringWithFormat:NSLocalizedString(@"Total duration: %@", @"Total duration for status"), string];
|
|
}
|
|
}
|
|
|
|
return @"";
|
|
}
|
|
|
|
@end
|