Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #3568: Add Japanese default favorites.
Browse files Browse the repository at this point in the history
  • Loading branch information
iccub committed Jul 16, 2021
1 parent c3c3b3d commit fc963af
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
Binary file added Client/Assets/TopSites/yahoo-jp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Client/Assets/top_sites.json
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,13 @@
"background_color": "#5009a7",
"domain": "yahoo.com"
},
{
"title": "yahoo-jp",
"url": "https://yahoo.co.jp/",
"image_url": "yahoo-jp.png",
"background_color": "#ffffff",
"domain": "yahoo.co.jp"
},
{
"title": "yelp",
"url": "http://yelp.com/",
Expand Down
24 changes: 24 additions & 0 deletions Client/Frontend/Browser/Favorites/PreloadedFavorites.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,28 @@ struct PreloadedFavorites {

return list
}

func appendJapaneseWebsites() -> [FavoriteSite] {
var list = [FavoriteSite]()

if let url = URL(string: "https://m.youtube.com/") {
list.append(FavoriteSite(url: url, title: "YouTube"))
}

if let url = URL(string: "https://m.yahoo.co.jp/") {
list.append(FavoriteSite(url: url, title: "Yahoo! Japan"))
}

if let url = URL(string: "https://brave.com/ja/ntp-tutorial") {
list.append(FavoriteSite(url: url, title: "Braveガイド"))
}

if let url = URL(string: "https://mobile.twitter.com/") {
list.append(FavoriteSite(url: url, title: "Twitter"))
}

return list
}

var preloadedFavorites = [FavoriteSite]()

Expand All @@ -55,6 +77,8 @@ struct PreloadedFavorites {
// try? list.append(FavoriteSite(url: "https://allegro.pl/".asURL(), title: "Allegro"))
preloadedFavorites += appendPopularEnglishWebsites()
break
case "JP":
preloadedFavorites += appendJapaneseWebsites()
default:
preloadedFavorites += appendPopularEnglishWebsites()
}
Expand Down

0 comments on commit fc963af

Please sign in to comment.