Skip to content

Commit 706f841

Browse files
committed
Issue #3
1 parent 0ce7cb5 commit 706f841

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

SCStringsUtility/Readers&Writers/SCStringsWriter.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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];

SCStringsUtility/SCStringsController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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];

0 commit comments

Comments
 (0)