@@ -0,0 +1,1539 @@
+#!/usr/bin/python%0A# Copyright (c) 2011 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0A%22%22%22Verifies that the message tags in the 2nd and subsequent JSON message files%0Amatch those specified in the first.  This is typically run when the%0Atranslations are updated before a release, to check that nothing got missed.%0A%22%22%22%0A%0Aimport json%0Aimport sys%0Aimport string%0A%0Adef CheckTranslation(filename, translation, messages):%0A  %22%22%22Check %7Cmessages%7C for missing Ids in %7Ctranslation%7C, and similarly for unused%0A     Ids.  If there are missing/unused Ids then report them and return failure.%0A  %22%22%22%0A  message_tags = set(map(string.lower, messages.keys()))%0A  translation_tags = set(map(string.lower, translation.keys()))%0A  if message_tags == translation_tags:%0A    return True%0A%0A  undefined_tags = message_tags - translation_tags%0A  if undefined_tags:%0A    print '%25s: Missing: %25s' %25 (filename, %22, %22.join(undefined_tags))%0A%0A  unused_tags = translation_tags - message_tags%0A  if unused_tags:%0A    print '%25s: Unused: %25s' %25 (filename, %22, %22.join(unused_tags))%0A%0A  return False%0A%0Adef main():%0A  if len(sys.argv) %3C 3:%0A    print 'Usage: verify-translations.py %3Cmessages%3E %3Ctranslation-files...%3E'%0A    sys.exit(1)%0A%0A  en_messages = json.load(open(sys.argv%5B1%5D, 'r'))%0A  exit_code = 0%0A  for f in sys.argv%5B2:%5D:%0A    translation = json.load(open(f, 'r'))%0A    if not CheckTranslation(f, translation, en_messages):%0A      exit_code = 1%0A%0A  sys.exit(exit_code)%0A%0Aif __name__ == '__main__':%0A  main()%0A

Add verify-translations.py script.