| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """This script generates an rc file and header (setup_strings.{rc,h}) to be | 6 """This script generates an rc file and header (setup_strings.{rc,h}) to be |
| 7 included in setup.exe. The rc file includes translations for strings pulled | 7 included in setup.exe. The rc file includes translations for strings pulled |
| 8 from generated_resource.grd and the localized .xtb files. | 8 from generated_resource.grd and the localized .xtb files. |
| 9 | 9 |
| 10 The header file includes IDs for each string, but also has values to allow | 10 The header file includes IDs for each string, but also has values to allow |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 'IDS_INSTALL_INVALID_ARCHIVE', | 62 'IDS_INSTALL_INVALID_ARCHIVE', |
| 63 'IDS_INSTALL_INSUFFICIENT_RIGHTS', | 63 'IDS_INSTALL_INSUFFICIENT_RIGHTS', |
| 64 'IDS_INSTALL_NO_PRODUCTS_TO_UPDATE', | 64 'IDS_INSTALL_NO_PRODUCTS_TO_UPDATE', |
| 65 'IDS_UNINSTALL_FAILED', | 65 'IDS_UNINSTALL_FAILED', |
| 66 'IDS_UNINSTALL_COMPLETE', | 66 'IDS_UNINSTALL_COMPLETE', |
| 67 'IDS_INSTALL_DIR_IN_USE', | 67 'IDS_INSTALL_DIR_IN_USE', |
| 68 'IDS_INSTALL_NON_MULTI_INSTALLATION_EXISTS', | 68 'IDS_INSTALL_NON_MULTI_INSTALLATION_EXISTS', |
| 69 'IDS_INSTALL_MULTI_INSTALLATION_EXISTS', | 69 'IDS_INSTALL_MULTI_INSTALLATION_EXISTS', |
| 70 'IDS_INSTALL_CONFLICTING_CHANNEL_EXISTS', | 70 'IDS_INSTALL_CONFLICTING_CHANNEL_EXISTS', |
| 71 'IDS_INSTALL_READY_MODE_REQUIRES_CHROME', | 71 'IDS_INSTALL_READY_MODE_REQUIRES_CHROME', |
| 72 'IDS_INSTALL_INCONSISTENT_UPDATE_POLICY', |
| 72 'IDS_OEM_MAIN_SHORTCUT_NAME', | 73 'IDS_OEM_MAIN_SHORTCUT_NAME', |
| 73 'IDS_SHORTCUT_TOOLTIP', | 74 'IDS_SHORTCUT_TOOLTIP', |
| 74 ] | 75 ] |
| 75 | 76 |
| 76 # The ID of the first resource string. | 77 # The ID of the first resource string. |
| 77 kFirstResourceID = 1600 | 78 kFirstResourceID = 1600 |
| 78 | 79 |
| 79 class TranslationStruct: | 80 class TranslationStruct: |
| 80 """A helper struct that holds information about a single translation.""" | 81 """A helper struct that holds information about a single translation.""" |
| 81 def __init__(self, resource_id_str, language, translation): | 82 def __init__(self, resource_id_str, language, translation): |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 kFilebase = os.path.join(argv[1], 'installer_util_strings') | 228 kFilebase = os.path.join(argv[1], 'installer_util_strings') |
| 228 WriteRCFile(translated_strings, kFilebase) | 229 WriteRCFile(translated_strings, kFilebase) |
| 229 WriteHeaderFile(translated_strings, kFilebase) | 230 WriteHeaderFile(translated_strings, kFilebase) |
| 230 | 231 |
| 231 if '__main__' == __name__: | 232 if '__main__' == __name__: |
| 232 if len(sys.argv) < 2: | 233 if len(sys.argv) < 2: |
| 233 print 'Usage:\n %s <output_directory> [branding]' % sys.argv[0] | 234 print 'Usage:\n %s <output_directory> [branding]' % sys.argv[0] |
| 234 sys.exit(1) | 235 sys.exit(1) |
| 235 # Use optparse to parse command line flags. | 236 # Use optparse to parse command line flags. |
| 236 main(sys.argv) | 237 main(sys.argv) |
| OLD | NEW |