| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright 2009 Google Inc. All rights reserved. | 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 3 | 5 |
| 4 """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 |
| 5 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 |
| 6 from generated_resource.grd and the localized .xtb files. | 8 from generated_resource.grd and the localized .xtb files. |
| 7 | 9 |
| 8 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 |
| 9 getting a string based on a language offset. For example, the header file | 11 getting a string based on a language offset. For example, the header file |
| 10 looks like this: | 12 looks like this: |
| 11 | 13 |
| 12 #define IDS_L10N_OFFSET_AR 0 | 14 #define IDS_L10N_OFFSET_AR 0 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 translated_strings = CollectTranslatedStrings() | 194 translated_strings = CollectTranslatedStrings() |
| 193 kFilebase = os.path.join(argv[1], 'installer_util_strings') | 195 kFilebase = os.path.join(argv[1], 'installer_util_strings') |
| 194 WriteRCFile(translated_strings, kFilebase) | 196 WriteRCFile(translated_strings, kFilebase) |
| 195 WriteHeaderFile(translated_strings, kFilebase) | 197 WriteHeaderFile(translated_strings, kFilebase) |
| 196 | 198 |
| 197 if '__main__' == __name__: | 199 if '__main__' == __name__: |
| 198 if len(sys.argv) < 2: | 200 if len(sys.argv) < 2: |
| 199 print 'Usage:\n %s <output_directory>' % sys.argv[0] | 201 print 'Usage:\n %s <output_directory>' % sys.argv[0] |
| 200 sys.exit(1) | 202 sys.exit(1) |
| 201 main(sys.argv) | 203 main(sys.argv) |
| OLD | NEW |