Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1671)

Unified Diff: scripts/trim_data.sh

Issue 2442923002: ICU update to 58 part 2 (Closed)
Patch Set: apply more patches and updates; almost ready to roll Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « patches/xlit_badcast.patch ('k') | source/common/dictbe.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/trim_data.sh
diff --git a/scripts/trim_data.sh b/scripts/trim_data.sh
index 208fbb8b93e39ea1263c084da0ae396ab5f1b4f5..46be26c88ac527ef549d81c4069df15142b92a12 100755
--- a/scripts/trim_data.sh
+++ b/scripts/trim_data.sh
@@ -4,6 +4,22 @@
# found in the LICENSE file.
+# Remove entries currently not used in Chromium/V8.
+function filter_locale_data {
+ echo Removing unncessary categories in ${localedatapath}
+ for langpath in ${localedatapath}/*.txt
+ do
+ echo Overwriting ${langpath} ...
+ sed -r -i \
+ '/^ characterLabel\{$/,/^ \}$/d
+ /^ AuxExemplarCharacters\{.*\}$/d
+ /^ AuxExemplarCharacters\{$/, /^ \}$/d
+ /^ ExemplarCharacters\{.*\}$/d
+ /^ ExemplarCharacters\{$/, /^ \}$/d
+ /^ (mon|tue|wed|thu|fri|sat|sun|quarter)(|-short|-narrow)\{$/, /^ \}$/d' ${langpath}
+ done
+}
+
# Remove display names for languages that are not listed in the accept-language
# list of Chromium.
function filter_display_language_names {
@@ -15,10 +31,10 @@ function filter_display_language_names {
done
ACCEPT_LANG_PATTERN="(${ACCEPT_LANG_PATTERN})[^a-z]"
- echo "Filtering out display names for non-A-L languages ${langdatapath}"
- for lang in $(grep -v '^#' "${scriptdir}/chrome_ui_languages.list")
+ echo "Filtering out display names for non-A-L languages in ${langdatapath}"
+ for langpath in ${langdatapath}/*.txt
do
- target=${langdatapath}/${lang}.txt
+ target=${langpath}
echo Overwriting ${target} ...
sed -r -i \
'/^ Keys\{$/,/^ \}$/d
@@ -29,6 +45,8 @@ function filter_display_language_names {
d
}
/^ Types\{$/,/^ \}$/d
+ /^ Types%short\{$/,/^ \}$/d
+ /^ characterLabelPattern\{$/,/^ \}$/d
/^ Variants\{$/,/^ \}$/d' ${target}
# Delete an empty "Languages" block. Otherwise, getting the display
@@ -39,7 +57,7 @@ function filter_display_language_names {
'/^ Languages\{$/ {
N
/^ Languages\{\n \}/ d
- }' ${target}
+ }' ${target}
done
}
@@ -67,10 +85,6 @@ function abridge_locale_data_for_non_ui_languages {
sed -n -r -i \
'1, /^'${lang}'\{$/p
/^ "%%ALIAS"\{/p
- /^ AuxExemplarCharacters\{.*\}$/p
- /^ AuxExemplarCharacters\{$/, /^ \}$/p
- /^ ExemplarCharacters\{.*\}$/p
- /^ ExemplarCharacters\{$/, /^ \}$/p
/^ (LocaleScript|layout)\{$/, /^ \}$/p
/^ Version\{.*$/p
/^\}$/p' ${target}
@@ -189,6 +203,7 @@ langdatapath="${dataroot}/lang"
+filter_locale_data
filter_display_language_names
abridge_locale_data_for_non_ui_languages
filter_currency_data
« no previous file with comments | « patches/xlit_badcast.patch ('k') | source/common/dictbe.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698