Skip to content

Commit

Permalink
Issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Mar 24, 2013
1 parent 0ce7cb5 commit 706f841
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions SCStringsUtility/Readers&Writers/SCStringsWriter.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,8 @@ - (void)writeTranslations:(NSDictionary*)translations toPath:(NSString*)path fai
self.fileHandlers = [NSMutableDictionary dictionary];

NSError *error;
for(NSString *x in self.headers)
{
NSString *languageIdentifier = [NSLocale canonicalLanguageIdentifierFromString:x];

for(NSString *languageIdentifier in self.headers)
{
NSString *lprojPath = [path stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.lproj", languageIdentifier]];
[[NSFileManager defaultManager] createDirectoryAtPath:lprojPath withIntermediateDirectories:YES attributes:nil error:&error];
if(error) {
Expand All @@ -120,7 +118,7 @@ - (void)writeTranslations:(NSDictionary*)translations toPath:(NSString*)path fai
NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:stringsPath];
if(fileHandle == nil) SCLog(@"Unable to open file for writing at path %@", stringsPath);

[self.fileHandlers setObject:@{kKeyFileHandle : fileHandle, kKeyEncoding : @(NSUTF8StringEncoding)} forKey:x];
[self.fileHandlers setObject:@{kKeyFileHandle : fileHandle, kKeyEncoding : @(NSUTF8StringEncoding)} forKey:languageIdentifier];
}

[self writeTranslations:translations failure:failure];
Expand Down
2 changes: 1 addition & 1 deletion SCStringsUtility/SCStringsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ - (void)importProjectAtPath:(NSString *)path

for(XCSourceFile *file in files)
{
NSString *language = [[NSLocale currentLocale] displayNameForKey:NSLocaleLanguageCode value:[[[file.name stringByDeletingLastPathComponent] lastPathComponent] stringByDeletingPathExtension]];
NSString *language = [[[file.name stringByDeletingLastPathComponent] lastPathComponent] stringByDeletingPathExtension];
if(!language) continue;

XCGroup *parentGroup = [[self.project groupForGroupMemberWithKey:file.key] parentGroup];
Expand Down

0 comments on commit 706f841

Please sign in to comment.