diff options
Diffstat (limited to 'Tools/Scripts/check-inspector-strings')
-rwxr-xr-x | Tools/Scripts/check-inspector-strings | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Tools/Scripts/check-inspector-strings b/Tools/Scripts/check-inspector-strings index 82c08d7..0350aca 100755 --- a/Tools/Scripts/check-inspector-strings +++ b/Tools/Scripts/check-inspector-strings @@ -54,6 +54,9 @@ class StringsExtractor(ProcessorBase): def should_process(self, file_path): return file_path.endswith(".js") and (not file_path.endswith("InjectedScript.js")) + def decode_unicode_escapes(self, s): + return eval("ur\"" + s + "\"") + def process(self, lines, file_path, line_numbers=None): for line in lines: comment_start = line.find("//") @@ -63,7 +66,7 @@ class StringsExtractor(ProcessorBase): for pattern in self._patterns: line_strings = re.findall(pattern, line) for string in line_strings: - self.strings[index].append(string) + self.strings[index].append(self.decode_unicode_escapes(string)) index += 1 class LocalizedStringsExtractor: @@ -113,3 +116,10 @@ if __name__ == "__main__": unused_strings = old_strings - strings for s in unused_strings: _log.info("Unused: \"%s\"" % (s)) + + localized_strings_duplicates = {} + for s in localized_strings_extractor.localized_strings: + if s in localized_strings_duplicates: + _log.info("Duplicate: \"%s\"" % (s)) + else: + localized_strings_duplicates.setdefault(s) |