Refactored player. Refactored changelog system. Players isn't localized
Related Work Items: #161, #211, #238
This commit is contained in:
@@ -1,10 +1,39 @@
|
||||
using Windows.Data.Xml.Dom;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Windows.ApplicationModel.Resources;
|
||||
using Windows.Data.Xml.Dom;
|
||||
using Windows.Storage;
|
||||
using Windows.UI.Notifications;
|
||||
|
||||
namespace FoxTube.Background
|
||||
{
|
||||
public static class Notification
|
||||
{
|
||||
private static Dictionary<string, string> languagePack = LoadPack();
|
||||
|
||||
private static Dictionary<string, string> LoadPack()
|
||||
{
|
||||
object[] saved = JsonConvert.DeserializeObject<object[]>(ApplicationData.Current.RoamingSettings.Values["settings"] as string);
|
||||
if (saved[7] as string == "ru-RU")
|
||||
return new Dictionary<string, string>()
|
||||
{
|
||||
{ "addLater", "Добавить в Посмотреть позже" },
|
||||
{ "changelog", "Список изменений" },
|
||||
{ "changelogHeader", "Что нового в версии" },
|
||||
{ "videoContent", "загрузил новое видео" },
|
||||
{ "goChannel", "Открыть канал" }
|
||||
};
|
||||
else
|
||||
return new Dictionary<string, string>()
|
||||
{
|
||||
{ "addLater", "Add to Watch later" },
|
||||
{ "changelog", "Changelog" },
|
||||
{ "changelogHeader", "What's new in version" },
|
||||
{ "videoContent", "uploaded a new video" },
|
||||
{ "goChannel", "Go to channel" }
|
||||
};
|
||||
}
|
||||
|
||||
public static ToastNotification GetChangelogToast(string version)
|
||||
{
|
||||
XmlDocument template = new XmlDocument();
|
||||
@@ -14,8 +43,8 @@ namespace FoxTube.Background
|
||||
<binding template='ToastGeneric'>
|
||||
<image placement='hero' src='http://foxgame-studio.000webhostapp.com/FoxTubeAssets/WhatsNewThumb.png'/>
|
||||
<image placement='appLogoOverride' hint-crop='circle' src='http://foxgame-studio.000webhostapp.com/FoxTubeAssets/NewsAvatar.png'/>
|
||||
<text>Changelog</text>
|
||||
<text>See what's new in version {version}</text>
|
||||
<text>{languagePack["changelog"]}</text>
|
||||
<text>{languagePack["changelogHeader"]} {version}</text>
|
||||
</binding>
|
||||
</visual>
|
||||
</toast>");
|
||||
@@ -33,13 +62,13 @@ namespace FoxTube.Background
|
||||
<image placement='hero' src='{thumbnail.Replace("&", "%26")}'/>
|
||||
<image placement='appLogoOverride' hint-crop='circle' src='{avatar.Replace("&", "%26") ?? "http://foxgame-studio.000webhostapp.com/FoxTubeAssets/LogoAvatar.png"}'/>
|
||||
<text>{title}</text>
|
||||
<text>{channel} uploaded a new video</text>
|
||||
<text>{channel} {languagePack["videoContent"]}</text>
|
||||
</binding>
|
||||
</visual>
|
||||
|
||||
<actions>
|
||||
<action content='Add to Watch later' activationType='background' arguments='later|{id}'/>
|
||||
<action content='Go to channel' activationType='foreground' arguments='channel|{channelId}'/>
|
||||
<action content='{languagePack["addLater"]}' activationType='background' arguments='later|{id}'/>
|
||||
<action content='{languagePack["goChannel"]}' activationType='foreground' arguments='channel|{channelId}'/>
|
||||
</actions>
|
||||
</toast>");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user