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

Unified Diff: ios/patch_locale.sh

Issue 2743123002: ICU data customization for iOS (Closed)
Patch Set: update BUILD.gn and icudtl.dat for iOS Created 3 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 | « ios/icudtl.dat ('k') | scripts/copy_data.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/patch_locale.sh
diff --git a/ios/patch_locale.sh b/ios/patch_locale.sh
new file mode 100755
index 0000000000000000000000000000000000000000..6b8b214c21290866bee294c26a264cdd90e3c657
--- /dev/null
+++ b/ios/patch_locale.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+treeroot="$(dirname "$0")/.."
+cd "${treeroot}"
+
+cd source/data
+
+# Keep only two common calendars. Add locale-specific calendars to Thai.
+COMMON_CALENDARS="gregorian|generic"
+for i in locales/*.txt; do
+ CALENDARS="${COMMON_CALENDARS}"
+ case $(basename $i .txt | sed 's/_.*$//') in
+ th)
+ EXTRA_CAL='buddhist'
+ ;;
+ *)
+ EXTRA_CAL=''
+ ;;
+ esac
+
+ CAL_PATTERN="(${COMMON_CALENDARS}${EXTRA_CAL:+|${EXTRA_CAL}})"
+ echo $CAL_PATTERN
+
+ echo Overwriting $i...
+ sed -r '/^ calendar\{$/,/^ \}$/ {
+ /^ calendar\{$/p
+ /^ default\{".*"\}$/p
+ /^ '${CAL_PATTERN}'\{$/, /^ \}$/p
+ /^ \}$/p
+ d
+ }' -i $i
+done
+
+echo DONE.
« no previous file with comments | « ios/icudtl.dat ('k') | scripts/copy_data.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698