Skip to content

Commit 94bb1ae

Browse files
committed
Small tweaks following pull request.
1 parent 4eb7def commit 94bb1ae

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

SCStringsUtility/SCStringsController.m

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,10 @@ - (void)importProjectAtPath:(NSString *)path
195195
self.sourceFilePath = nil;
196196
self.sourceType = SCFileTypeXcodeProject;
197197

198-
NSString *stringsFileNamesWithoutExtension = nil;
199-
200-
if (![stringsFileName length]) {
198+
if (stringsFileName.length == 0) {
201199
stringsFileName = kKeyStringsFile;
202-
stringsFileNamesWithoutExtension = kKeyLocalizable;
203-
} else {
204-
stringsFileNamesWithoutExtension = [stringsFileName stringByDeletingPathExtension];
200+
} else if(stringsFileName.pathExtension.length == 0) {
201+
stringsFileName = [stringsFileName stringByAppendingPathExtension:kKeyStringsFile.pathExtension];
205202
}
206203

207204
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
@@ -216,7 +213,7 @@ - (void)importProjectAtPath:(NSString *)path
216213

217214
XCGroup *parentGroup = [[self.project groupForGroupMemberWithKey:file.key] parentGroup];
218215

219-
NSString *categoryName = [[parentGroup displayName] stringByAppendingPathComponent:stringsFileNamesWithoutExtension];
216+
NSString *categoryName = [[parentGroup displayName] stringByAppendingPathComponent:[stringsFileName stringByDeletingPathExtension]];
220217
if(![self.translationFiles objectForKey:categoryName])
221218
[self.translationFiles setObject:[NSMutableArray array] forKey:categoryName];
222219

SCStringsUtility/Views/SCOpenAccessoryView.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ - (BOOL)shouldAddPositionalParameters
2929

3030
- (NSString*)stringsFileName
3131
{
32-
return self.stringsFileNameTextField.stringValue;
32+
NSString *fileName = self.stringsFileNameTextField.stringValue;
33+
return fileName.length > 0 ? fileName : nil;
3334
}
3435

3536
@end

SCStringsUtility/Views/SCOpenAccessoryView.xib

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4510" systemVersion="12F45" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
33
<dependencies>
44
<deployment defaultVersion="1070" identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4510"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
66
</dependencies>
77
<objects>
88
<customObject id="-2" userLabel="File's Owner"/>
@@ -32,7 +32,7 @@
3232
<textField verticalHuggingPriority="750" id="4">
3333
<rect key="frame" x="153" y="73" width="130" height="23"/>
3434
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
35-
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="NSLocalizedString" drawsBackground="YES" id="7">
35+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="NSLocalizedString" id="7">
3636
<font key="font" metaFont="system"/>
3737
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
3838
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -50,7 +50,7 @@
5050
<textField verticalHuggingPriority="750" id="E5J-6M-s8a">
5151
<rect key="frame" x="153" y="42" width="130" height="23"/>
5252
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
53-
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" title="Localizable.strings" placeholderString="" drawsBackground="YES" id="jMf-vs-BIr">
53+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Localizable.strings" id="jMf-vs-BIr">
5454
<font key="font" metaFont="system"/>
5555
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
5656
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -63,5 +63,6 @@
6363
<outlet property="stringsFileNameTextField" destination="E5J-6M-s8a" id="FzA-sa-2bV"/>
6464
</connections>
6565
</customView>
66+
<userDefaultsController representsSharedInstance="YES" id="ftN-hl-wcm"/>
6667
</objects>
6768
</document>

0 commit comments

Comments
 (0)