OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright 2008 Google Inc. All rights reserved. | 2 # Copyright 2008 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 'IDS_INSTALL_SYSTEM_LEVEL_EXISTS', | 44 'IDS_INSTALL_SYSTEM_LEVEL_EXISTS', |
45 'IDS_INSTALL_FAILED', | 45 'IDS_INSTALL_FAILED', |
46 'IDS_INSTALL_OS_NOT_SUPPORTED', | 46 'IDS_INSTALL_OS_NOT_SUPPORTED', |
47 'IDS_INSTALL_OS_ERROR', | 47 'IDS_INSTALL_OS_ERROR', |
48 'IDS_INSTALL_TEMP_DIR_FAILED', | 48 'IDS_INSTALL_TEMP_DIR_FAILED', |
49 'IDS_INSTALL_UNCOMPRESSION_FAILED', | 49 'IDS_INSTALL_UNCOMPRESSION_FAILED', |
50 'IDS_INSTALL_INVALID_ARCHIVE', | 50 'IDS_INSTALL_INVALID_ARCHIVE', |
51 'IDS_INSTALL_INSUFFICIENT_RIGHTS', | 51 'IDS_INSTALL_INSUFFICIENT_RIGHTS', |
52 'IDS_UNINSTALL_FAILED', | 52 'IDS_UNINSTALL_FAILED', |
53 'IDS_INSTALL_DIR_IN_USE', | 53 'IDS_INSTALL_DIR_IN_USE', |
| 54 'IDS_OEM_MAIN_SHORTCUT_NAME', |
| 55 'IDS_SHORTCUT_TOOLTIP', |
54 ] | 56 ] |
55 | 57 |
56 # The ID of the first resource string. | 58 # The ID of the first resource string. |
57 kFirstResourceID = 1600 | 59 kFirstResourceID = 1600 |
58 | 60 |
59 class TranslationStruct: | 61 class TranslationStruct: |
60 """A helper struct that holds information about a single translation.""" | 62 """A helper struct that holds information about a single translation.""" |
61 def __init__(self, resource_id_str, language, translation): | 63 def __init__(self, resource_id_str, language, translation): |
62 self.resource_id_str = resource_id_str | 64 self.resource_id_str = resource_id_str |
63 self.language = language | 65 self.language = language |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 translated_strings = CollectTranslatedStrings() | 187 translated_strings = CollectTranslatedStrings() |
186 kFilebase = os.path.join(argv[1], 'installer_util_strings') | 188 kFilebase = os.path.join(argv[1], 'installer_util_strings') |
187 WriteRCFile(translated_strings, kFilebase) | 189 WriteRCFile(translated_strings, kFilebase) |
188 WriteHeaderFile(translated_strings, kFilebase) | 190 WriteHeaderFile(translated_strings, kFilebase) |
189 | 191 |
190 if '__main__' == __name__: | 192 if '__main__' == __name__: |
191 if len(sys.argv) < 2: | 193 if len(sys.argv) < 2: |
192 print 'Usage:\n %s <output_directory>' % sys.argv[0] | 194 print 'Usage:\n %s <output_directory>' % sys.argv[0] |
193 sys.exit(1) | 195 sys.exit(1) |
194 main(sys.argv) | 196 main(sys.argv) |
OLD | NEW |