From fc963af2180c3ddbbb1d7b5163896fd388ef8a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Buczek?= Date: Thu, 15 Jul 2021 15:59:42 +0200 Subject: [PATCH] Fix #3568: Add Japanese default favorites. --- Client/Assets/TopSites/yahoo-jp.png | Bin 0 -> 2017 bytes Client/Assets/top_sites.json | 7 +++++ .../Favorites/PreloadedFavorites.swift | 24 ++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 Client/Assets/TopSites/yahoo-jp.png diff --git a/Client/Assets/TopSites/yahoo-jp.png b/Client/Assets/TopSites/yahoo-jp.png new file mode 100644 index 0000000000000000000000000000000000000000..22e6fc83b9354a605fc2b57e668d1a2d233a066d GIT binary patch literal 2017 zcmY*ac|2768$L4#qmk`qy%{6fXBbhYG08gCkToUSV8W0YTO&)k*S>ShR`y(pYpo$E z_hxI5kf;$N`*K|wx|Tbme)@IJ=bZO>-}m`G&-Xold{3N(xgiuH1_1y7YJ}6XVn%J& z!*z)Ht{_|+V+Ih(%1{TW>Xn#dCKh;mBM&n(K!J(505C`ZU}I63HxNSr*!M92oM1)( zU@HK9?-qa$y4nS7-!Y45o#<1=6mcL}+mr3hOwn$Bz6ck0KUX{=#Mhri05BnFCiKOV zU0@-;K132aL<_#pKr=C`jD*AXDP(UgxV@PLOxG^}57R)XAXMO32n+_p1h{*kt@I4O zEoWw0a4$01AB{u?2L~g9)ewFGo=8h>(*!2~aEu!1owE)BE#=&Z z9n=@;xHqDuzm$ZFHCF60HvWCN@+AsVSkR`IDo|W-wi|bAtReMgw^Gq@h3l5HDe;K- zw%B?dFm!(1X-a3HynL}opqf#%O#FhOJbF~u+`84WxLjzbrgBEDZvpcmbdMevEyTyg z#m)`}gQ6m}wP7&6gLLm_aJ%u#pdu`uUAnacH`5~R)ruIqAGIXCEsGe=TwH^HSOVoQsly)zH+JU>>`v;pwcKKb0>}!uZ?__XKirs8R z7`GRG=ATuPrvJ?A+iLePPc>n;x@^xcc4}C3L`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bb..29ba718f128 100755 --- a/Client/Assets/top_sites.json +++ b/Client/Assets/top_sites.json @@ -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/", diff --git a/Client/Frontend/Browser/Favorites/PreloadedFavorites.swift b/Client/Frontend/Browser/Favorites/PreloadedFavorites.swift index 2c4169e5abd..0ea0a092369 100644 --- a/Client/Frontend/Browser/Favorites/PreloadedFavorites.swift +++ b/Client/Frontend/Browser/Favorites/PreloadedFavorites.swift @@ -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]() @@ -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() }