Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1212)

Side by Side Diff: chrome/tools/build/repack_locales.py

Issue 171043: Stop shortening the Mac lproj directories (ie-"en-US" instead of "en").... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2009 The Chromium Authors. 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 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 """Helper script to repack paks for a list of locales. 6 """Helper script to repack paks for a list of locales.
7 7
8 Gyp doesn't have any built-in looping capability, so this just provides a way to 8 Gyp doesn't have any built-in looping capability, so this just provides a way to
9 loop over a list of locales when repacking pak files, thus avoiding a 9 loop over a list of locales when repacking pak files, thus avoiding a
10 proliferation of mostly duplicate, cut-n-paste gyp actions. 10 proliferation of mostly duplicate, cut-n-paste gyp actions.
(...skipping 18 matching lines...) Expand all
29 29
30 class Usage(Exception): 30 class Usage(Exception):
31 def __init__(self, msg): 31 def __init__(self, msg):
32 self.msg = msg 32 self.msg = msg
33 33
34 34
35 def calc_output(locale): 35 def calc_output(locale):
36 """Determine the file that will be generated for the given locale.""" 36 """Determine the file that will be generated for the given locale."""
37 #e.g. '<(INTERMEDIATE_DIR)/repack/da.pak', 37 #e.g. '<(INTERMEDIATE_DIR)/repack/da.pak',
38 if sys.platform in ('darwin',): 38 if sys.platform in ('darwin',):
39 splitpos = locale.find('-') 39 return '%s/repack/%s.lproj/locale.pak' % (INT_DIR, locale)
40 if splitpos == -1:
41 splitpos = None
42 return '%s/repack/%s.lproj/locale.pak' % (INT_DIR, locale[0:splitpos])
43 else: 40 else:
44 return '%s/repack/%s.pak' % (INT_DIR, locale) 41 return '%s/repack/%s.pak' % (INT_DIR, locale)
45 42
46 43
47 def calc_inputs(locale): 44 def calc_inputs(locale):
48 """Determine the files that need processing for the given locale.""" 45 """Determine the files that need processing for the given locale."""
49 inputs = [] 46 inputs = []
50 47
51 #e.g. '<(grit_out_dir)/generated_resources_da.pak' 48 #e.g. '<(grit_out_dir)/generated_resources_da.pak'
52 inputs.append('%s/generated_resources_%s.pak' % (GRIT_DIR, locale)) 49 inputs.append('%s/generated_resources_%s.pak' % (GRIT_DIR, locale))
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 return 0 176 return 0
180 177
181 if print_outputs: 178 if print_outputs:
182 list_outputs(locales) 179 list_outputs(locales)
183 return 0 180 return 0
184 181
185 repack_locales(locales) 182 repack_locales(locales)
186 183
187 if __name__ == '__main__': 184 if __name__ == '__main__':
188 sys.exit(main(sys.argv)) 185 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « chrome/chrome.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698