| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 treeroot="$(dirname "$0")/.." | 6 treeroot="$(dirname "$0")/.." |
| 7 cd "${treeroot}" | 7 cd "${treeroot}" |
| 8 | 8 |
| 9 echo "Applying brkitr.patch" | 9 echo "Applying brkitr.patch" |
| 10 patch -p1 < android/brkitr.patch || { echo "failed to patch" >2; exit 1; } | 10 patch -p1 < android/brkitr.patch || { echo "failed to patch" >&2; exit 1; } |
| 11 | 11 |
| 12 # Keep only the currencies used by the larget 60 economies in terms of GDP | 12 # Keep only the currencies used by the larget 60 economies in terms of GDP |
| 13 # with several more added in. | 13 # with several more added in. |
| 14 # TODO(jshin): Use ucurr_isAvailable in ICU to drop more currencies. | 14 # TODO(jshin): Use ucurr_isAvailable in ICU to drop more currencies. |
| 15 # See also http://en.wikipedia.org/wiki/List_of_circulating_currencies | 15 # See also http://en.wikipedia.org/wiki/List_of_circulating_currencies |
| 16 # Copied from scripts/trim_data.sh. Need to refactor. | 16 # Copied from scripts/trim_data.sh. Need to refactor. |
| 17 for currency in $(grep -v '^#' "${treeroot}/android/currencies.list") | 17 for currency in $(grep -v '^#' "${treeroot}/android/currencies.list") |
| 18 do | 18 do |
| 19 OP=${KEEPLIST:+|} | 19 OP=${KEEPLIST:+|} |
| 20 KEEPLIST=${KEEPLIST}${OP}${currency} | 20 KEEPLIST=${KEEPLIST}${OP}${currency} |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 echo Overwriting curr/reslocal.mk to drop the currency names | 80 echo Overwriting curr/reslocal.mk to drop the currency names |
| 81 echo for ${EXTRA_LANGUAGES} | 81 echo for ${EXTRA_LANGUAGES} |
| 82 for lang in ${EXTRA_LANGUAGES} | 82 for lang in ${EXTRA_LANGUAGES} |
| 83 do | 83 do |
| 84 sed -i -e '/'$lang'.txt/ d' curr/reslocal.mk | 84 sed -i -e '/'$lang'.txt/ d' curr/reslocal.mk |
| 85 done | 85 done |
| 86 | 86 |
| 87 | 87 |
| 88 # Excludes region data. On Android Java API is used to get the data. | 88 # Excludes region data. On Android Java API is used to get the data. |
| 89 # Due to a bug in ICU, an empty region list always uses 70kB pool.res bundle. |
| 90 # As a work around, include the minimal version of en.txt |
| 89 echo Overwriting region/reslocal.mk... | 91 echo Overwriting region/reslocal.mk... |
| 90 cat >region/reslocal.mk <<END | 92 cat >region/reslocal.mk <<END |
| 91 REGION_CLDR_VERSION = %version% | 93 REGION_CLDR_VERSION = %version% |
| 92 REGION_SYNTHETIC_ALIAS = | 94 REGION_SYNTHETIC_ALIAS = |
| 93 REGION_ALIAS_SOURCE = | 95 REGION_ALIAS_SOURCE = |
| 94 REGION_SOURCE = | 96 REGION_SOURCE = en.txt |
| 97 END |
| 98 |
| 99 echo Overwriting region/en.txt... |
| 100 cat >region/en.txt <<END |
| 101 en{ |
| 102 Countries{ |
| 103 US{"United States"} |
| 104 } |
| 105 } |
| 95 END | 106 END |
| 96 | 107 |
| 97 # On Android Java API is used to get lang data, except for the language and | 108 # On Android Java API is used to get lang data, except for the language and |
| 98 # script names for zh_Hans and zh_Hant which are not supported by Java API. | 109 # script names for zh_Hans and zh_Hant which are not supported by Java API. |
| 99 # Here remove all lang data except those names. | 110 # Here remove all lang data except those names. |
| 100 # See the comments in GetDisplayNameForLocale() (in Chromium's | 111 # See the comments in GetDisplayNameForLocale() (in Chromium's |
| 101 # src/ui/base/l10n/l10n_util.cc) about why we need the scripts. | 112 # src/ui/base/l10n/l10n_util.cc) about why we need the scripts. |
| 102 for i in lang/*.txt; do | 113 for i in lang/*.txt; do |
| 103 echo Overwriting $i... | 114 echo Overwriting $i... |
| 104 sed '/^ Keys{$/,/^ }$/d | 115 sed '/^ Keys{$/,/^ }$/d |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 183 |
| 173 # Add 'roc' calendar to zh_Hant*. | 184 # Add 'roc' calendar to zh_Hant*. |
| 174 [[ "$(basename $i .txt)" =~ 'zh_Hant' ]] && { EXTRA_CAL="${EXTRA_CAL}|roc"; } | 185 [[ "$(basename $i .txt)" =~ 'zh_Hant' ]] && { EXTRA_CAL="${EXTRA_CAL}|roc"; } |
| 175 | 186 |
| 176 CAL_PATTERN="(${COMMON_CALENDARS}${EXTRA_CAL:+|${EXTRA_CAL}})" | 187 CAL_PATTERN="(${COMMON_CALENDARS}${EXTRA_CAL:+|${EXTRA_CAL}})" |
| 177 echo $CAL_PATTERN | 188 echo $CAL_PATTERN |
| 178 | 189 |
| 179 echo Overwriting $i... | 190 echo Overwriting $i... |
| 180 sed -r '/^ calendar\{$/,/^ \}$/ { | 191 sed -r '/^ calendar\{$/,/^ \}$/ { |
| 181 /^ calendar\{$/p | 192 /^ calendar\{$/p |
| 193 /^ default\{".*"\}$/p |
| 182 /^ '${CAL_PATTERN}'\{$/, /^ \}$/p | 194 /^ '${CAL_PATTERN}'\{$/, /^ \}$/p |
| 183 /^ \}$/p | 195 /^ \}$/p |
| 184 d | 196 d |
| 185 }' -i $i | 197 }' -i $i |
| 186 done | 198 done |
| 187 | 199 |
| 188 echo DONE. | 200 echo DONE. |
| OLD | NEW |