| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Helper tool that is built and run during a build to pull strings from | 5 // Helper tool that is built and run during a build to pull strings from |
| 6 // the GRD files and generate the InfoPlist.strings files needed for | 6 // the GRD files and generate the InfoPlist.strings files needed for |
| 7 // Mac OS X app bundles. | 7 // Mac OS X app bundles. |
| 8 | 8 |
| 9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 10 | 10 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 NSString* address_book_prompt_description = | 256 NSString* address_book_prompt_description = |
| 257 LoadStringFromDataPack(branded_data_pack.get(), cur_lang, | 257 LoadStringFromDataPack(branded_data_pack.get(), cur_lang, |
| 258 IDS_AUTOFILL_ADDRESS_BOOK_PROMPT_DESCRIPTION, | 258 IDS_AUTOFILL_ADDRESS_BOOK_PROMPT_DESCRIPTION, |
| 259 "IDS_AUTOFILL_ADDRESS_BOOK_PROMPT_DESCRIPTION"); | 259 "IDS_AUTOFILL_ADDRESS_BOOK_PROMPT_DESCRIPTION"); |
| 260 | 260 |
| 261 base::Time::Exploded exploded_time; | 261 base::Time::Exploded exploded_time; |
| 262 base::Time::Now().LocalExplode(&exploded_time); | 262 base::Time::Now().LocalExplode(&exploded_time); |
| 263 std::vector<base::string16> replacements; | 263 std::vector<base::string16> replacements; |
| 264 replacements.push_back(base::IntToString16(exploded_time.year)); | 264 replacements.push_back(base::IntToString16(exploded_time.year)); |
| 265 NSString* copyright = base::SysUTF16ToNSString( | 265 NSString* copyright = base::SysUTF16ToNSString( |
| 266 ReplaceStringPlaceholders(base::SysNSStringToUTF16(copyright_format), | 266 base::ReplaceStringPlaceholders( |
| 267 replacements, | 267 base::SysNSStringToUTF16(copyright_format), replacements, NULL)); |
| 268 NULL)); | |
| 269 | 268 |
| 270 // For now, assume this is ok for all languages. If we need to, this could | 269 // For now, assume this is ok for all languages. If we need to, this could |
| 271 // be moved into generated_resources.grd and fetched. | 270 // be moved into generated_resources.grd and fetched. |
| 272 NSString *get_info = [NSString stringWithFormat:@"%@ %@, %@", | 271 NSString *get_info = [NSString stringWithFormat:@"%@ %@, %@", |
| 273 name, version_string, copyright]; | 272 name, version_string, copyright]; |
| 274 | 273 |
| 275 // Generate the InfoPlist.strings file contents | 274 // Generate the InfoPlist.strings file contents |
| 276 NSString* strings_file_contents_string = | 275 NSString* strings_file_contents_string = |
| 277 [NSString stringWithFormat: | 276 [NSString stringWithFormat: |
| 278 @"CFBundleDisplayName = \"%@\";\n" | 277 @"CFBundleDisplayName = \"%@\";\n" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 [output_path stringByAppendingPathComponent:@"InfoPlist.strings"]; | 327 [output_path stringByAppendingPathComponent:@"InfoPlist.strings"]; |
| 329 if (![strings_file_contents_utf8 writeToFile:output_path | 328 if (![strings_file_contents_utf8 writeToFile:output_path |
| 330 atomically:YES]) { | 329 atomically:YES]) { |
| 331 fprintf(stderr, "ERROR: Failed to write out '%s'\n", | 330 fprintf(stderr, "ERROR: Failed to write out '%s'\n", |
| 332 [output_path UTF8String]); | 331 [output_path UTF8String]); |
| 333 exit(1); | 332 exit(1); |
| 334 } | 333 } |
| 335 } | 334 } |
| 336 return 0; | 335 return 0; |
| 337 } | 336 } |
| OLD | NEW |