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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 'IDS_INSTALL_NON_MULTI_INSTALLATION_EXISTS', | 71 'IDS_INSTALL_NON_MULTI_INSTALLATION_EXISTS', |
72 'IDS_INSTALL_MULTI_INSTALLATION_EXISTS', | 72 'IDS_INSTALL_MULTI_INSTALLATION_EXISTS', |
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', |
| 82 'IDS_APP_LIST_SHORTCUT_NAME_CANARY', |
81 ] | 83 ] |
82 | 84 |
83 # The ID of the first resource string. | 85 # The ID of the first resource string. |
84 kFirstResourceID = 1600 | 86 kFirstResourceID = 1600 |
85 | 87 |
86 | 88 |
87 class TranslationStruct: | 89 class TranslationStruct: |
88 """A helper struct that holds information about a single translation.""" | 90 """A helper struct that holds information about a single translation.""" |
89 def __init__(self, resource_id_str, language, translation): | 91 def __init__(self, resource_id_str, language, translation): |
90 self.resource_id_str = resource_id_str | 92 self.resource_id_str = resource_id_str |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 branding = argv[2] | 246 branding = argv[2] |
245 translated_strings = CollectTranslatedStrings(branding) | 247 translated_strings = CollectTranslatedStrings(branding) |
246 kFilebase = os.path.join(argv[1], 'installer_util_strings') | 248 kFilebase = os.path.join(argv[1], 'installer_util_strings') |
247 WriteRCFile(translated_strings, kFilebase) | 249 WriteRCFile(translated_strings, kFilebase) |
248 WriteHeaderFile(translated_strings, kFilebase + '.h') | 250 WriteHeaderFile(translated_strings, kFilebase + '.h') |
249 return 0 | 251 return 0 |
250 | 252 |
251 | 253 |
252 if '__main__' == __name__: | 254 if '__main__' == __name__: |
253 sys.exit(main(sys.argv)) | 255 sys.exit(main(sys.argv)) |
OLD | NEW |