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

Unified Diff: android/patch_locale.sh

Issue 877193003: ICU update to 54.1 step 7 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: add one more msvc's warning fix Created 5 years, 11 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 | « android/icudtl.dat ('k') | patches/vscomp.patch » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android/patch_locale.sh
diff --git a/android/patch_locale.sh b/android/patch_locale.sh
index af42d6a813272ef4eff75d091db066c24b87a4de..1724a8af7ade7c6f70c46498667966360a3e5a66 100755
--- a/android/patch_locale.sh
+++ b/android/patch_locale.sh
@@ -3,21 +3,86 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+# Keep only the currencies used by the larget 60 economies in terms of GDP
+# with several more added in.
+# TODO(jshin): Use ucurr_isAvailable in ICU to drop more currencies.
+# See also http://en.wikipedia.org/wiki/List_of_circulating_currencies
+# Copied from scripts/trim_data.sh. Need to refactor.
+for currency in $(grep -v '^#' currencies.list)
+do
+ OP=${KEEPLIST:+|}
+ KEEPLIST=${KEEPLIST}${OP}${currency}
+done
+KEEPLIST="(${KEEPLIST})"
+
cd $(dirname $0)/../source/data
-# Excludes curr data which is not used on Android.
-echo Overwriting curr/reslocal.mk...
-cat >curr/reslocal.mk <<END
-CURR_CLDR_VERSION = 1.9
-CURR_SYNTHETIC_ALIAS =
-CURR_ALIAS_SOURCE =
-CURR_SOURCE =
-END
+for i in curr/*.txt
+do
+ locale=$(basename $i .txt)
+ [ $locale == 'supplementalData' ] && continue;
+ echo "Overwriting $i for $locale"
+ sed -n -r -i \
+ '1, /^'${locale}'\{$/ p
+ /^ "%%ALIAS"\{/p
+ /^ %%Parent\{/p
+ /^ Currencies\{$/, /^ \}$/ {
+ /^ Currencies\{$/ p
+ /^ '$KEEPLIST'\{$/, /^ \}$/ p
+ /^ \}$/ p
+ }
+ /^ Currencies%narrow\{$/, /^ \}$/ {
+ /^ Currencies%narrow\{$/ p
+ /^ '$KEEPLIST'\{".*\}$/ p
+ /^ \}$/ p
+ }
+ /^ CurrencyPlurals\{$/, /^ \}$/ {
+ /^ CurrencyPlurals\{$/ p
+ /^ '$KEEPLIST'\{$/, /^ \}$/ p
+ /^ \}$/ p
+ }
+ /^ [cC]urrency(Map|Meta|Spacing|UnitPatterns)\{$/, /^ \}$/ p
+ /^ Version\{.*\}$/p
+ /^\}$/p' $i
+done
+
+# Chrome on Android is not localized to the following languages and we
+# have to minimize the locale data for them.
+EXTRA_LANGUAGES="bn et gu kn ml mr ms ta te"
+
+# TODO(jshin): Copied from scripts/trim_data.sh. Need to refactor.
+echo Creating minimum locale data in locales
+for lang in ${EXTRA_LANGUAGES}
+do
+ target=locales/${lang}.txt
+ [ -e ${target} ] || { echo "missing ${lang}"; continue; }
+ echo Overwriting ${target} ...
+
+ # Do not include '%%Parent' line on purpose.
+ sed -n -r -i \
+ '1, /^'${lang}'\{$/p
+ /^ "%%ALIAS"\{/p
+ /^ AuxExemplarCharacters\{.*\}$/p
+ /^ AuxExemplarCharacters\{$/, /^ \}$/p
+ /^ ExemplarCharacters\{.*\}$/p
+ /^ ExemplarCharacters\{$/, /^ \}$/p
+ /^ (LocaleScript|layout)\{$/, /^ \}$/p
+ /^ Version\{.*$/p
+ /^\}$/p' ${target}
+done
+
+echo Overwriting curr/reslocal.mk to drop the currency names
+echo for ${EXTRA_LANGUAGES}
+for lang in ${EXTRA_LANGUAGES}
+do
+ sed -i -e '/'$lang'.txt/ d' curr/reslocal.mk
+done
+
# Excludes region data. On Android Java API is used to get the data.
echo Overwriting region/reslocal.mk...
cat >region/reslocal.mk <<END
-REGION_CLDR_VERSION = 1.9
+REGION_CLDR_VERSION = %version%
REGION_SYNTHETIC_ALIAS =
REGION_ALIAS_SOURCE =
REGION_SOURCE =
« no previous file with comments | « android/icudtl.dat ('k') | patches/vscomp.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698