diff options
author | jshin@chromium.org <jshin@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c> | 2014-04-22 20:58:52 +0000 |
---|---|---|
committer | jshin@chromium.org <jshin@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c> | 2014-04-22 20:58:52 +0000 |
commit | 4a39040d7b0c1583008ad5bcece0c80d1f4eb8c2 (patch) | |
tree | 36ea2c04372d1b8f708a403aa3709f9512c4b0ee /scripts | |
parent | ef0f93bebbec826e26784ed93191ab8cca4a025e (diff) | |
download | icu-4a39040d7b0c1583008ad5bcece0c80d1f4eb8c2.tar.gz |
Trim unit* sections in data/locales/*
Add 'filter_locale_data' function to trim_data.sh
Chromium/Blink do not use most of unit* sections in locale data. Keep
only duration and compound sub-sections.
Update the icudtl.dat and two assembly source files for Mac/Linux.
It saves ~200kB (uncompressed). 7z-compressed size reduction is 34kB.
With all these changes (up to this CL) applied, the net increase of the ICU data from icu 46 to 52 is 49kB with 7z-compressed.
(3,070,246 vs 3,021,457) and ~ 390kB uncompressed (10,370,656 vs 9,980,368 ).
BUG=132145
TEST=None.
TBR=mark
Review URL: https://codereview.chromium.org/247663002
git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/icu52@265354 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/trim_data.sh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/trim_data.sh b/scripts/trim_data.sh index c1de9ba..3671f68 100755 --- a/scripts/trim_data.sh +++ b/scripts/trim_data.sh @@ -106,6 +106,21 @@ function remove_exemplar_cities { done } +# Keep only duration and compound in units* sections. +function filter_locale_data { + for i in "${dataroot}/locales/*.txt" + do + echo Overwriting $i ... + sed -r -i \ + '/^ units(|Narrow|Short)\{$/, /^ \}$/ { + /^ units(|Narrow|Short)\{$/ p + /^ (duration|compound)\{$/, /^ \}$/ p + /^ \}$/ p + d + }' ${i} + done +} + # big5han and gb2312han collation do not make any sense and nobody uses them. function remove_legacy_chinese_codepoint_collation { echo "Removing Big5 / GB2312 collation data from Chinese locale" @@ -131,11 +146,10 @@ abridge_locale_data_for_non_ui_languages filter_currency_data filter_region_data remove_legacy_chinese_codepoint_collation +filter_locale_data # Chromium OS needs exemplar cities for timezones, but not Chromium. # It'll save 400kB (uncompressed), but the size difference in # 7z compressed installer is <= 100kB. # TODO(jshin): Make separate data files for CrOS and Chromium. -#fremove_exemplar_cities - - +#remove_exemplar_cities |