Skip to content

Commit 27a4b89

Browse files
fixed bundle management
1 parent c03fc7f commit 27a4b89

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

R.objc/Sources/ImagesGenerator.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ - (BOOL)writeInResourceFileWithError:(NSError *__autoreleasing *)error
133133
[self.clazz.extension.properties addObject:property];
134134

135135
// generate getter implementation
136-
NSString* implString = [NSString stringWithFormat:@"return [UIImage imageNamed:@\"%@\"];", res.originalName];
136+
NSString* implString = [NSString stringWithFormat:@"return [UIImage imageNamed:@\"%@\" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];", res.originalName];
137137
RMethodImplementation *impl = [[RMethodImplementation alloc] initWithReturnType:@"UIImage*" signature:res.methodName implementation:implString];
138138
[self.clazz.implementation.methods addObject:impl];
139139
}

R.objc/Sources/StringsGenerator.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,10 @@ - (NSString*) localizedStringWithKey:(NSString*)key fromTable:(NSString*)table
317317
{
318318
if (Session.shared.isSysdataVersion)
319319
{
320-
return [NSString stringWithFormat:@"SDLocalizedStringFromTable(@\"%@\", @\"%@\")", key, table];
320+
return [NSString stringWithFormat:@"SDLocalizedStringFromTableInBundleForClass(@\"%@\", @\"%@\", self.class)", key, table];
321321
} else {
322322
table = [table stringByReplacingOccurrencesOfString:@".strings" withString:@""];
323-
return [NSString stringWithFormat:@"NSLocalizedStringFromTable(@\"%@\", @\"%@\", nil)", key, table];
323+
return [NSString stringWithFormat:@"NSLocalizedStringFromTableInBundle(@\"%@\", @\"%@\", [NSBundle bundleForClass:self.class], nil)", key, table];
324324
}
325325
}
326326

0 commit comments

Comments
 (0)