diff --git a/Scripts/verify_translations.py b/Scripts/verify_translations.py index f5ca644f1..cf06585b7 100755 --- a/Scripts/verify_translations.py +++ b/Scripts/verify_translations.py @@ -21,11 +21,12 @@ def get_translations(path): try: transpath = dir_mappings.get(path, path) transname = transpath + '/English.lproj/Localizable.strings' - transall = open(transname).read().split('\n') - transgood = [l.strip() for l in transall if len(l.strip()) and l.strip()[0] != '#'] + #transall = open(transname).read().split('\n') + #transgood = [l.strip() for l in transall if len(l.strip()) and l.strip()[0] != '#'] + transall = open(transname).read() except: - transgood = () - return transgood + transall = "" + return transall def find_missing_translations(rootdir='.', extention='', recomp=None, greylist=()): @@ -38,8 +39,7 @@ def find_missing_translations(rootdir='.', extention='', recomp=None, greylist=( continue pathname = path + '/' + filename lines = open(pathname).read().split("\n") - regex_results = [recomp.search(l) for l in lines] - values = [r.groups()[0] for r in regex_results if r] + values = [r.groups()[0] for r in [recomp.search(l) for l in lines] if r] if values: #- Get the current english translations for the path transgood = get_translations(path) @@ -50,9 +50,15 @@ def find_missing_translations(rootdir='.', extention='', recomp=None, greylist=( if DEBUG:print pathname for value in values: #- Try to find the value from the source file in the translation file - found = [line for line in transgood if value in line] + #compvalue = re.compile('"(%s)"\s=\s"(.*?)";' % value) + escaped_value = re.escape(value) + found = re.search('(%s|"%s")\s*=\s*"(.*?)";' % (escaped_value, escaped_value), transgood) + #for line in transgood: + # found = compvalue.search(line) + # if found: + # break if found: - if DEBUG: print "\t", "[%s] FOUND --" % value, found[0].split("=")[0] + if DEBUG: print "\t", '[%s] FOUND -- "%s"' % found.groups() else: notfound.append("-->\t[%s] ==== Not Found ====" % value) if notfound: @@ -73,7 +79,7 @@ def main(): greylist = ('UIxFilterEditor.wox') #- Get only the label:value from all lines - recomp = re.compile(' + label:value="The following attendees(s) were notified" const:escapeHTML="NO"/> @@ -54,7 +54,7 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon > + label:value="The following attendees(s) were added" const:escapeHTML="NO"/> @@ -67,7 +67,7 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon > + label:value="The following attendees(s) were removed" const:escapeHTML="NO"/> diff --git a/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox b/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox index ff35ff34c..743e0e3bd 100644 --- a/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox +++ b/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox @@ -312,7 +312,7 @@
- +
@@ -31,7 +31,7 @@
- +
diff --git a/UI/Templates/ContactsUI/UIxListEditor.wox b/UI/Templates/ContactsUI/UIxListEditor.wox index d82e9cc89..7f30d24cd 100644 --- a/UI/Templates/ContactsUI/UIxListEditor.wox +++ b/UI/Templates/ContactsUI/UIxListEditor.wox @@ -20,13 +20,13 @@
- +
- + - +
diff --git a/UI/Templates/MailerUI/UIxMailMainFrame.wox b/UI/Templates/MailerUI/UIxMailMainFrame.wox index 1f9af989b..86c389fc5 100644 --- a/UI/Templates/MailerUI/UIxMailMainFrame.wox +++ b/UI/Templates/MailerUI/UIxMailMainFrame.wox @@ -265,7 +265,7 @@ - + {{warning}}
@@ -81,7 +81,7 @@
@@ -97,7 +97,7 @@
diff --git a/UI/Templates/PreferencesUI/UIxAccountEditor.wox b/UI/Templates/PreferencesUI/UIxAccountEditor.wox index 37766329a..014cdd635 100644 --- a/UI/Templates/PreferencesUI/UIxAccountEditor.wox +++ b/UI/Templates/PreferencesUI/UIxAccountEditor.wox @@ -15,24 +15,24 @@ - + - + - + - + @@ -40,50 +40,50 @@ - + - + - + - + - + - + - +