OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2014 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 | 6 |
7 # Remove display names for languages that are not listed in the accept-language | 7 # Remove display names for languages that are not listed in the accept-language |
8 # list of Chromium. | 8 # list of Chromium. |
9 function filter_display_language_names { | 9 function filter_display_language_names { |
10 for lang in $(grep -v '^#' accept_lang.list) | 10 for lang in $(grep -v '^#' accept_lang.list) |
(...skipping 12 matching lines...) Expand all Loading... |
23 sed -r -i \ | 23 sed -r -i \ |
24 '/^ Keys\{$/,/^ \}$/d | 24 '/^ Keys\{$/,/^ \}$/d |
25 /^ Languages\{$/, /^ \}$/ { | 25 /^ Languages\{$/, /^ \}$/ { |
26 /^ Languages\{$/p | 26 /^ Languages\{$/p |
27 /^ '${ACCEPT_LANG_PATTERN}'/p | 27 /^ '${ACCEPT_LANG_PATTERN}'/p |
28 /^ \}$/p | 28 /^ \}$/p |
29 d | 29 d |
30 } | 30 } |
31 /^ Types\{$/,/^ \}$/d | 31 /^ Types\{$/,/^ \}$/d |
32 /^ Variants\{$/,/^ \}$/d' ${target} | 32 /^ Variants\{$/,/^ \}$/d' ${target} |
| 33 |
| 34 # Delete an empty "Languages" block. Otherwise, getting the display |
| 35 # name for all the language in a given locale (e.g. en_GB) would fail |
| 36 # when the above filtering sed command results in an empty "Languages" |
| 37 # block. |
| 38 sed -r -i \ |
| 39 '/^ Languages\{$/ { |
| 40 N |
| 41 /^ Languages\{\n \}/ d |
| 42 }' ${target} |
33 done | 43 done |
34 } | 44 } |
35 | 45 |
36 | 46 |
37 # Keep only the minimum locale data for non-UI languages. | 47 # Keep only the minimum locale data for non-UI languages. |
38 function abridge_locale_data_for_non_ui_languages { | 48 function abridge_locale_data_for_non_ui_languages { |
39 for lang in $(grep -v '^#' chrome_ui_languages.list) | 49 for lang in $(grep -v '^#' chrome_ui_languages.list) |
40 do | 50 do |
41 # Set $OP to '|' only if $UI_LANGUAGES is not empty. | 51 # Set $OP to '|' only if $UI_LANGUAGES is not empty. |
42 OP=${UI_LANGUAGES:+|} | 52 OP=${UI_LANGUAGES:+|} |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 filter_currency_data | 191 filter_currency_data |
182 filter_region_data | 192 filter_region_data |
183 remove_legacy_chinese_codepoint_collation | 193 remove_legacy_chinese_codepoint_collation |
184 filter_unit_data | 194 filter_unit_data |
185 | 195 |
186 # Chromium OS needs exemplar cities for timezones, but not Chromium. | 196 # Chromium OS needs exemplar cities for timezones, but not Chromium. |
187 # It'll save 400kB (uncompressed), but the size difference in | 197 # It'll save 400kB (uncompressed), but the size difference in |
188 # 7z compressed installer is <= 100kB. | 198 # 7z compressed installer is <= 100kB. |
189 # TODO(jshin): Make separate data files for CrOS and Chromium. | 199 # TODO(jshin): Make separate data files for CrOS and Chromium. |
190 #remove_exemplar_cities | 200 #remove_exemplar_cities |
OLD | NEW |