Skip to content

Commit

Permalink
support .strings file
Browse files Browse the repository at this point in the history
  • Loading branch information
tomatoeggs committed May 11, 2017
1 parent 6ccbaef commit 52dcccc
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions LSUnusedResources/Model/ResourceStringSearcher.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
NSString * const kNotificationResourceStringQueryDone = @"kNotificationResourceStringQueryDone";

typedef NS_ENUM(NSUInteger, LSFileType) {
LSFileTypeNone = 0,
LSFileTypeH = 1,
LSFileTypeObjC = 2,
LSFileTypeC = 3,
LSFileTypeSwift = 4,
LSFileTypeHtml = 5,
LSFileTypeCSS = 6,
LSFileTypeXib = 7,
LSFileTypePlist = 8,
LSFileTypeJson = 9,
LSFileTypeJs = 10
LSFileTypeNone = 0,
LSFileTypeH = 1,
LSFileTypeObjC = 2,
LSFileTypeC = 3,
LSFileTypeSwift = 4,
LSFileTypeHtml = 5,
LSFileTypeCSS = 6,
LSFileTypeXib = 7,
LSFileTypePlist = 8,
LSFileTypeJson = 9,
LSFileTypeJs = 10,
LSFileTypeStings = 11
};


Expand Down Expand Up @@ -219,6 +220,10 @@ - (void)parseFileAtPath:(NSString *)path withType:(LSFileType)fileType {
pattern = [NSString stringWithFormat:@"([a-zA-Z0-9_-]+)\\.(%@)", self.resSuffixs.count ? [self.resSuffixs componentsJoinedByString:@"|"] : @"png|gif|jpg|jpeg"]; //*.(png|gif|jpg|jpeg)
groupIndex = 1;
break;
case LSFileTypeStings:
pattern = @"=\\s*\"(.+)\"\\s*;";
groupIndex = 1;
break;
default:
break;
}
Expand Down Expand Up @@ -287,6 +292,9 @@ - (LSFileType)fileTypeByName:(NSString *)name {
if ([ext isEqualTo:@"css"]) {
return LSFileTypeCSS;
}
if ([ext isEqualTo:@"strings"]) {
return LSFileTypeStings;
}

return LSFileTypeNone;
}
Expand Down

0 comments on commit 52dcccc

Please sign in to comment.