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 UI_LANG_PATTERN="(${UI_LANGUAGES})[^a-z]" | 10 UI_LANG_PATTERN="(${UI_LANGUAGES})[^a-z]" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 do | 99 do |
100 [ $i != 'root.txt' ] && \ | 100 [ $i != 'root.txt' ] && \ |
101 sed -i '/^ zoneStrings/, /^ "meta:/ { | 101 sed -i '/^ zoneStrings/, /^ "meta:/ { |
102 /^ zoneStrings/ p | 102 /^ zoneStrings/ p |
103 /^ "meta:/ p | 103 /^ "meta:/ p |
104 d | 104 d |
105 }' $i | 105 }' $i |
106 done | 106 done |
107 } | 107 } |
108 | 108 |
| 109 # big5han and gb2312han collation do not make any sense and nobody uses them. |
| 110 function remove_legacy_chinese_codepoint_collation { |
| 111 echo "Removing Big5 / GB2312 collation data from Chinese locale" |
| 112 target="${dataroot}/coll/zh.txt" |
| 113 echo "Overwriting ${target}" |
| 114 sed -r -i '/^ (big5|gb2312)han\{$/,/^ \}$/ d' ${target} |
| 115 } |
| 116 |
109 dataroot="$(dirname $0)/../source/data" | 117 dataroot="$(dirname $0)/../source/data" |
110 localedatapath="${dataroot}/locales" | 118 localedatapath="${dataroot}/locales" |
111 langdatapath="${dataroot}/lang" | 119 langdatapath="${dataroot}/lang" |
112 | 120 |
113 for lang in $(grep -v '^#' chrome_ui_languages.list) | 121 for lang in $(grep -v '^#' chrome_ui_languages.list) |
114 do | 122 do |
115 # Set $OP to '|' only if $UI_LANGUAGES is not empty. | 123 # Set $OP to '|' only if $UI_LANGUAGES is not empty. |
116 OP=${UI_LANGUAGES:+|} | 124 OP=${UI_LANGUAGES:+|} |
117 UI_LANGUAGES="${UI_LANGUAGES}${OP}${lang}" | 125 UI_LANGUAGES="${UI_LANGUAGES}${OP}${lang}" |
118 done | 126 done |
119 | 127 |
120 | 128 |
121 filter_display_language_names | 129 filter_display_language_names |
122 abridge_locale_data_for_non_ui_languages | 130 abridge_locale_data_for_non_ui_languages |
123 filter_currency_data | 131 filter_currency_data |
124 filter_region_data | 132 filter_region_data |
| 133 remove_legacy_chinese_codepoint_collation |
125 | 134 |
126 # Chromium OS needs exemplar cities for timezones, but not Chromium. | 135 # Chromium OS needs exemplar cities for timezones, but not Chromium. |
127 # It'll save 400kB (uncompressed), but the size difference in | 136 # It'll save 400kB (uncompressed), but the size difference in |
128 # 7z compressed installer is <= 100kB. | 137 # 7z compressed installer is <= 100kB. |
129 # TODO(jshin): Make separate data files for CrOS and Chromium. | 138 # TODO(jshin): Make separate data files for CrOS and Chromium. |
130 #fremove_exemplar_cities | 139 #fremove_exemplar_cities |
| 140 |
| 141 |
OLD | NEW |