| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Usage: generate_localizer [xib_path] [output_dot_h_path] [output_dot_mm_path] | 7 # Usage: generate_localizer [xib_path] [output_dot_h_path] [output_dot_mm_path] |
| 8 # | 8 # |
| 9 # Extracts all the localizable strings that start with "^IDS" from the given | 9 # Extracts all the localizable strings that start with "^IDS" from the given |
| 10 # xib file, and then generates a localizer to process those strings. | 10 # xib file, and then generates a localizer to process those strings. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 localizer_template_mm = \ | 41 localizer_template_mm = \ |
| 42 '''// ---------- WARNING ---------- | 42 '''// ---------- WARNING ---------- |
| 43 // THIS IS A GENERATED FILE, DO NOT EDIT IT DIRECTLY! | 43 // THIS IS A GENERATED FILE, DO NOT EDIT IT DIRECTLY! |
| 44 // | 44 // |
| 45 // Generated by '%(generate_localizer)s'. | 45 // Generated by '%(generate_localizer)s'. |
| 46 // Generated from '%(xib_file)s'. | 46 // Generated from '%(xib_file)s'. |
| 47 // | 47 // |
| 48 | 48 |
| 49 #import "%(header_name)s" | 49 #import "%(header_name)s" |
| 50 | 50 |
| 51 #include "grit/app_strings.h" |
| 51 #include "grit/chromium_strings.h" | 52 #include "grit/chromium_strings.h" |
| 52 #include "grit/generated_resources.h" | 53 #include "grit/generated_resources.h" |
| 53 | 54 |
| 54 @implementation %(class_name)sLocalizer | 55 @implementation %(class_name)sLocalizer |
| 55 | 56 |
| 56 - (NSString *)localizedStringForString:(NSString *)string { | 57 - (NSString *)localizedStringForString:(NSString *)string { |
| 57 | 58 |
| 58 static const ui_localizer::ResourceMap kUIResources[] = { | 59 static const ui_localizer::ResourceMap kUIResources[] = { |
| 59 %(resource_map_list)s }; | 60 %(resource_map_list)s }; |
| 60 static const size_t kUIResourcesSize = arraysize(kUIResources); | 61 static const size_t kUIResourcesSize = arraysize(kUIResources); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 file_fd.write(h_file_content) | 165 file_fd.write(h_file_content) |
| 165 file_fd.close() | 166 file_fd.close() |
| 166 file_fd = open(output_mm_path, 'w') | 167 file_fd = open(output_mm_path, 'w') |
| 167 file_fd.write(mm_file_content) | 168 file_fd.write(mm_file_content) |
| 168 file_fd.close() | 169 file_fd.close() |
| 169 | 170 |
| 170 return 0 | 171 return 0 |
| 171 | 172 |
| 172 if __name__ == '__main__': | 173 if __name__ == '__main__': |
| 173 sys.exit(Main(sys.argv)) | 174 sys.exit(Main(sys.argv)) |
| OLD | NEW |