OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright 2009 Google Inc. All rights reserved. | 2 # Copyright 2009 Google Inc. All rights reserved. |
3 | 3 |
4 """This script generates an rc file and header (setup_strings.{rc,h}) to be | 4 """This script generates an rc file and header (setup_strings.{rc,h}) to be |
5 included in setup.exe. The rc file includes translations for strings pulled | 5 included in setup.exe. The rc file includes translations for strings pulled |
6 from generated_resource.grd and the localized .xtb files. | 6 from generated_resource.grd and the localized .xtb files. |
7 | 7 |
8 The header file includes IDs for each string, but also has values to allow | 8 The header file includes IDs for each string, but also has values to allow |
9 getting a string based on a language offset. For example, the header file | 9 getting a string based on a language offset. For example, the header file |
10 looks like this: | 10 looks like this: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 'IDS_INSTALL_SYSTEM_LEVEL_EXISTS', | 47 'IDS_INSTALL_SYSTEM_LEVEL_EXISTS', |
48 'IDS_INSTALL_FAILED', | 48 'IDS_INSTALL_FAILED', |
49 'IDS_SETUP_PATCH_FAILED', | 49 'IDS_SETUP_PATCH_FAILED', |
50 'IDS_INSTALL_OS_NOT_SUPPORTED', | 50 'IDS_INSTALL_OS_NOT_SUPPORTED', |
51 'IDS_INSTALL_OS_ERROR', | 51 'IDS_INSTALL_OS_ERROR', |
52 'IDS_INSTALL_TEMP_DIR_FAILED', | 52 'IDS_INSTALL_TEMP_DIR_FAILED', |
53 'IDS_INSTALL_UNCOMPRESSION_FAILED', | 53 'IDS_INSTALL_UNCOMPRESSION_FAILED', |
54 'IDS_INSTALL_INVALID_ARCHIVE', | 54 'IDS_INSTALL_INVALID_ARCHIVE', |
55 'IDS_INSTALL_INSUFFICIENT_RIGHTS', | 55 'IDS_INSTALL_INSUFFICIENT_RIGHTS', |
56 'IDS_UNINSTALL_FAILED', | 56 'IDS_UNINSTALL_FAILED', |
| 57 'IDS_UNINSTALL_COMPLETE', |
57 'IDS_INSTALL_DIR_IN_USE', | 58 'IDS_INSTALL_DIR_IN_USE', |
58 'IDS_OEM_MAIN_SHORTCUT_NAME', | 59 'IDS_OEM_MAIN_SHORTCUT_NAME', |
59 'IDS_SHORTCUT_TOOLTIP', | 60 'IDS_SHORTCUT_TOOLTIP', |
60 ] | 61 ] |
61 | 62 |
62 # The ID of the first resource string. | 63 # The ID of the first resource string. |
63 kFirstResourceID = 1600 | 64 kFirstResourceID = 1600 |
64 | 65 |
65 class TranslationStruct: | 66 class TranslationStruct: |
66 """A helper struct that holds information about a single translation.""" | 67 """A helper struct that holds information about a single translation.""" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 translated_strings = CollectTranslatedStrings() | 192 translated_strings = CollectTranslatedStrings() |
192 kFilebase = os.path.join(argv[1], 'installer_util_strings') | 193 kFilebase = os.path.join(argv[1], 'installer_util_strings') |
193 WriteRCFile(translated_strings, kFilebase) | 194 WriteRCFile(translated_strings, kFilebase) |
194 WriteHeaderFile(translated_strings, kFilebase) | 195 WriteHeaderFile(translated_strings, kFilebase) |
195 | 196 |
196 if '__main__' == __name__: | 197 if '__main__' == __name__: |
197 if len(sys.argv) < 2: | 198 if len(sys.argv) < 2: |
198 print 'Usage:\n %s <output_directory>' % sys.argv[0] | 199 print 'Usage:\n %s <output_directory>' % sys.argv[0] |
199 sys.exit(1) | 200 sys.exit(1) |
200 main(sys.argv) | 201 main(sys.argv) |
OLD | NEW |