From b3d5ead376fe3eec8a624bc703e392b93ebdbe57 Mon Sep 17 00:00:00 2001 From: Jeremy Lawrence Date: Mon, 21 Apr 2014 15:37:54 -0700 Subject: [PATCH] Allow comments following strings in .strings files Same-line comments now no longer prevent strings from being indexed --- Lin/LNLocalizationCollection.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lin/LNLocalizationCollection.m b/Lin/LNLocalizationCollection.m index 2c786d5..36c60d0 100644 --- a/Lin/LNLocalizationCollection.m +++ b/Lin/LNLocalizationCollection.m @@ -101,7 +101,7 @@ - (void)reloadLocalizations __block NSRange keyRange; __block NSRange valueRange; - NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:@"(\"(\\S+.*\\S+)\"|(\\S+.*\\S+))\\s*=\\s*\"(.*)\";$" + NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:@"(\"(\\S+.*\\S+)\"|(\\S+.*\\S+))\\s*=\\s*\"(.*)\";(.*)$" options:0 error:NULL]; @@ -115,7 +115,7 @@ - (void)reloadLocalizations options:0 range:NSMakeRange(0, line.length)]; - if (result.range.location != NSNotFound && result.numberOfRanges == 5) { + if (result.range.location != NSNotFound && result.numberOfRanges >= 5) { entityRange = [result rangeAtIndex:0]; entityRange.location += lineOffset;