From 13421281fdc848e73f34d57352b7b6b6608a249f Mon Sep 17 00:00:00 2001 From: Orlando Aleman Ortiz Date: Tue, 29 Apr 2014 19:02:04 +0100 Subject: [PATCH 1/3] Lines of Localizable.strings ending with #ignore will be ignored --- objc_strings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/objc_strings.py b/objc_strings.py index d53b9d6..632458f 100755 --- a/objc_strings.py +++ b/objc_strings.py @@ -46,13 +46,13 @@ def language_code_in_strings_path(p): return None def key_in_string(s): - m = re.search("(?u)^\"(.*?)\"\s*=", s) + m = re.search("(?u)^\"(.*?)\"\s*=.*\";(? Date: Wed, 30 Apr 2014 00:01:31 +0100 Subject: [PATCH 2/3] Lines ending with //#ignore will be ignored --- README.md | 3 ++- objc_strings.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 26694b3..5de4194 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ Path of an Objective-C project. #### Output 1. warnings for untranslated strings in *.m -2. warnings for unused keys in Localization.strings +2. warnings for unused keys in Localization.strings (except lines ending with //#ignore) +) 3. errors for keys defined twice or more in the same .strings file #### Typical usage diff --git a/objc_strings.py b/objc_strings.py index 632458f..4287c3e 100755 --- a/objc_strings.py +++ b/objc_strings.py @@ -46,7 +46,11 @@ def language_code_in_strings_path(p): return None def key_in_string(s): - m = re.search("(?u)^\"(.*?)\"\s*=.*\";(? Date: Wed, 30 Apr 2014 00:26:12 +0100 Subject: [PATCH 3/3] FIX --- objc_strings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/objc_strings.py b/objc_strings.py index 4287c3e..5cb7e6f 100755 --- a/objc_strings.py +++ b/objc_strings.py @@ -56,7 +56,7 @@ def key_in_string(s): key = m.group(1) - if key.startswith("//") or key.startswith("/*") or key.startswith("#"): + if key.startswith("//") or key.startswith("/*"): return None return key