@@ -187,16 +187,26 @@ - (void)importCSVFileAtPath:(NSString *)path success:(void (^)(void))success fai
187187- (void )importProjectAtPath : (NSString *)path
188188 positionalParameters : (BOOL )includePositionalParameters
189189 genstringsRoutine : (NSString *)genstringsRoutine
190+ stringsFileName : (NSString *)stringsFileName
190191 success : (void (^)(void ))success
191192 failure : (void (^)(NSError *))failure
192193{
193194 self.project = [[XCProject alloc ] initWithFilePath: path];
194195 self.sourceFilePath = nil ;
195196 self.sourceType = SCFileTypeXcodeProject;
196197
198+ NSString *stringsFileNamesWithoutExtension = nil ;
199+
200+ if (![stringsFileName length ]) {
201+ stringsFileName = kKeyStringsFile ;
202+ stringsFileNamesWithoutExtension = kKeyLocalizable ;
203+ } else {
204+ stringsFileNamesWithoutExtension = [stringsFileName stringByDeletingPathExtension ];
205+ }
206+
197207 dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0 ), ^{
198208 NSArray *files = [self .project.files filteredArrayUsingPredicate: [NSPredicate predicateWithBlock: ^BOOL (XCSourceFile *evaluatedObject, NSDictionary *bindings) {
199- return [[evaluatedObject.name lastPathComponent ] isEqualToString: kKeyStringsFile ];
209+ return [[evaluatedObject.name lastPathComponent ] isEqualToString: stringsFileName ];
200210 }]];
201211
202212 for (XCSourceFile *file in files)
@@ -206,7 +216,7 @@ - (void)importProjectAtPath:(NSString *)path
206216
207217 XCGroup *parentGroup = [[self .project groupForGroupMemberWithKey: file.key] parentGroup ];
208218
209- NSString *categoryName = [[parentGroup displayName ] stringByAppendingPathComponent: kKeyLocalizable ];
219+ NSString *categoryName = [[parentGroup displayName ] stringByAppendingPathComponent: stringsFileNamesWithoutExtension ];
210220 if (![self .translationFiles objectForKey: categoryName])
211221 [self .translationFiles setObject: [NSMutableArray array ] forKey: categoryName];
212222
@@ -218,7 +228,7 @@ - (void)importProjectAtPath:(NSString *)path
218228 }
219229
220230 [self executeGenStringsAtPath: [self .project.filePath stringByDeletingLastPathComponent ] withRoutine: genstringsRoutine positionalParameters: includePositionalParameters];
221- SCReader *genstringsOutputReader = [[SCReader alloc ] initWithPath: [NSTemporaryDirectory () stringByAppendingPathComponent: kKeyStringsFile ]];
231+ SCReader *genstringsOutputReader = [[SCReader alloc ] initWithPath: [NSTemporaryDirectory () stringByAppendingPathComponent: stringsFileName ]];
222232 NSString *comment, *key, *translation;
223233 while ([genstringsOutputReader getNextComment: &comment key: &key translation: &translation]) {
224234 [self .translationsDictionary setObject: [NSMutableDictionary dictionaryWithObject: comment forKey: kKeyComment ] forKey: key];
0 commit comments