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

Unified Diff: scripts/trim_data.sh

Issue 264973016: Add back display names for non-UI languages in A-L list (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/icu52/
Patch Set: Created 6 years, 7 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 | « scripts/chrome_ui_languages.list ('k') | source/data/in/icudtl.dat » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/trim_data.sh
===================================================================
--- scripts/trim_data.sh (revision 267387)
+++ scripts/trim_data.sh (working copy)
@@ -7,17 +7,24 @@
# Remove display names for languages that are not listed in the accept-language
# list of Chromium.
function filter_display_language_names {
- UI_LANG_PATTERN="(${UI_LANGUAGES})[^a-z]"
+ for lang in $(grep -v '^#' accept_lang.list)
+ do
+ # Set $OP to '|' only if $ACCEPT_LANG_PATTERN is not empty.
+ OP=${ACCEPT_LANG_PATTERN:+|}
+ ACCEPT_LANG_PATTERN="${ACCEPT_LANG_PATTERN}${OP}${lang}"
+ done
+ ACCEPT_LANG_PATTERN="(${ACCEPT_LANG_PATTERN})[^a-z]"
- echo "Filtering out display names for non-UI languages in ${langdatapath}"
+ echo "Filtering out display names for non-A-L languages ${langdatapath}"
for lang in $(grep -v '^#' chrome_ui_languages.list)
do
target=${langdatapath}/${lang}.txt
+ echo Overwriting ${target} ...
sed -r -i \
'/^ Keys\{$/,/^ \}$/d
/^ Languages\{$/, /^ \}$/ {
/^ Languages\{$/p
- /^ '${UI_LANG_PATTERN}'/p
+ /^ '${ACCEPT_LANG_PATTERN}'/p
/^ \}$/p
d
}
@@ -29,6 +36,13 @@
# Keep only the minimum locale data for non-UI languages.
function abridge_locale_data_for_non_ui_languages {
+ for lang in $(grep -v '^#' chrome_ui_languages.list)
+ do
+ # Set $OP to '|' only if $UI_LANGUAGES is not empty.
+ OP=${UI_LANGUAGES:+|}
+ UI_LANGUAGES="${UI_LANGUAGES}${OP}${lang}"
+ done
+
EXTRA_LANGUAGES=$(egrep -v -e '^#' -e "(${UI_LANGUAGES})" accept_lang.list)
echo Creating minimum locale data in ${localedatapath}
@@ -39,6 +53,7 @@
echo Overwriting ${target} ...
sed -n -r -i \
'1, /^'${lang}'\{$/p
+ /^ "%%ALIAS"\{/p
/^ AuxExemplarCharacters\{.*\}$/p
/^ AuxExemplarCharacters\{$/, /^ \}$/p
/^ ExemplarCharacters\{.*\}$/p
@@ -108,7 +123,7 @@
# Keep only duration and compound in units* sections.
function filter_locale_data {
- for i in "${dataroot}/locales/*.txt"
+ for i in ${dataroot}/locales/*.txt
do
echo Overwriting $i ...
sed -r -i \
@@ -133,12 +148,6 @@
localedatapath="${dataroot}/locales"
langdatapath="${dataroot}/lang"
-for lang in $(grep -v '^#' chrome_ui_languages.list)
-do
- # Set $OP to '|' only if $UI_LANGUAGES is not empty.
- OP=${UI_LANGUAGES:+|}
- UI_LANGUAGES="${UI_LANGUAGES}${OP}${lang}"
-done
filter_display_language_names
« no previous file with comments | « scripts/chrome_ui_languages.list ('k') | source/data/in/icudtl.dat » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698