diff options
-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 9d5130f..a3a84fb 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -4487,9 +4487,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"; |