diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-07 13:57:12 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-05-07 13:57:12 -0700 |
commit | 4c5cea0286f5b8be8c1b2d61444f0539ffb58511 (patch) | |
tree | abb5cbeb62cad77e965dd5f657a93976d16a9da7 | |
parent | d4134ea4af9389f80b82c1dec14e31ac7f78f8ad (diff) | |
parent | 910ac1a8b53218984608d0d4ebde767f2c6c7f63 (diff) | |
download | packages_apps_Browser-4c5cea0286f5b8be8c1b2d61444f0539ffb58511.zip packages_apps_Browser-4c5cea0286f5b8be8c1b2d61444f0539ffb58511.tar.gz packages_apps_Browser-4c5cea0286f5b8be8c1b2d61444f0539ffb58511.tar.bz2 |
am 910ac1a: Merge change 1006 into donut
Merge commit '910ac1a8b53218984608d0d4ebde767f2c6c7f63'
* commit '910ac1a8b53218984608d0d4ebde767f2c6c7f63':
Update google_search_base for chinese language.
-rw-r--r-- | res/values-zh-rCN/strings.xml | 4 | ||||
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 21 |
2 files changed, 23 insertions, 2 deletions
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index d0368bb..c8fad06 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -15,6 +15,10 @@ --> <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- Do not translate. This string is an internal URI, not seen in the UI. --> + <string name="google_search_base" translatable="false"> + http://www.google.cn/m?hl=%1$s&gl=%2$s&</string> + <string name="application_name">"浏览器"</string> <string name="tab_bookmarks">"书签"</string> <string name="tab_most_visited">"访问最多的网站"</string> diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index bd68109..ebfc30e 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -4535,9 +4535,26 @@ public class BrowserActivity extends Activity * mcc-specific xml files.) */ Locale l = Locale.getDefault(); + String language = l.getLanguage(); + String country = l.getCountry().toLowerCase(); + // Chinese and Portuguese have two langauge variants. + if ("zh".equals(language)) { + if ("cn".equals(country)) { + language = "zh-CN"; + } else if ("tw".equals(country)) { + language = "zh-TW"; + } + } else if ("pt".equals(language)) { + if ("br".equals(country)) { + language = "pt-BR"; + } else if ("pt".equals(country)) { + language = "pt-PT"; + } + } QuickSearch_G = getResources().getString( - R.string.google_search_base, l.getLanguage(), - l.getCountry().toLowerCase()) + R.string.google_search_base, + language, + country) + "client=ms-" + Partner.getString(this.getContentResolver(), Partner.CLIENT_ID) + "&source=android-" + GOOGLE_SEARCH_SOURCE_SUGGEST + "&q=%s"; |