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. |