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 cd `dirname $0`/../source/data | 6 cd $(dirname $0)/../source/data |
7 | 7 |
8 # Excludes curr data which is not used on Android. | 8 # Excludes curr data which is not used on Android. |
9 echo Overwriting curr/reslocal.mk... | 9 echo Overwriting curr/reslocal.mk... |
10 cat >curr/reslocal.mk <<END | 10 cat >curr/reslocal.mk <<END |
11 CURR_CLDR_VERSION = 1.9 | 11 CURR_CLDR_VERSION = 1.9 |
12 CURR_SYNTHETIC_ALIAS = | 12 CURR_SYNTHETIC_ALIAS = |
13 CURR_ALIAS_SOURCE = | 13 CURR_ALIAS_SOURCE = |
14 CURR_SOURCE = | 14 CURR_SOURCE = |
15 END | 15 END |
16 | 16 |
(...skipping 28 matching lines...) Expand all Loading... |
45 /^ }$/p | 45 /^ }$/p |
46 d | 46 d |
47 } | 47 } |
48 /^ Types{$/,/^ }$/d | 48 /^ Types{$/,/^ }$/d |
49 /^ Variants{$/,/^ }$/d | 49 /^ Variants{$/,/^ }$/d |
50 /^ calendar{$/,/^ }$/d | 50 /^ calendar{$/,/^ }$/d |
51 /^ codePatterns{$/,/^ }$/d | 51 /^ codePatterns{$/,/^ }$/d |
52 /^ localeDisplayPattern{$/,/^ }$/d' -i $i | 52 /^ localeDisplayPattern{$/,/^ }$/d' -i $i |
53 done | 53 done |
54 | 54 |
| 55 # Remove exemplar cities in timezone data. |
| 56 # This is copied from scripts/trim_data.sh where it's disabled by default. |
| 57 for i in zone/*.txt |
| 58 do |
| 59 [ $i != 'zone/root.txt' ] && \ |
| 60 sed -i '/^ zoneStrings/, /^ "meta:/ { |
| 61 /^ zoneStrings/ p |
| 62 /^ "meta:/ p |
| 63 d |
| 64 }' $i |
| 65 done |
| 66 |
| 67 # Keep only two common calendars. Add locale-specific calendars only to |
| 68 # locales that are likely to use them most. |
| 69 COMMON_CALENDARS="gregorian|generic" |
| 70 for i in locales/*.txt; do |
| 71 CALENDARS="${COMMON_CALENDARS}" |
| 72 case $(basename $i .txt | sed 's/_.*$//') in |
| 73 th) |
| 74 EXTRA_CAL='buddhist' |
| 75 ;; |
| 76 zh) |
| 77 EXTRA_CAL='chinese' |
| 78 ;; |
| 79 ko) |
| 80 EXTRA_CAL='dangi' |
| 81 ;; |
| 82 am) |
| 83 EXTRA_CAL='ethiopic' |
| 84 ;; |
| 85 he) |
| 86 EXTRA_CAL='hebrew' |
| 87 ;; |
| 88 ar) |
| 89 EXTRA_CAL='arabic' |
| 90 ;; |
| 91 fa) |
| 92 EXTRA_CAL='persian' |
| 93 ;; |
| 94 ja) |
| 95 EXTRA_CAL='japanese' |
| 96 ;; |
| 97 esac |
| 98 |
| 99 # Add 'roc' calendar to zh_Hant*. |
| 100 [[ "$(basename $i .txt)" =~ 'zh_Hant' ]] && { EXTRA_CAL="$EXTRA_CAL|roc"; } |
| 101 |
| 102 CAL_PATTERN="(${COMMON_CALENDARS}|${EXTRA_CAL})" |
| 103 echo $CAL_PATTERN |
| 104 |
| 105 echo Overwriting $i... |
| 106 sed -r '/^ calendar\{$/,/^ \}$/ { |
| 107 /^ calendar\{$/p |
| 108 /^ '${CAL_PATTERN}'\{$/, /^ \}$/p |
| 109 /^ \}$/p |
| 110 d |
| 111 }' -i $i |
| 112 done |
| 113 |
55 echo DONE. | 114 echo DONE. |
OLD | NEW |