From 8ae94b17a1d9e51907183c1216e2eebe22d2c2f7 Mon Sep 17 00:00:00 2001 From: Shai Mishali Date: Wed, 8 Mar 2017 18:50:14 -0500 Subject: [PATCH] Allow localizing Double-quoted strings The previous regular expression doesn't support strings such as "Please tap \"Allow\" to continue". --- genstrings.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/genstrings.swift b/genstrings.swift index 10430c2..ffd77fc 100755 --- a/genstrings.swift +++ b/genstrings.swift @@ -11,7 +11,7 @@ class GenStrings { let excludedFileNames = ["genstrings.swift"] var regularExpresions = [String:NSRegularExpression]() - let localizedRegex = "(?<=\")([^\"]*)(?=\".(localized|localizedFormat))|(?<=(Localized|NSLocalizedString)\\(\")([^\"]*?)(?=\")" + let localizedRegex = "(?<=\")(.*?)(?=\".(localized|localizedFormat))|(?<=(Localized|NSLocalizedString)\\(\")([^\"]*?)(?=\")" enum GenstringsError: Error { case Error @@ -122,4 +122,4 @@ if CommandLine.arguments.count > 1 { genStrings.perform(path: path) } else { genStrings.perform() -} \ No newline at end of file +}