File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,8 @@ - (void)writeTranslations:(NSDictionary*)translations toPath:(NSString*)path fai
103103 self.fileHandlers = [NSMutableDictionary dictionary ];
104104
105105 NSError *error;
106- for (NSString *x in self.headers )
107- {
108- NSString *languageIdentifier = [NSLocale canonicalLanguageIdentifierFromString: x];
109-
106+ for (NSString *languageIdentifier in self.headers )
107+ {
110108 NSString *lprojPath = [path stringByAppendingPathComponent: [NSString stringWithFormat: @" %@ .lproj" , languageIdentifier]];
111109 [[NSFileManager defaultManager ] createDirectoryAtPath: lprojPath withIntermediateDirectories: YES attributes: nil error: &error];
112110 if (error) {
@@ -120,7 +118,7 @@ - (void)writeTranslations:(NSDictionary*)translations toPath:(NSString*)path fai
120118 NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath: stringsPath];
121119 if (fileHandle == nil ) SCLog (@" Unable to open file for writing at path %@ " , stringsPath);
122120
123- [self .fileHandlers setObject: @{kKeyFileHandle : fileHandle, kKeyEncoding : @(NSUTF8StringEncoding)} forKey: x ];
121+ [self .fileHandlers setObject: @{kKeyFileHandle : fileHandle, kKeyEncoding : @(NSUTF8StringEncoding)} forKey: languageIdentifier ];
124122 }
125123
126124 [self writeTranslations: translations failure: failure];
Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ - (void)importProjectAtPath:(NSString *)path
201201
202202 for (XCSourceFile *file in files)
203203 {
204- NSString *language = [[NSLocale currentLocale ] displayNameForKey: NSLocaleLanguageCode value: [[[ file.name stringByDeletingLastPathComponent ] lastPathComponent ] stringByDeletingPathExtension ] ];
204+ NSString *language = [[[ file.name stringByDeletingLastPathComponent ] lastPathComponent ] stringByDeletingPathExtension ];
205205 if (!language) continue ;
206206
207207 XCGroup *parentGroup = [[self .project groupForGroupMemberWithKey: file.key] parentGroup ];
You can’t perform that action at this time.
0 commit comments