OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 'IDS_INSTALL_READY_MODE_REQUIRES_CHROME', | 73 'IDS_INSTALL_READY_MODE_REQUIRES_CHROME', |
74 'IDS_INSTALL_INCONSISTENT_UPDATE_POLICY', | 74 'IDS_INSTALL_INCONSISTENT_UPDATE_POLICY', |
75 'IDS_OEM_MAIN_SHORTCUT_NAME', | 75 'IDS_OEM_MAIN_SHORTCUT_NAME', |
76 'IDS_SHORTCUT_TOOLTIP', | 76 'IDS_SHORTCUT_TOOLTIP', |
77 'IDS_SHORTCUT_NEW_WINDOW', | 77 'IDS_SHORTCUT_NEW_WINDOW', |
78 'IDS_APP_LAUNCHER_PRODUCT_DESCRIPTION', | 78 'IDS_APP_LAUNCHER_PRODUCT_DESCRIPTION', |
79 'IDS_APP_LAUNCHER_SHORTCUT_TOOLTIP', | 79 'IDS_APP_LAUNCHER_SHORTCUT_TOOLTIP', |
80 'IDS_UNINSTALL_APP_LAUNCHER', | 80 'IDS_UNINSTALL_APP_LAUNCHER', |
81 'IDS_APP_LIST_SHORTCUT_NAME', | 81 'IDS_APP_LIST_SHORTCUT_NAME', |
82 'IDS_APP_LIST_SHORTCUT_NAME_CANARY', | 82 'IDS_APP_LIST_SHORTCUT_NAME_CANARY', |
| 83 'IDS_APP_SHORTCUTS_SUBDIR_NAME', |
| 84 'IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY', |
83 ] | 85 ] |
84 | 86 |
85 # The ID of the first resource string. | 87 # The ID of the first resource string. |
86 kFirstResourceID = 1600 | 88 kFirstResourceID = 1600 |
87 | 89 |
88 | 90 |
89 class TranslationStruct: | 91 class TranslationStruct: |
90 """A helper struct that holds information about a single translation.""" | 92 """A helper struct that holds information about a single translation.""" |
91 def __init__(self, resource_id_str, language, translation): | 93 def __init__(self, resource_id_str, language, translation): |
92 self.resource_id_str = resource_id_str | 94 self.resource_id_str = resource_id_str |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 branding = argv[2] | 248 branding = argv[2] |
247 translated_strings = CollectTranslatedStrings(branding) | 249 translated_strings = CollectTranslatedStrings(branding) |
248 kFilebase = os.path.join(argv[1], 'installer_util_strings') | 250 kFilebase = os.path.join(argv[1], 'installer_util_strings') |
249 WriteRCFile(translated_strings, kFilebase) | 251 WriteRCFile(translated_strings, kFilebase) |
250 WriteHeaderFile(translated_strings, kFilebase + '.h') | 252 WriteHeaderFile(translated_strings, kFilebase + '.h') |
251 return 0 | 253 return 0 |
252 | 254 |
253 | 255 |
254 if '__main__' == __name__: | 256 if '__main__' == __name__: |
255 sys.exit(main(sys.argv)) | 257 sys.exit(main(sys.argv)) |
OLD | NEW |