make_locale_dirs.py 770 B

12345678910111213141516171819202122232425262728
  1. # usage: make_locale_dirs.py locale_dir [...]
  2. #
  3. # This script is intended to create empty locale directories (.lproj) in a
  4. # Cocoa .app bundle. The presence of these empty directories is sufficient to
  5. # convince Cocoa that the application supports the named localization, even if
  6. # an InfoPlist.strings file is not provided. Chrome uses these empty locale
  7. # directories for its helper executable bundles, which do not otherwise
  8. # require any direct Cocoa locale support.
  9. import os
  10. import errno
  11. import sys
  12. def main(args):
  13. for dirname in args:
  14. try:
  15. os.makedirs(dirname)
  16. except OSError as e:
  17. if e.errno == errno.EEXIST:
  18. # It's OK if it already exists
  19. pass
  20. else:
  21. raise
  22. if __name__ == '__main__':
  23. main(sys.argv[1:])