For #16451 - Change default top sites to Baidu & JD in China build (#16515)

* Add top sites related strings

* Change default top sites to Baidu & JD in China build
upstream-sync
rxumoz 4 years ago committed by GitHub
parent 7499d33b32
commit 409041ae3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -327,28 +327,44 @@ class Core(
strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
if (!context.settings().defaultTopSitesAdded) {
defaultTopSites.add(
Pair(
context.getString(R.string.default_top_site_google),
SupportUtils.GOOGLE_URL
if (Config.channel.isMozillaOnline) {
defaultTopSites.add(
Pair(
context.getString(R.string.default_top_site_baidu),
SupportUtils.BAIDU_URL
)
)
)
if (LocaleManager.getSelectedLocale(context).language == "en") {
defaultTopSites.add(
Pair(
context.getString(R.string.pocket_pinned_top_articles),
SupportUtils.POCKET_TRENDING_URL
context.getString(R.string.default_top_site_jd),
SupportUtils.JD_URL
)
)
} else {
defaultTopSites.add(
Pair(
context.getString(R.string.default_top_site_google),
SupportUtils.GOOGLE_URL
)
)
}
defaultTopSites.add(
Pair(
context.getString(R.string.default_top_site_wikipedia),
SupportUtils.WIKIPEDIA_URL
if (LocaleManager.getSelectedLocale(context).language == "en") {
defaultTopSites.add(
Pair(
context.getString(R.string.pocket_pinned_top_articles),
SupportUtils.POCKET_TRENDING_URL
)
)
}
defaultTopSites.add(
Pair(
context.getString(R.string.default_top_site_wikipedia),
SupportUtils.WIKIPEDIA_URL
)
)
)
}
context.settings().defaultTopSitesAdded = true
}

@ -72,6 +72,12 @@ class TopSiteItemViewHolder(
SupportUtils.POCKET_TRENDING_URL -> {
favicon_image.setImageDrawable(getDrawable(itemView.context, R.drawable.ic_pocket))
}
SupportUtils.BAIDU_URL -> {
favicon_image.setImageDrawable(getDrawable(itemView.context, R.drawable.ic_baidu))
}
SupportUtils.JD_URL -> {
favicon_image.setImageDrawable(getDrawable(itemView.context, R.drawable.ic_jd))
}
else -> {
itemView.context.components.core.icons.loadIntoView(favicon_image, topSite.url)
}

@ -26,6 +26,11 @@ object SupportUtils {
const val FIREFOX_BETA_PLAY_STORE_URL = "market://details?id=org.mozilla.firefox_beta"
const val FIREFOX_NIGHTLY_PLAY_STORE_URL = "market://details?id=org.mozilla.fenix"
const val GOOGLE_URL = "https://www.google.com/"
const val BAIDU_URL = "https://m.baidu.com/?from=1000969a"
const val JD_URL = "https://union-click.jd.com/jdc" +
"?e=&p=AyIGZRprFDJWWA1FBCVbV0IUWVALHFRBEwQAQB1AWQkFVUVXfFkAF14lRFRbJXstVWR3WQ1rJ08AZnhS" +
"HDJBYh4LZR9eEAMUBlccWCUBEQZRGFoXCxc3ZRteJUl8BmUZWhQ" +
"AEwdRGF0cMhIAVB5ZFAETBVAaXRwyFQdcKydLSUpaCEtYFAIXN2UrWCUyIgdVK1slXVZaCCtZFAMWDg%3D%3D"
enum class SumoTopic(internal val topicStr: String) {
FENIX_MOVING("sync-delist"),

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

@ -23,6 +23,11 @@
<!-- No Private Tabs Message Description -->
<string name="no_private_tabs_description">您的隐私标签页将显示于此。</string>
<!-- Default title for pinned Baidu top site that links to Baidu home page -->
<string name="default_top_site_baidu">百度</string>
<!-- Default title for pinned JD top site that links to JD home page -->
<string name="default_top_site_jd">京东</string>
<!-- Message announced to the user when tab tray is selected with 1 tab -->
<string name="open_tab_tray_single">打开了 1 个标签页,点击即可切换。</string>
<!-- Message announced to the user when tab tray is selected with 0 or 2+ tabs -->

@ -19,6 +19,10 @@
<string name="no_open_tabs_description">Your open tabs will be shown here.</string>
<!-- No Private Tabs Message Description -->
<string name="no_private_tabs_description">Your private tabs will be shown here.</string>
<!-- Default title for pinned Baidu top site that links to Baidu home page -->
<string name="default_top_site_baidu">Baidu</string>
<!-- Default title for pinned JD top site that links to JD home page -->
<string name="default_top_site_jd">JD</string>
<!-- Message announced to the user when tab tray is selected with 1 tab -->
<string name="open_tab_tray_single">1 open tab. Tap to switch tabs.</string>
<!-- Message announced to the user when tab tray is selected with 0 or 2+ tabs -->

Loading…
Cancel
Save