From 497e80d1172bccdc682af6b545371f6acf30c8ef Mon Sep 17 00:00:00 2001 From: ccetl <109693935+ccetl@users.noreply.github.com> Date: Sun, 28 Sep 2025 14:14:44 +0200 Subject: [PATCH 1/4] feat: allow localization and support english --- .gitignore | 3 + Core/Librarys/Time.cs | 20 +- Core/Models/Config/BehaviorModel.cs | 37 +- Core/Models/Config/GeneralModel.cs | 56 +- Core/Models/Config/Link/LinkModel.cs | 4 +- UI/App.xaml.cs | 1 + UI/Controls/Charts/Charts.cs | 4 +- UI/Controls/Charts/ChartsItemTypeRadar.cs | 3 +- UI/Controls/SettingPanel/SettingPanel.cs | 9 +- UI/Controls/SettingPanel/SettingPanelItem.cs | 9 +- .../SettingPanel/SettingPanelMultiItem.cs | 9 +- UI/Controls/Tabbar/Tabbar.cs | 12 +- UI/Markup/LocalizationExtension.cs | 20 + UI/Models/CategoryAppListPageModel.cs | 3 + UI/Models/CategoryPageModel.cs | 3 + UI/Models/CategoryWebSiteListPageModel.cs | 3 + UI/Models/ChartPageModel.cs | 3 + UI/Models/DataPageModel.cs | 3 + UI/Models/DetailPageModel.cs | 5 +- UI/Models/IndexPageModel.cs | 3 + UI/Models/LocalizedView.cs | 20 + UI/Models/MainWindowModel.cs | 5 +- UI/Models/ModelBase.cs | 5 +- UI/Models/SettingPageModel.cs | 5 +- UI/Properties/AssemblyInfo.cs | 3 + .../Localization/Localization.Designer.cs | 737 ++++++++++++++++++ UI/Resources/Localization/Localization.resx | 277 +++++++ .../Localization.zh-CN.Designer.cs | 737 ++++++++++++++++++ .../Localization/Localization.zh-CN.resx | 279 +++++++ UI/Servicers/ILocalizationServicer.cs | 9 + UI/Servicers/LocalizationServicer.cs | 42 + UI/Themes/SettingPanel/SettingPanelItem.xaml | 2 +- UI/UI.csproj | 23 +- UI/ViewModels/CategoryAppListPageVM.cs | 3 +- UI/ViewModels/CategoryPageVM.cs | 8 +- UI/ViewModels/CategoryWebSiteListPageVM.cs | 6 +- UI/ViewModels/ChartPageVM.cs | 20 +- UI/ViewModels/DataPageVM.cs | 13 +- UI/ViewModels/DetailPageVM.cs | 33 +- UI/ViewModels/IndexPageVM.cs | 7 +- UI/ViewModels/MainViewModel.cs | 10 +- UI/ViewModels/SettingPageVM.cs | 18 +- UI/Views/SettingPage.xaml | 5 +- 43 files changed, 2385 insertions(+), 92 deletions(-) create mode 100644 UI/Markup/LocalizationExtension.cs create mode 100644 UI/Models/LocalizedView.cs create mode 100644 UI/Resources/Localization/Localization.Designer.cs create mode 100644 UI/Resources/Localization/Localization.resx create mode 100644 UI/Resources/Localization/Localization.zh-CN.Designer.cs create mode 100644 UI/Resources/Localization/Localization.zh-CN.resx create mode 100644 UI/Servicers/ILocalizationServicer.cs create mode 100644 UI/Servicers/LocalizationServicer.cs diff --git a/.gitignore b/.gitignore index f58b9be..7c0b77c 100644 --- a/.gitignore +++ b/.gitignore @@ -362,3 +362,6 @@ MigrationBackup/ # Fody - auto-generated XML schema FodyWeavers.xsd .vscode/settings.json + +# JetBrains Rider files +.idea/ diff --git a/Core/Librarys/Time.cs b/Core/Librarys/Time.cs index 670cc37..349f423 100644 --- a/Core/Librarys/Time.cs +++ b/Core/Librarys/Time.cs @@ -21,11 +21,12 @@ public static string ToHoursString(double seconds) return "0"; } } - public static string ToString(int seconds) + + public static object[] ToString(int seconds) { if (seconds < 60) { - return seconds + "秒"; + return new Object[]{"time.seconds", seconds}; } else { @@ -36,10 +37,13 @@ public static string ToString(int seconds) { double pointNumber = minutes - (int)minutes; int seconds_ = (int)(pointNumber * 60); - return (int)minutes + "分钟" + (seconds_ > 0 ? seconds_ + "秒" : ""); + if (seconds_ > 0) + { + return new Object[]{"time.minutesWithSeconds", (int) minutes, seconds_}; + } } - return minutes + "分钟"; + return new Object[]{"time.minutes", (int) minutes}; } else { @@ -48,9 +52,13 @@ public static string ToString(int seconds) { double pointNumber = hours - (int)hours; int minutes_ = (int)(pointNumber * 60); - return (int)hours + "小时" + (minutes_ > 0 ? minutes_ + "分" : ""); + if (minutes_ > 0) + { + return new Object[]{"time.hoursWithMinutes", (int) hours, minutes_}; + } } - return hours + "小时"; + + return new Object[]{"time.hours", (int) hours}; } } } diff --git a/Core/Models/Config/BehaviorModel.cs b/Core/Models/Config/BehaviorModel.cs index ce1d524..763fd97 100644 --- a/Core/Models/Config/BehaviorModel.cs +++ b/Core/Models/Config/BehaviorModel.cs @@ -11,32 +11,55 @@ namespace Core.Models.Config /// public class BehaviorModel { - [Config(Name = "睡眠监测", Description = "离开电脑时自动停止统计,重启软件生效。(一般情况不建议关闭)", Group = "偏好")] /// /// 睡眠监测 /// + [Config( + Name = "config.behaviorModel.isSleepWatch.name", + Description = "config.behaviorModel.isSleepWatch.description", + Group = "config.behaviorModel.group.isSleepWatch")] public bool IsSleepWatch { get; set; } = true; - [Config(IsCanImportExport = true, Name = "忽略应用", Description = "可以通过进程名称或者正则表达式进行匹配。当使用正则表达式时可以匹配程序路径", Group = "忽略应用", Placeholder = "进程名称,不需要输入.exe。支持正则表达式")] + /// /// 忽略的进程列表 /// + [Config( + IsCanImportExport = true, + Name = "config.behaviorModel.ignoreProcessList.name", + Description = "config.behaviorModel.ignoreProcessList.description", + Group = "config.behaviorModel.group.ignoreProcess", + Placeholder = "config.behaviorModel.ignoreProcessList.placeholder")] public List IgnoreProcessList { get; set; } = new List(); - [Config(IsCanImportExport = true, Name = "忽略URL", Description = "过滤不需要统计的网站或链接", Group = "忽略URL", Placeholder = "URL 支持正则表达式")] /// - /// 忽略的进程列表 + /// 忽略的 URL 列表 /// + [Config( + IsCanImportExport = true, + Name = "config.behaviorModel.ignoreURLList.name", + Description = "config.behaviorModel.ignoreURLList.description", + Group = "config.behaviorModel.group.ignoreURL", + Placeholder = "config.behaviorModel.ignoreURLList.placeholder")] public List IgnoreURLList { get; set; } = new List(); - [Config(Name = "应用白名单", Description = "仅统计白名单内的应用", Group = "应用白名单")] /// /// 睡眠监测 /// + [Config( + Name = "config.behaviorModel.isWhiteList.name", + Description = "config.behaviorModel.isWhiteList.description", + Group = "config.behaviorModel.group.whiteList")] public bool IsWhiteList { get; set; } = false; - [Config(IsCanImportExport = true, Name = "应用白名单", Description = "可以通过进程名称或者正则表达式进行匹配,当使用正则表达式时可以匹配程序路径", Group = "应用白名单", Placeholder = "进程名称,不需要输入.exe。支持正则表达式")] + /// /// 应用白名单 /// + [Config( + IsCanImportExport = true, + Name = "config.behaviorModel.processWhiteList.name", + Description = "config.behaviorModel.processWhiteList.description", + Group = "config.behaviorModel.group.whiteList", + Placeholder = "config.behaviorModel.processWhiteList.placeholder")] public List ProcessWhiteList { get; set; } = new List(); } -} +} \ No newline at end of file diff --git a/Core/Models/Config/GeneralModel.cs b/Core/Models/Config/GeneralModel.cs index 32e7409..d8be5e9 100644 --- a/Core/Models/Config/GeneralModel.cs +++ b/Core/Models/Config/GeneralModel.cs @@ -11,31 +11,48 @@ namespace Core.Models.Config /// public class GeneralModel { - [Config(Name = "开机自启动", Description = "在电脑启动时自动运行 Tai", Group = "基础")] /// /// 是否启用开机自启动 /// + [Config( + Name = "config.general.isStartAtBoot.name", + Description = "config.general.isStartAtBoot.description", + Group = "config.general.group.basic")] public bool IsStartatboot { get; set; } /// /// 主题模式 /// - [Config(Options = "浅色|深色", Name = "主题模式", Description = "设置以浅色或深色模式显示", Group = "外观")] + [Config( + Options = "config.general.theme.options", + Name = "config.general.theme.name", + Description = "config.general.theme.description", + Group = "config.general.group.appearance")] public int Theme { get; set; } = 0; + /// /// 主题颜色 /// - [Config(Name = "主题颜色", Description = "", Group = "外观")] + [Config( + Name = "config.general.themeColor.name", + Description = "config.general.themeColor.description", + Group = "config.general.group.appearance")] public string ThemeColor { get; set; } = "#2b20d9"; + /// /// 是否保留界面大小 /// - [Config(Name = "保留窗口大小", Description = "保留当前的窗口大小,而非使用系统默认尺寸", Group = "外观")] + [Config( + Name = "config.general.isSaveWindowSize.name", + Description = "config.general.isSaveWindowSize.description", + Group = "config.general.group.appearance")] public bool IsSaveWindowSize { get; set; } = false; + /// /// 窗口宽度 /// public double WindowWidth { get; set; } = 815; + /// /// 窗口高度 /// @@ -44,28 +61,49 @@ public class GeneralModel /// /// 启动页选择 /// - [Config(Options = "概览|统计|详细|分类", Name = "启动页", Description = "设置打开主界面时显示的页面", Group = "基础")] + [Config( + Options = "config.general.startPage.options", + Name = "config.general.startPage.name", + Description = "config.general.startPage.description", + Group = "config.general.group.basic")] public int StartPage { get; set; } = 0; - [Config(Name = "启动软件时显示主界面", Description = "在开机自启动时此选项无效", Group = "基础")] + /// /// 启动软件时显示主界面 /// + [Config( + Name = "config.general.isStartupShowMainWindow.name", + Description = "config.general.isStartupShowMainWindow.description", + Group = "config.general.group.basic")] public bool IsStartupShowMainWindow { get; set; } = true; + /// /// 概览页最为频繁显示条数 /// - [Config(Options = "1|2|3|4|5|6|7|8|9|10", Name = "最为频繁显示条数", Description = "", Group = "概览页")] + [Config( + Options = "config.general.indexPageFrequentUseNum.options", + Name = "config.general.indexPageFrequentUseNum.name", + Description = "config.general.indexPageFrequentUseNum.description", + Group = "config.general.group.overview")] public int IndexPageFrequentUseNum { get; set; } = 2; + /// /// 概览页最为频繁显示条数 /// - [Config(Options = "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20", Name = "更多显示条数", Description = "", Group = "概览页")] + [Config( + Options = "config.general.indexPageMoreNum.options", + Name = "config.general.indexPageMoreNum.name", + Description = "config.general.indexPageMoreNum.description", + Group = "config.general.group.overview")] public int IndexPageMoreNum { get; set; } = 11; /// /// 是否启用网站记录功能 /// - [Config(Name = "网站浏览统计", Description = "统计浏览器的网站访问数据,支持:Google Chrome、MSEdge或任何能够安装Chrome拓展的浏览器。请点击 “关于 > 浏览器统计插件” 了解如何安装和使用此功能。", Group = "功能")] + [Config( + Name = "config.general.isWebEnabled.name", + Description = "config.general.isWebEnabled.description", + Group = "config.general.group.feature")] public bool IsWebEnabled { get; set; } = false; } } \ No newline at end of file diff --git a/Core/Models/Config/Link/LinkModel.cs b/Core/Models/Config/Link/LinkModel.cs index 6f1a10e..cbd2a07 100644 --- a/Core/Models/Config/Link/LinkModel.cs +++ b/Core/Models/Config/Link/LinkModel.cs @@ -11,12 +11,12 @@ public class LinkModel /// /// 关联名称 /// - [Config(Name = "名称", Description = "设置一个名称用于识别该关联", IsName = true, IsCanRepeat = false)] + [Config(Name = "config.linkMode.name.name", Description = "config.linkMode.name.description", IsName = true, IsCanRepeat = false)] public string Name { get; set; } = "新的关联"; /// /// 关联进程列表 /// - [Config(Name = "关联进程", Description = "将需要关联的进程名称(不带.exe)添加到此,至少两个。", IsCanRepeat = false)] + [Config(Name = "config.linkMode.processList.name", Description = "config.linkMode.processList.description", IsCanRepeat = false)] public List ProcessList { get; set; } = new List(); } } diff --git a/UI/App.xaml.cs b/UI/App.xaml.cs index 94cf712..c779467 100644 --- a/UI/App.xaml.cs +++ b/UI/App.xaml.cs @@ -108,6 +108,7 @@ private void ConfigureServices(IServiceCollection services) services.AddSingleton(); // UI服务 + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); diff --git a/UI/Controls/Charts/Charts.cs b/UI/Controls/Charts/Charts.cs index 799c056..196202f 100644 --- a/UI/Controls/Charts/Charts.cs +++ b/UI/Controls/Charts/Charts.cs @@ -21,6 +21,8 @@ using UI.Controls.Charts.Model; using UI.Controls.Input; using UI.Extensions; +using UI.Models; +using UI.Servicers; namespace UI.Controls.Charts { @@ -1470,7 +1472,7 @@ private string Covervalue(double value) { if (DataValueType == ChartDataValueType.Seconds) { - return Time.ToString((int)value); + return LocalizationServicer.Instance.Translated(Time.ToString((int)value)); } else { diff --git a/UI/Controls/Charts/ChartsItemTypeRadar.cs b/UI/Controls/Charts/ChartsItemTypeRadar.cs index 671ea3e..dbba603 100644 --- a/UI/Controls/Charts/ChartsItemTypeRadar.cs +++ b/UI/Controls/Charts/ChartsItemTypeRadar.cs @@ -18,6 +18,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; using UI.Controls.Charts.Model; +using UI.Servicers; namespace UI.Controls.Charts { @@ -176,7 +177,7 @@ private void Render() font.Text = Data[i].Name.Length > 4 ? Data[i].Name.Substring(0, 4) : Data[i].Name; font.Foreground = UI.Base.Color.Colors.GetFromString("#7f7f7f"); font.FontSize = 12; - font.ToolTip = $"{Data[i].Name} {Time.ToString((int)Data[i].Values.Sum())}"; + font.ToolTip = $"{Data[i].Name} {LocalizationServicer.Instance.Translated(Time.ToString((int)Data[i].Values.Sum()))}"; var textSize = MeasureString(font); Debug.WriteLine(font.Text + " -> " + angle * i); diff --git a/UI/Controls/SettingPanel/SettingPanel.cs b/UI/Controls/SettingPanel/SettingPanel.cs index 558bb29..1257c23 100644 --- a/UI/Controls/SettingPanel/SettingPanel.cs +++ b/UI/Controls/SettingPanel/SettingPanel.cs @@ -18,6 +18,7 @@ using UI.Controls.Input; using UI.Controls.List; using UI.Controls.Select; +using UI.Servicers; namespace UI.Controls.SettingPanel { @@ -299,7 +300,7 @@ private StackPanel GetCreateGroupContainer(UIElement item, string groupName = nu if (groupName != null) { var groupNameControl = new TextBlock(); - groupNameControl.Text = groupName; + groupNameControl.Text = LocalizationServicer.Instance.Translated(groupName); groupNameControl.FontSize = 14; groupNameControl.Margin = new Thickness(0, 0, 0, 10); container.Children.Add(groupNameControl); @@ -377,7 +378,7 @@ private UIElement RenderColorConfigControl(ConfigAttribute configAttribute, Prop private UIElement RenderOptionsConfigControl(ConfigAttribute configAttribute, PropertyInfo pi) { var control = new Select.Select(); - var optionsArr = configAttribute.Options.Split('|'); + var optionsArr = LocalizationServicer.Instance.Translated(configAttribute.Options).Split('|'); var options = new List(); for (int i = 0; i < optionsArr.Length; i++) @@ -493,7 +494,7 @@ private UIElement RenderListStringConfigControl(ConfigAttribute configAttribute, // 添加输入框 var addInputBox = new InputBox(); - addInputBox.Placeholder = configAttribute.Placeholder; + addInputBox.Placeholder = LocalizationServicer.Instance.Translated(configAttribute.Placeholder); addInputBox.Margin = new Thickness(0, 0, 10, 0); @@ -635,7 +636,7 @@ private UIElement RenderListStringConfigControl(ConfigAttribute configAttribute, // 标题和说明 var description = new TextBlock(); - description.Text = configAttribute.Description; + description.Text = LocalizationServicer.Instance.Translated(configAttribute.Description); description.Margin = new Thickness(10, 10, 10, 0); description.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#989CA1")); var container = new StackPanel(); diff --git a/UI/Controls/SettingPanel/SettingPanelItem.cs b/UI/Controls/SettingPanel/SettingPanelItem.cs index c3f640c..8dae922 100644 --- a/UI/Controls/SettingPanel/SettingPanelItem.cs +++ b/UI/Controls/SettingPanel/SettingPanelItem.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; +using UI.Servicers; namespace UI.Controls.SettingPanel { @@ -29,6 +30,9 @@ public class SettingPanelItem : Control public bool IsBeta { get { return (bool)GetValue(IsBetaProperty); } set { SetValue(IsBetaProperty, value); } } public static readonly DependencyProperty IsBetaProperty = DependencyProperty.Register("IsBeta", typeof(bool), typeof(SettingPanelItem)); + public string DisplayName { get { return (string)GetValue(DisplayNameProperty); } set { SetValue(DisplayNameProperty, value); } } + public static readonly DependencyProperty DisplayNameProperty = DependencyProperty.Register("DisplayName", typeof(string), typeof(SettingPanelItem)); + public SettingPanelItem() { DefaultStyleKey = typeof(SettingPanelItem); @@ -36,8 +40,9 @@ public SettingPanelItem() public void Init(ConfigAttribute configAttribute_, object content_) { - Name = configAttribute_.Name; - Description = configAttribute_.Description; + Name = configAttribute_.Name.Replace(".", "_"); + DisplayName = LocalizationServicer.Instance.Translated(configAttribute_.Name); + Description = LocalizationServicer.Instance.Translated(configAttribute_.Description); IsBeta = configAttribute_.IsBeta; Content = content_; } diff --git a/UI/Controls/SettingPanel/SettingPanelMultiItem.cs b/UI/Controls/SettingPanel/SettingPanelMultiItem.cs index 527e3ae..941cf48 100644 --- a/UI/Controls/SettingPanel/SettingPanelMultiItem.cs +++ b/UI/Controls/SettingPanel/SettingPanelMultiItem.cs @@ -15,6 +15,7 @@ using UI.Controls.Button; using UI.Controls.Input; using UI.Controls.List; +using UI.Servicers; namespace UI.Controls.SettingPanel { @@ -117,8 +118,8 @@ private void Render() private void RenderStringList(ConfigAttribute attribute, PropertyInfo pi) { var title = new SettingPanelItem(); - title.Name = attribute.Name; - title.Description = attribute.Description; + title.Name = LocalizationServicer.Instance.Translated(attribute.Name); + title.Description = LocalizationServicer.Instance.Translated(attribute.Description); Container.Children.Add(title); @@ -319,8 +320,8 @@ private void RenderTextBox(ConfigAttribute attribute, PropertyInfo pi) }; var item = new SettingPanelItem(); - item.Name = attribute.Name; - item.Description = attribute.Description; + item.Name = LocalizationServicer.Instance.Translated(attribute.Name); + item.Description = LocalizationServicer.Instance.Translated(attribute.Description); item.Content = textBox; pi.SetValue(configData, textBox.Text); if (attribute.IsName) diff --git a/UI/Controls/Tabbar/Tabbar.cs b/UI/Controls/Tabbar/Tabbar.cs index 0e8b2c8..b6be45d 100644 --- a/UI/Controls/Tabbar/Tabbar.cs +++ b/UI/Controls/Tabbar/Tabbar.cs @@ -199,15 +199,11 @@ private void ScrollToActive(int oldSelectedIndex = 0) var oldSelectedItem = ItemsDictionary[oldSelectedIndex]; // 选中项的坐标 - Point relativePoint = item.TransformToAncestor(this).Transform(new Point(0, 0)); - - double scrollX = relativePoint.X; - - scrollX = scrollX < 0 ? 0 : scrollX; - scrollAnimation.To = scrollX; - - + double leftOffset = item.TransformToAncestor(ItemsContainer).Transform(new Point(0, 0)).X; + scrollAnimation.To = leftOffset; + + ActiveBlock.Width = item.ActualWidth; // 文字颜色动画 diff --git a/UI/Markup/LocalizationExtension.cs b/UI/Markup/LocalizationExtension.cs new file mode 100644 index 0000000..5943812 --- /dev/null +++ b/UI/Markup/LocalizationExtension.cs @@ -0,0 +1,20 @@ +using System; +using System.Windows.Markup; +using UI.Servicers; + +namespace UI.Markup +{ + public class LocalizationExtension : MarkupExtension + { + public string Key { get; set; } + public object Arg0 { get; set; } + public object Arg1 { get; set; } + + public override object ProvideValue(IServiceProvider serviceProvider) + { + var args = new [] { Arg0, Arg1 }; + var filteredArgs = Array.FindAll(args, x => x != null); + return LocalizationServicer.Instance.Translated(Key, filteredArgs); + } + } +} \ No newline at end of file diff --git a/UI/Models/CategoryAppListPageModel.cs b/UI/Models/CategoryAppListPageModel.cs index 93873c9..a1156a4 100644 --- a/UI/Models/CategoryAppListPageModel.cs +++ b/UI/Models/CategoryAppListPageModel.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using System.Windows; using UI.Models.CategoryAppList; +using UI.Servicers; namespace UI.Models { @@ -31,5 +32,7 @@ public class CategoryAppListPageModel : ModelBase private string SearchInput_; public string SearchInput { get { return SearchInput_; } set { SearchInput_ = value; OnPropertyChanged(); } } + + protected CategoryAppListPageModel(ILocalizationServicer localizationServicer) : base(localizationServicer) {} } } diff --git a/UI/Models/CategoryPageModel.cs b/UI/Models/CategoryPageModel.cs index f02aa29..65a3229 100644 --- a/UI/Models/CategoryPageModel.cs +++ b/UI/Models/CategoryPageModel.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using System.Windows; using UI.Models.Category; +using UI.Servicers; namespace UI.Models { @@ -85,5 +86,7 @@ public class WebCategoryModel private WebCategoryModel SelectedWebCategoryItem_; public WebCategoryModel SelectedWebCategoryItem { get { return SelectedWebCategoryItem_; } set { SelectedWebCategoryItem_ = value; OnPropertyChanged(); } } + + protected CategoryPageModel(ILocalizationServicer localizationServicer) : base(localizationServicer) {} } } \ No newline at end of file diff --git a/UI/Models/CategoryWebSiteListPageModel.cs b/UI/Models/CategoryWebSiteListPageModel.cs index 2567d9e..a123556 100644 --- a/UI/Models/CategoryWebSiteListPageModel.cs +++ b/UI/Models/CategoryWebSiteListPageModel.cs @@ -9,6 +9,7 @@ using System.Windows; using UI.Controls.Select; using UI.Models.CategoryAppList; +using UI.Servicers; namespace UI.Models { @@ -46,5 +47,7 @@ public class OptionModel /// 站点可选列表 /// public List WebSiteOptionList { get { return WebSiteOptionList_; } set { WebSiteOptionList_ = value; OnPropertyChanged(); } } + + protected CategoryWebSiteListPageModel(ILocalizationServicer localizationServicer) : base(localizationServicer) {} } } diff --git a/UI/Models/ChartPageModel.cs b/UI/Models/ChartPageModel.cs index 04d67c8..538f702 100644 --- a/UI/Models/ChartPageModel.cs +++ b/UI/Models/ChartPageModel.cs @@ -7,6 +7,7 @@ using System.Windows.Controls; using UI.Controls.Charts.Model; using UI.Controls.Select; +using UI.Servicers; namespace UI.Models { @@ -246,5 +247,7 @@ public List DayHoursData /// public ContextMenu WebSiteContextMenu { get { return WebSiteContextMenu_; } set { WebSiteContextMenu_ = value; OnPropertyChanged(); } } #endregion + + protected ChartPageModel(ILocalizationServicer localizationServicer) : base(localizationServicer) {} } } diff --git a/UI/Models/DataPageModel.cs b/UI/Models/DataPageModel.cs index 332cdd9..63adc85 100644 --- a/UI/Models/DataPageModel.cs +++ b/UI/Models/DataPageModel.cs @@ -7,6 +7,7 @@ using System.Windows.Controls; using UI.Controls.Charts.Model; using UI.Controls.DatePickerBar; +using UI.Servicers; namespace UI.Models { @@ -98,5 +99,7 @@ public DateTime YearDate private ContextMenu AppContextMenu_; public ContextMenu AppContextMenu { get { return AppContextMenu_; } set { AppContextMenu_ = value; OnPropertyChanged(); } } + + protected DataPageModel(ILocalizationServicer localizationServicer) : base(localizationServicer) {} } } diff --git a/UI/Models/DetailPageModel.cs b/UI/Models/DetailPageModel.cs index ea19b52..e33a9af 100644 --- a/UI/Models/DetailPageModel.cs +++ b/UI/Models/DetailPageModel.cs @@ -9,10 +9,11 @@ using System.Windows.Controls; using UI.Controls.Charts.Model; using UI.Controls.Select; +using UI.Servicers; namespace UI.Models { - public class DetailPageModel : UINotifyPropertyChanged + public class DetailPageModel : LocalizedView { private List Data_; @@ -172,5 +173,7 @@ public int TabbarSelectedIndex /// 应用右键菜单 /// public ContextMenu AppContextMenu { get { return AppContextMenu_; } set { AppContextMenu_ = value; OnPropertyChanged(); } } + + protected DetailPageModel(ILocalizationServicer localization) : base(localization) {} } } diff --git a/UI/Models/IndexPageModel.cs b/UI/Models/IndexPageModel.cs index f4c9a00..9699cb8 100644 --- a/UI/Models/IndexPageModel.cs +++ b/UI/Models/IndexPageModel.cs @@ -7,6 +7,7 @@ using System.Windows.Controls; using UI.Controls.Charts.Model; using UI.Controls.Select; +using UI.Servicers; namespace UI.Models { @@ -102,5 +103,7 @@ public List WebMoreData /// 网站右键菜单 /// public ContextMenu WebSiteContextMenu { get { return WebSiteContextMenu_; } set { WebSiteContextMenu_ = value; OnPropertyChanged(); } } + + protected IndexPageModel(ILocalizationServicer localizationServicer) : base(localizationServicer) {} } } diff --git a/UI/Models/LocalizedView.cs b/UI/Models/LocalizedView.cs new file mode 100644 index 0000000..0a2b90d --- /dev/null +++ b/UI/Models/LocalizedView.cs @@ -0,0 +1,20 @@ +using UI.Servicers; + +namespace UI.Models +{ + public abstract class LocalizedView : UINotifyPropertyChanged + { + private readonly ILocalizationServicer Localization; + + protected LocalizedView(ILocalizationServicer localization) + { + Localization = localization; + } + + protected string Translated(string key) => Localization.Translated(key); + + protected string Translated(string key, params object[] args) => Localization.Translated(key, args); + + protected string Translated(params object[] args) => Localization.Translated(args); + } +} \ No newline at end of file diff --git a/UI/Models/MainWindowModel.cs b/UI/Models/MainWindowModel.cs index 387bcc1..06b67cd 100644 --- a/UI/Models/MainWindowModel.cs +++ b/UI/Models/MainWindowModel.cs @@ -8,11 +8,14 @@ using UI.Controls.Base; using UI.Controls.Navigation.Models; using UI.Controls.Window; +using UI.Servicers; namespace UI.Models { - public class MainWindowModel : UINotifyPropertyChanged + public class MainWindowModel : LocalizedView { + protected MainWindowModel(ILocalizationServicer localization) : base(localization) {} + private IServiceProvider ServiceProvider_; public IServiceProvider ServiceProvider { diff --git a/UI/Models/ModelBase.cs b/UI/Models/ModelBase.cs index 9021825..d1f9747 100644 --- a/UI/Models/ModelBase.cs +++ b/UI/Models/ModelBase.cs @@ -4,10 +4,11 @@ using System.Text; using System.Threading.Tasks; using UI.Controls.Select; +using UI.Servicers; namespace UI.Models { - public class ModelBase : UINotifyPropertyChanged + public class ModelBase : LocalizedView { private SelectItemModel ShowType_; /// @@ -32,7 +33,7 @@ public class ModelBase : UINotifyPropertyChanged Name="网站" } }; - public ModelBase() + protected ModelBase(ILocalizationServicer localizationServicer) : base(localizationServicer) { ShowType = ShowTypeOptions[0]; } diff --git a/UI/Models/SettingPageModel.cs b/UI/Models/SettingPageModel.cs index 5505a12..7f34107 100644 --- a/UI/Models/SettingPageModel.cs +++ b/UI/Models/SettingPageModel.cs @@ -6,10 +6,11 @@ using System.Text; using System.Threading.Tasks; using System.Windows; +using UI.Servicers; namespace UI.Models { - public class SettingPageModel : UINotifyPropertyChanged + public class SettingPageModel : LocalizedView { private object data; public object Data { get { return data; } set { data = value; OnPropertyChanged(); } } @@ -47,5 +48,7 @@ public class SettingPageModel : UINotifyPropertyChanged private DateTime ExportDataEndMonthDate_; public DateTime ExportDataEndMonthDate { get { return ExportDataEndMonthDate_; } set { ExportDataEndMonthDate_ = value; OnPropertyChanged(); } } + + public SettingPageModel(ILocalizationServicer localization) : base(localization) {} } } diff --git a/UI/Properties/AssemblyInfo.cs b/UI/Properties/AssemblyInfo.cs index 50b49ce..90bcfa4 100644 --- a/UI/Properties/AssemblyInfo.cs +++ b/UI/Properties/AssemblyInfo.cs @@ -53,3 +53,6 @@ // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.5.0.6")] [assembly: AssemblyFileVersion("1.5.0.6")] + +// Sets english as the default app language if the other localization isn't available +[assembly: NeutralResourcesLanguage("en-US")] diff --git a/UI/Resources/Localization/Localization.Designer.cs b/UI/Resources/Localization/Localization.Designer.cs new file mode 100644 index 0000000..ff08c83 --- /dev/null +++ b/UI/Resources/Localization/Localization.Designer.cs @@ -0,0 +1,737 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace UI.Resources.Localization { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Localization { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Localization() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UI.Resources.Localization.Localization", typeof(Localization).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Ignored Apps. + /// + internal static string config_behaviorModel_group_ignoreProcess { + get { + return ResourceManager.GetString("config.behaviorModel.group.ignoreProcess", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ignored URLs. + /// + internal static string config_behaviorModel_group_ignoreURL { + get { + return ResourceManager.GetString("config.behaviorModel.group.ignoreURL", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preferences. + /// + internal static string config_behaviorModel_group_isSleepWatch { + get { + return ResourceManager.GetString("config.behaviorModel.group.isSleepWatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Application Whitelist. + /// + internal static string config_behaviorModel_group_whiteList { + get { + return ResourceManager.GetString("config.behaviorModel.group.whiteList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Match by process name or regex. Regexes can match program paths.. + /// + internal static string config_behaviorModel_ignoreProcessList_description { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreProcessList.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ignored Apps. + /// + internal static string config_behaviorModel_ignoreProcessList_name { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreProcessList.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Process name (no ".exe" needed). Supports regular expressions. + /// + internal static string config_behaviorModel_ignoreProcessList_placeholder { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreProcessList.placeholder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Filter websites or links that should not be tracked.. + /// + internal static string config_behaviorModel_ignoreURLList_description { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreURLList.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ignored URLs. + /// + internal static string config_behaviorModel_ignoreURLList_name { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreURLList.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Supports regexes. + /// + internal static string config_behaviorModel_ignoreURLList_placeholder { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreURLList.placeholder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatically stops tracking when away from the computer. Takes effect after restarting the software. (Not recommended to disable). + /// + internal static string config_behaviorModel_isSleepWatch_description { + get { + return ResourceManager.GetString("config.behaviorModel.isSleepWatch.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sleep Monitoring. + /// + internal static string config_behaviorModel_isSleepWatch_name { + get { + return ResourceManager.GetString("config.behaviorModel.isSleepWatch.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only track applications in the whitelist. + /// + internal static string config_behaviorModel_isWhiteList_description { + get { + return ResourceManager.GetString("config.behaviorModel.isWhiteList.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Application Whitelist. + /// + internal static string config_behaviorModel_isWhiteList_name { + get { + return ResourceManager.GetString("config.behaviorModel.isWhiteList.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Match by process name or regex. Regexes can match program paths.. + /// + internal static string config_behaviorModel_processWhiteList_description { + get { + return ResourceManager.GetString("config.behaviorModel.processWhiteList.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Application Whitelist. + /// + internal static string config_behaviorModel_processWhiteList_name { + get { + return ResourceManager.GetString("config.behaviorModel.processWhiteList.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Process name (no ".exe" needed). Supports regular expressions. + /// + internal static string config_behaviorModel_processWhiteList_placeholder { + get { + return ResourceManager.GetString("config.behaviorModel.processWhiteList.placeholder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Appearance. + /// + internal static string config_general_group_appearance { + get { + return ResourceManager.GetString("config.general.group.appearance", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Basic. + /// + internal static string config_general_group_basic { + get { + return ResourceManager.GetString("config.general.group.basic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Features. + /// + internal static string config_general_group_feature { + get { + return ResourceManager.GetString("config.general.group.feature", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Overview Page. + /// + internal static string config_general_group_overview { + get { + return ResourceManager.GetString("config.general.group.overview", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string config_general_indexPageFrequentUseNum_description { + get { + return ResourceManager.GetString("config.general.indexPageFrequentUseNum.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Frequent Items Count. + /// + internal static string config_general_indexPageFrequentUseNum_name { + get { + return ResourceManager.GetString("config.general.indexPageFrequentUseNum.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1|2|3|4|5|6|7|8|9|10. + /// + internal static string config_general_indexPageFrequentUseNum_options { + get { + return ResourceManager.GetString("config.general.indexPageFrequentUseNum.options", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string config_general_indexPageMoreNum_description { + get { + return ResourceManager.GetString("config.general.indexPageMoreNum.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to More Items Count. + /// + internal static string config_general_indexPageMoreNum_name { + get { + return ResourceManager.GetString("config.general.indexPageMoreNum.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20. + /// + internal static string config_general_indexPageMoreNum_options { + get { + return ResourceManager.GetString("config.general.indexPageMoreNum.options", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Keep the current window size instead of using the default. + /// + internal static string config_general_isSaveWindowSize_description { + get { + return ResourceManager.GetString("config.general.isSaveWindowSize.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remember Window Size. + /// + internal static string config_general_isSaveWindowSize_name { + get { + return ResourceManager.GetString("config.general.isSaveWindowSize.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatically run Tai when the computer starts. + /// + internal static string config_general_isStartAtBoot_description { + get { + return ResourceManager.GetString("config.general.isStartAtBoot.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Autostart. + /// + internal static string config_general_isStartAtBoot_name { + get { + return ResourceManager.GetString("config.general.isStartAtBoot.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This option has no effect when auto-starting with the system. + /// + internal static string config_general_isStartupShowMainWindow_description { + get { + return ResourceManager.GetString("config.general.isStartupShowMainWindow.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Main Window on Startup. + /// + internal static string config_general_isStartupShowMainWindow_name { + get { + return ResourceManager.GetString("config.general.isStartupShowMainWindow.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Track website visits in supported browsers: Google Chrome, MS Edge, or any browser supporting Chrome extensions. Go to “About > Browser Tracking Plugin” for installation and usage instructions.. + /// + internal static string config_general_isWebEnabled_description { + get { + return ResourceManager.GetString("config.general.isWebEnabled.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Website Activity Tracking. + /// + internal static string config_general_isWebEnabled_name { + get { + return ResourceManager.GetString("config.general.isWebEnabled.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select which page is shown when the app is opened. + /// + internal static string config_general_startPage_description { + get { + return ResourceManager.GetString("config.general.startPage.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Startup Page. + /// + internal static string config_general_startPage_name { + get { + return ResourceManager.GetString("config.general.startPage.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Overview|Statistics|Details|Categories. + /// + internal static string config_general_startPage_options { + get { + return ResourceManager.GetString("config.general.startPage.options", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choose between light or dark mode. + /// + internal static string config_general_theme_description { + get { + return ResourceManager.GetString("config.general.theme.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Theme Mode. + /// + internal static string config_general_theme_name { + get { + return ResourceManager.GetString("config.general.theme.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Light|Dark. + /// + internal static string config_general_theme_options { + get { + return ResourceManager.GetString("config.general.theme.options", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string config_general_themeColor_description { + get { + return ResourceManager.GetString("config.general.themeColor.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Theme Color. + /// + internal static string config_general_themeColor_name { + get { + return ResourceManager.GetString("config.general.themeColor.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 设置一个名称用于识别该关联. + /// + internal static string config_linkMode_name_description { + get { + return ResourceManager.GetString("config.linkMode.name.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name. + /// + internal static string config_linkMode_name_name { + get { + return ResourceManager.GetString("config.linkMode.name.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 将需要关联的进程名称(不带.exe)添加到此,至少两个。. + /// + internal static string config_linkMode_processList_description { + get { + return ResourceManager.GetString("config.linkMode.processList.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 关联进程. + /// + internal static string config_linkMode_processList_name { + get { + return ResourceManager.GetString("config.linkMode.processList.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Details. + /// + internal static string main_details { + get { + return ResourceManager.GetString("main.details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Overview. + /// + internal static string main_overview { + get { + return ResourceManager.GetString("main.overview", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Statistics. + /// + internal static string main_statistics { + get { + return ResourceManager.GetString("main.statistics", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} added to whitelist. + /// + internal static string page_detail_addedToWhitelist { + get { + return ResourceManager.GetString("page.detail.addedToWhitelist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add to whitelist. + /// + internal static string page_detail_addToWhitelist { + get { + return ResourceManager.GetString("page.detail.addToWhitelist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Clear statistics. + /// + internal static string page_detail_clearAppData { + get { + return ResourceManager.GetString("page.detail.clearAppData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy path. + /// + internal static string page_detail_copyPath { + get { + return ResourceManager.GetString("page.detail.copyPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy name. + /// + internal static string page_detail_copyProcessname { + get { + return ResourceManager.GetString("page.detail.copyProcessname", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Edit alias. + /// + internal static string page_detail_editAlias { + get { + return ResourceManager.GetString("page.detail.editAlias", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open app. + /// + internal static string page_detail_launchApp { + get { + return ResourceManager.GetString("page.detail.launchApp", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open folder. + /// + internal static string page_detail_openDir { + get { + return ResourceManager.GetString("page.detail.openDir", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reload. + /// + internal static string page_detail_reload { + get { + return ResourceManager.GetString("page.detail.reload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} removed from whitelist. + /// + internal static string page_detail_removedFromWhitelist { + get { + return ResourceManager.GetString("page.detail.removedFromWhitelist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove from whitelist. + /// + internal static string page_detail_removeFromWhitelist { + get { + return ResourceManager.GetString("page.detail.removeFromWhitelist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set category. + /// + internal static string page_detail_setCategory { + get { + return ResourceManager.GetString("page.detail.setCategory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tai Version:. + /// + internal static string page_settings_about_version { + get { + return ResourceManager.GetString("page.settings.about.version", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to About. + /// + internal static string page_settings_category_about { + get { + return ResourceManager.GetString("page.settings.category.about", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Associations. + /// + internal static string page_settings_category_associations { + get { + return ResourceManager.GetString("page.settings.category.associations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Behavior. + /// + internal static string page_settings_category_behavior { + get { + return ResourceManager.GetString("page.settings.category.behavior", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Data. + /// + internal static string page_settings_category_data { + get { + return ResourceManager.GetString("page.settings.category.data", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to General. + /// + internal static string page_settings_category_general { + get { + return ResourceManager.GetString("page.settings.category.general", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There was an error executing the updater!. + /// + internal static string page_settings_updaterError { + get { + return ResourceManager.GetString("page.settings.updaterError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to It seems like the updater was removed. Please download new versions manually on the release page.. + /// + internal static string page_settings_updaterRemoved { + get { + return ResourceManager.GetString("page.settings.updaterRemoved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}h. + /// + internal static string time_hours { + get { + return ResourceManager.GetString("time.hours", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}h {1}min. + /// + internal static string time_hoursWithMinutes { + get { + return ResourceManager.GetString("time.hoursWithMinutes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}min. + /// + internal static string time_minutes { + get { + return ResourceManager.GetString("time.minutes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}min {1}sec. + /// + internal static string time_minutesWithSeconds { + get { + return ResourceManager.GetString("time.minutesWithSeconds", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}sec. + /// + internal static string time_seconds { + get { + return ResourceManager.GetString("time.seconds", resourceCulture); + } + } + } +} diff --git a/UI/Resources/Localization/Localization.resx b/UI/Resources/Localization/Localization.resx new file mode 100644 index 0000000..0070a3e --- /dev/null +++ b/UI/Resources/Localization/Localization.resx @@ -0,0 +1,277 @@ + + + + + + + {0}sec + + + {0}min + + + {0}min {1}sec + + + {0}h + + + {0}h {1}min + + + + + Details + + + Statistics + + + Overview + + + + + Open app + + + Copy name + + + Copy path + + + Open folder + + + Reload + + + Clear statistics + + + Set category + + + Edit alias + + + Remove from whitelist + + + Add to whitelist + + + + {0} removed from whitelist + + + {0} added to whitelist + + + + + It seems like the updater was removed. Please download new versions manually on the release page. + + + There was an error executing the updater! + + + There was an error executing the updater! + + + + General + + + Associations + + + Behavior + + + Data + + + About + + + + + Tai Version: + + + + + Name + + + 设置一个名称用于识别该关联 + + + 关联进程 + + + 将需要关联的进程名称(不带.exe)添加到此,至少两个。 + + + + + Sleep Monitoring + + + Automatically stops tracking when away from the computer. Takes effect after restarting the software. (Not recommended to disable) + + + Preferences + + + + Ignored Apps + + + Match by process name or regex. Regexes can match program paths. + + + Process name (no ".exe" needed). Supports regular expressions + + + Ignored Apps + + + + Ignored URLs + + + Filter websites or links that should not be tracked. + + + Supports regexes + + + Ignored URLs + + + + Application Whitelist + + + Only track applications in the whitelist + + + Application Whitelist + + + + Application Whitelist + + + Match by process name or regex. Regexes can match program paths. + + + Process name (no ".exe" needed). Supports regular expressions + + + + + Basic + + + Appearance + + + Overview Page + + + Features + + + + Autostart + + + Automatically run Tai when the computer starts + + + + Theme Mode + + + Choose between light or dark mode + + + Light|Dark + + + + Theme Color + + + + + + + Remember Window Size + + + Keep the current window size instead of using the default + + + + Startup Page + + + Select which page is shown when the app is opened + + + Overview|Statistics|Details|Categories + + + + Show Main Window on Startup + + + This option has no effect when auto-starting with the system + + + + Frequent Items Count + + + + + + 1|2|3|4|5|6|7|8|9|10 + + + + More Items Count + + + + + + 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20 + + + + Website Activity Tracking + + + Track website visits in supported browsers: Google Chrome, MS Edge, or any browser supporting Chrome extensions. Go to “About > Browser Tracking Plugin” for installation and usage instructions. + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/UI/Resources/Localization/Localization.zh-CN.Designer.cs b/UI/Resources/Localization/Localization.zh-CN.Designer.cs new file mode 100644 index 0000000..03db3e9 --- /dev/null +++ b/UI/Resources/Localization/Localization.zh-CN.Designer.cs @@ -0,0 +1,737 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace UI.Resources.Localization { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Localization_zh_CN { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Localization_zh_CN() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UI.Resources.Localization.Localization.zh-CN", typeof(Localization_zh_CN).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to 忽略应用. + /// + internal static string config_behaviorModel_group_ignoreProcess { + get { + return ResourceManager.GetString("config.behaviorModel.group.ignoreProcess", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 忽略URL. + /// + internal static string config_behaviorModel_group_ignoreURL { + get { + return ResourceManager.GetString("config.behaviorModel.group.ignoreURL", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 偏好. + /// + internal static string config_behaviorModel_group_isSleepWatch { + get { + return ResourceManager.GetString("config.behaviorModel.group.isSleepWatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 应用白名单. + /// + internal static string config_behaviorModel_group_whiteList { + get { + return ResourceManager.GetString("config.behaviorModel.group.whiteList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 可以通过进程名称或者正则表达式进行匹配。当使用正则表达式时可以匹配程序路径. + /// + internal static string config_behaviorModel_ignoreProcessList_description { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreProcessList.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 忽略应用. + /// + internal static string config_behaviorModel_ignoreProcessList_name { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreProcessList.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 进程名称,不需要输入.exe。支持正则表达式. + /// + internal static string config_behaviorModel_ignoreProcessList_placeholder { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreProcessList.placeholder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 过滤不需要统计的网站或链接. + /// + internal static string config_behaviorModel_ignoreURLList_description { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreURLList.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 忽略URL. + /// + internal static string config_behaviorModel_ignoreURLList_name { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreURLList.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to URL 支持正则表达式. + /// + internal static string config_behaviorModel_ignoreURLList_placeholder { + get { + return ResourceManager.GetString("config.behaviorModel.ignoreURLList.placeholder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 离开电脑时自动停止统计,重启软件生效。(一般情况不建议关闭). + /// + internal static string config_behaviorModel_isSleepWatch_description { + get { + return ResourceManager.GetString("config.behaviorModel.isSleepWatch.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 睡眠监测. + /// + internal static string config_behaviorModel_isSleepWatch_name { + get { + return ResourceManager.GetString("config.behaviorModel.isSleepWatch.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 仅统计白名单内的应用. + /// + internal static string config_behaviorModel_isWhiteList_description { + get { + return ResourceManager.GetString("config.behaviorModel.isWhiteList.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 应用白名单. + /// + internal static string config_behaviorModel_isWhiteList_name { + get { + return ResourceManager.GetString("config.behaviorModel.isWhiteList.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 可以通过进程名称或者正则表达式进行匹配,当使用正则表达式时可以匹配程序路径. + /// + internal static string config_behaviorModel_processWhiteList_description { + get { + return ResourceManager.GetString("config.behaviorModel.processWhiteList.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 应用白名单. + /// + internal static string config_behaviorModel_processWhiteList_name { + get { + return ResourceManager.GetString("config.behaviorModel.processWhiteList.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 进程名称,不需要输入.exe。支持正则表达式. + /// + internal static string config_behaviorModel_processWhiteList_placeholder { + get { + return ResourceManager.GetString("config.behaviorModel.processWhiteList.placeholder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 外观. + /// + internal static string config_general_group_appearance { + get { + return ResourceManager.GetString("config.general.group.appearance", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 基础. + /// + internal static string config_general_group_basic { + get { + return ResourceManager.GetString("config.general.group.basic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 功能. + /// + internal static string config_general_group_feature { + get { + return ResourceManager.GetString("config.general.group.feature", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 概览页. + /// + internal static string config_general_group_overview { + get { + return ResourceManager.GetString("config.general.group.overview", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string config_general_indexPageFrequentUseNum_description { + get { + return ResourceManager.GetString("config.general.indexPageFrequentUseNum.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 最为频繁显示条数. + /// + internal static string config_general_indexPageFrequentUseNum_name { + get { + return ResourceManager.GetString("config.general.indexPageFrequentUseNum.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1|2|3|4|5|6|7|8|9|10. + /// + internal static string config_general_indexPageFrequentUseNum_options { + get { + return ResourceManager.GetString("config.general.indexPageFrequentUseNum.options", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string config_general_indexPageMoreNum_description { + get { + return ResourceManager.GetString("config.general.indexPageMoreNum.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 更多显示条数. + /// + internal static string config_general_indexPageMoreNum_name { + get { + return ResourceManager.GetString("config.general.indexPageMoreNum.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20. + /// + internal static string config_general_indexPageMoreNum_options { + get { + return ResourceManager.GetString("config.general.indexPageMoreNum.options", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 保留当前的窗口大小,而非使用系统默认尺寸. + /// + internal static string config_general_isSaveWindowSize_description { + get { + return ResourceManager.GetString("config.general.isSaveWindowSize.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 保留窗口大小. + /// + internal static string config_general_isSaveWindowSize_name { + get { + return ResourceManager.GetString("config.general.isSaveWindowSize.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 在电脑启动时自动运行 Tai. + /// + internal static string config_general_isStartAtBoot_description { + get { + return ResourceManager.GetString("config.general.isStartAtBoot.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 开机自启动. + /// + internal static string config_general_isStartAtBoot_name { + get { + return ResourceManager.GetString("config.general.isStartAtBoot.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 在开机自启动时此选项无效. + /// + internal static string config_general_isStartupShowMainWindow_description { + get { + return ResourceManager.GetString("config.general.isStartupShowMainWindow.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 启动软件时显示主界面. + /// + internal static string config_general_isStartupShowMainWindow_name { + get { + return ResourceManager.GetString("config.general.isStartupShowMainWindow.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 统计浏览器的网站访问数据,支持:Google Chrome、MSEdge或任何能够安装Chrome拓展的浏览器。请点击 “关于 > 浏览器统计插件” 了解如何安装和使用此功能。. + /// + internal static string config_general_isWebEnabled_description { + get { + return ResourceManager.GetString("config.general.isWebEnabled.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 网站浏览统计. + /// + internal static string config_general_isWebEnabled_name { + get { + return ResourceManager.GetString("config.general.isWebEnabled.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 设置打开主界面时显示的页面. + /// + internal static string config_general_startPage_description { + get { + return ResourceManager.GetString("config.general.startPage.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 启动页. + /// + internal static string config_general_startPage_name { + get { + return ResourceManager.GetString("config.general.startPage.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 概览|统计|详细|分类. + /// + internal static string config_general_startPage_options { + get { + return ResourceManager.GetString("config.general.startPage.options", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 设置以浅色或深色模式显示. + /// + internal static string config_general_theme_description { + get { + return ResourceManager.GetString("config.general.theme.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 主题模式. + /// + internal static string config_general_theme_name { + get { + return ResourceManager.GetString("config.general.theme.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 浅色|深色. + /// + internal static string config_general_theme_options { + get { + return ResourceManager.GetString("config.general.theme.options", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string config_general_themeColor_description { + get { + return ResourceManager.GetString("config.general.themeColor.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 主题颜色. + /// + internal static string config_general_themeColor_name { + get { + return ResourceManager.GetString("config.general.themeColor.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 设置一个名称用于识别该关联. + /// + internal static string config_linkMode_name_description { + get { + return ResourceManager.GetString("config.linkMode.name.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 名称. + /// + internal static string config_linkMode_name_name { + get { + return ResourceManager.GetString("config.linkMode.name.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 将需要关联的进程名称(不带.exe)添加到此,至少两个。. + /// + internal static string config_linkMode_processList_description { + get { + return ResourceManager.GetString("config.linkMode.processList.description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 关联进程. + /// + internal static string config_linkMode_processList_name { + get { + return ResourceManager.GetString("config.linkMode.processList.name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 详细. + /// + internal static string main_details { + get { + return ResourceManager.GetString("main.details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 概览. + /// + internal static string main_overview { + get { + return ResourceManager.GetString("main.overview", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 统计. + /// + internal static string main_statistics { + get { + return ResourceManager.GetString("main.statistics", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 已添加至白名单 {0}. + /// + internal static string page_detail_addedToWhitelist { + get { + return ResourceManager.GetString("page.detail.addedToWhitelist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 添加到白名单. + /// + internal static string page_detail_addToWhitelist { + get { + return ResourceManager.GetString("page.detail.addToWhitelist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 清空统计. + /// + internal static string page_detail_clearAppData { + get { + return ResourceManager.GetString("page.detail.clearAppData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 复制应用文件路径. + /// + internal static string page_detail_copyPath { + get { + return ResourceManager.GetString("page.detail.copyPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 复制应用进程名称. + /// + internal static string page_detail_copyProcessname { + get { + return ResourceManager.GetString("page.detail.copyProcessname", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 编辑别名. + /// + internal static string page_detail_editAlias { + get { + return ResourceManager.GetString("page.detail.editAlias", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 启动应用. + /// + internal static string page_detail_launchApp { + get { + return ResourceManager.GetString("page.detail.launchApp", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 打开应用所在目录. + /// + internal static string page_detail_openDir { + get { + return ResourceManager.GetString("page.detail.openDir", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 刷新. + /// + internal static string page_detail_reload { + get { + return ResourceManager.GetString("page.detail.reload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 已从白名单移除此应用 {0}. + /// + internal static string page_detail_removedFromWhitelist { + get { + return ResourceManager.GetString("page.detail.removedFromWhitelist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 从白名单移除. + /// + internal static string page_detail_removeFromWhitelist { + get { + return ResourceManager.GetString("page.detail.removeFromWhitelist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 设置分类. + /// + internal static string page_detail_setCategory { + get { + return ResourceManager.GetString("page.detail.setCategory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tai 版本号. + /// + internal static string page_settings_about_version { + get { + return ResourceManager.GetString("page.settings.about.version", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 关于. + /// + internal static string page_settings_category_about { + get { + return ResourceManager.GetString("page.settings.category.about", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 行为. + /// + internal static string page_settings_category_behavior { + get { + return ResourceManager.GetString("page.settings.category.behavior", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 数据. + /// + internal static string page_settings_category_data { + get { + return ResourceManager.GetString("page.settings.category.data", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 常规. + /// + internal static string page_settings_category_general { + get { + return ResourceManager.GetString("page.settings.category.general", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 关联. + /// + internal static string page_settings_category_integrations { + get { + return ResourceManager.GetString("page.settings.category.integrations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 无法正确启动检查更新程序. + /// + internal static string page_settings_updaterError { + get { + return ResourceManager.GetString("page.settings.updaterError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 升级程序似乎已被删除,请手动前往发布页查看新版本. + /// + internal static string page_settings_updaterRemoved { + get { + return ResourceManager.GetString("page.settings.updaterRemoved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}小时. + /// + internal static string time_hours { + get { + return ResourceManager.GetString("time.hours", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}小时{1}分. + /// + internal static string time_hoursWithMinutes { + get { + return ResourceManager.GetString("time.hoursWithMinutes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}分钟. + /// + internal static string time_minutes { + get { + return ResourceManager.GetString("time.minutes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}分钟{1}秒. + /// + internal static string time_minutesWithSeconds { + get { + return ResourceManager.GetString("time.minutesWithSeconds", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}秒. + /// + internal static string time_seconds { + get { + return ResourceManager.GetString("time.seconds", resourceCulture); + } + } + } +} diff --git a/UI/Resources/Localization/Localization.zh-CN.resx b/UI/Resources/Localization/Localization.zh-CN.resx new file mode 100644 index 0000000..808b126 --- /dev/null +++ b/UI/Resources/Localization/Localization.zh-CN.resx @@ -0,0 +1,279 @@ + + + + + + + {0}秒 + + + {0}分钟 + + + {0}分钟{1}秒 + + + {0}小时 + + + {0}小时{1}分 + + + + + 详细 + + + 统计 + + + 概览 + + + + + 启动应用 + + + 复制应用进程名称 + + + 复制应用文件路径 + + + 打开应用所在目录 + + + 刷新 + + + 清空统计 + + + 设置分类 + + + 编辑别名 + + + 从白名单移除 + + + 添加到白名单 + + + + 已从白名单移除此应用 {0} + + + 已添加至白名单 {0} + + + + + 升级程序似乎已被删除,请手动前往发布页查看新版本 + + + 无法正确启动检查更新程序 + + + + 常规 + + + 关联 + + + 行为 + + + 数据 + + + 关于 + + + + + Tai 版本号 + + + + + 名称 + + + 设置一个名称用于识别该关联 + + + 关联进程 + + + 将需要关联的进程名称(不带.exe)添加到此,至少两个。 + + + + + 睡眠监测 + + + 离开电脑时自动停止统计,重启软件生效。(一般情况不建议关闭) + + + 偏好 + + + + 忽略应用 + + + 可以通过进程名称或者正则表达式进行匹配。当使用正则表达式时可以匹配程序路径 + + + 进程名称,不需要输入.exe。支持正则表达式 + + + 忽略应用 + + + + 忽略URL + + + 过滤不需要统计的网站或链接 + + + URL 支持正则表达式 + + + 忽略URL + + + + 应用白名单 + + + 仅统计白名单内的应用 + + + 应用白名单 + + + + 应用白名单 + + + 可以通过进程名称或者正则表达式进行匹配,当使用正则表达式时可以匹配程序路径 + + + 进程名称,不需要输入.exe。支持正则表达式 + + + + + 基础 + + + 外观 + + + 概览页 + + + 功能 + + + + 开机自启动 + + + 在电脑启动时自动运行 Tai + + + + 主题模式 + + + 设置以浅色或深色模式显示 + + + 浅色|深色 + + + + 主题颜色 + + + + + + + 保留窗口大小 + + + 保留当前的窗口大小,而非使用系统默认尺寸 + + + + 启动页 + + + 设置打开主界面时显示的页面 + + + 概览|统计|详细|分类 + + + + 启动软件时显示主界面 + + + 在开机自启动时此选项无效 + + + + 最为频繁显示条数 + + + + + + 1|2|3|4|5|6|7|8|9|10 + + + + 更多显示条数 + + + + + + 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20 + + + + 网站浏览统计 + + + 统计浏览器的网站访问数据,支持:Google Chrome、MSEdge或任何能够安装Chrome拓展的浏览器。请点击 “关于 > 浏览器统计插件” 了解如何安装和使用此功能。 + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + \ No newline at end of file diff --git a/UI/Servicers/ILocalizationServicer.cs b/UI/Servicers/ILocalizationServicer.cs new file mode 100644 index 0000000..0e8e572 --- /dev/null +++ b/UI/Servicers/ILocalizationServicer.cs @@ -0,0 +1,9 @@ +namespace UI.Servicers +{ + public interface ILocalizationServicer + { + string Translated(string key); + string Translated(string key, params object[] args); + string Translated(params object[] args); + } +} \ No newline at end of file diff --git a/UI/Servicers/LocalizationServicer.cs b/UI/Servicers/LocalizationServicer.cs new file mode 100644 index 0000000..4d5a2c2 --- /dev/null +++ b/UI/Servicers/LocalizationServicer.cs @@ -0,0 +1,42 @@ +using System.Globalization; +using System.Linq; +using System.Resources; +using UI.Resources.Localization; + +namespace UI.Servicers +{ + public class LocalizationServicer : ILocalizationServicer + { + public static LocalizationServicer Instance; + + private ResourceManager resourceManager; + private CultureInfo culture; + + public LocalizationServicer() + { + resourceManager = new ResourceManager("UI.Resources.Localization.Localization", typeof(LocalizationServicer).Assembly); + culture = CultureInfo.CurrentUICulture; + Instance = this; + } + + public void SetCulture(CultureInfo culture) + { + this.culture = culture ?? CultureInfo.InvariantCulture; + } + + public string Translated(string key) + { + return resourceManager.GetString(key, culture) ?? key; + } + + public string Translated(string key, params object[] args) + { + return string.Format(culture, Translated(key), args); + } + + public string Translated(params object[] args) + { + return string.Format(culture, Translated(args[0] as string), args.Skip(1).ToArray()); + } + } +} \ No newline at end of file diff --git a/UI/Themes/SettingPanel/SettingPanelItem.xaml b/UI/Themes/SettingPanel/SettingPanelItem.xaml index 919ae22..2bcc079 100644 --- a/UI/Themes/SettingPanel/SettingPanelItem.xaml +++ b/UI/Themes/SettingPanel/SettingPanelItem.xaml @@ -22,7 +22,7 @@ - + diff --git a/UI/UI.csproj b/UI/UI.csproj index 31e90ca..6e5fd0d 100644 --- a/UI/UI.csproj +++ b/UI/UI.csproj @@ -189,6 +189,7 @@ + @@ -199,13 +200,26 @@ + + + True + True + Localization.resx + + + True + True + Localization.zh-CN.resx + + + @@ -497,6 +511,14 @@ ResXFileCodeGenerator Resources.Designer.cs + + ResXFileCodeGenerator + Localization.Designer.cs + + + ResXFileCodeGenerator + Localization.zh-CN.Designer.cs + @@ -585,7 +607,6 @@ - $(MSBuildProjectDirectory)=Tai diff --git a/UI/ViewModels/CategoryAppListPageVM.cs b/UI/ViewModels/CategoryAppListPageVM.cs index beb9e5c..29373bb 100644 --- a/UI/ViewModels/CategoryAppListPageVM.cs +++ b/UI/ViewModels/CategoryAppListPageVM.cs @@ -10,6 +10,7 @@ using UI.Models; using UI.Models.Category; using UI.Models.CategoryAppList; +using UI.Servicers; using UI.Views; namespace UI.ViewModels @@ -25,7 +26,7 @@ public class CategoryAppListPageVM : CategoryAppListPageModel public Command SearchCommand { get; set; } public Command ChooseCloseCommand { get; set; } public Command DelCommand { get; set; } - public CategoryAppListPageVM(IAppData appData, MainViewModel mainVM) + public CategoryAppListPageVM(ILocalizationServicer localizationServicer, IAppData appData, MainViewModel mainVM) : base(localizationServicer) { this.appData = appData; this.mainVM = mainVM; diff --git a/UI/ViewModels/CategoryPageVM.cs b/UI/ViewModels/CategoryPageVM.cs index c9f192a..e8af6ab 100644 --- a/UI/ViewModels/CategoryPageVM.cs +++ b/UI/ViewModels/CategoryPageVM.cs @@ -58,7 +58,13 @@ public class CategoryPageVM : CategoryPageModel public Command DirectoriesCommand { get; set; } - public CategoryPageVM(ICategorys categorys, MainViewModel mainVM, IAppData appData, IWebData webData_, IUIServicer uIServicer_) + public CategoryPageVM( + ILocalizationServicer localizationServicer, + ICategorys categorys, + MainViewModel mainVM, + IAppData appData, + IWebData webData_, + IUIServicer uIServicer_) : base(localizationServicer) { this.categorys = categorys; this.mainVM = mainVM; diff --git a/UI/ViewModels/CategoryWebSiteListPageVM.cs b/UI/ViewModels/CategoryWebSiteListPageVM.cs index be19960..8c5a2c6 100644 --- a/UI/ViewModels/CategoryWebSiteListPageVM.cs +++ b/UI/ViewModels/CategoryWebSiteListPageVM.cs @@ -12,6 +12,7 @@ using UI.Models; using UI.Models.Category; using UI.Models.CategoryAppList; +using UI.Servicers; using UI.Views; namespace UI.ViewModels @@ -27,7 +28,10 @@ public class CategoryWebSiteListPageVM : CategoryWebSiteListPageModel public Command ChooseCloseCommand { get; set; } public Command DelCommand { get; set; } private List _webSiteOptionsTemp; - public CategoryWebSiteListPageVM(MainViewModel mainVM_, IWebData webData_) + public CategoryWebSiteListPageVM( + ILocalizationServicer localizationServicer, + MainViewModel mainVM_, + IWebData webData_) : base(localizationServicer) { _mainVM = mainVM_; _webData = webData_; diff --git a/UI/ViewModels/ChartPageVM.cs b/UI/ViewModels/ChartPageVM.cs index 45f2a25..9d4072d 100644 --- a/UI/ViewModels/ChartPageVM.cs +++ b/UI/ViewModels/ChartPageVM.cs @@ -35,7 +35,15 @@ public class ChartPageVM : ChartPageModel public Command RefreshCommand { get; set; } public List ChartDataModeOptions { get; set; } - public ChartPageVM(IData data, ICategorys categorys, MainViewModel mainVM, IAppContextMenuServicer appContextMenuServicer, IInputServicer inputServicer, IWebData webData_, IWebSiteContextMenuServicer webSiteContextMenu_) + public ChartPageVM( + ILocalizationServicer localizationServicer, + IData data, + ICategorys categorys, + MainViewModel mainVM, + IAppContextMenuServicer appContextMenuServicer, + IInputServicer inputServicer, + IWebData webData_, + IWebSiteContextMenuServicer webSiteContextMenu_) : base(localizationServicer) { this.data = data; this.categorys = categorys; @@ -684,7 +692,7 @@ private List MapToChartsData(IEnumerable MapToChartData(IEnumerable MapToChartsData(IEnumerable(); @@ -255,7 +262,7 @@ private List MapToChartsWebData(IEnumerable(); diff --git a/UI/ViewModels/DetailPageVM.cs b/UI/ViewModels/DetailPageVM.cs index ee009dd..428c13f 100644 --- a/UI/ViewModels/DetailPageVM.cs +++ b/UI/ViewModels/DetailPageVM.cs @@ -37,13 +37,14 @@ public class DetailPageVM : DetailPageModel private MenuItem _setCategoryMenuItem; private MenuItem _whiteListMenuItem; public DetailPageVM( + ILocalizationServicer localization, IData data, MainViewModel main, IAppConfig appConfig, ICategorys categories, IAppData appData, IInputServicer inputServicer, - IUIServicer uIServicer_) + IUIServicer uIServicer_) : base(localization) { this.data = data; this.main = main; @@ -128,35 +129,35 @@ private void CreateContextMenu() AppContextMenu = new System.Windows.Controls.ContextMenu(); AppContextMenu.Opened += AppContextMenu_Opened; MenuItem open = new MenuItem(); - open.Header = "启动应用"; + open.Header = Translated("page.detail.launchApp"); open.Click += (e, c) => { OnInfoMenuActionCommand("open exe"); }; MenuItem copyProcessName = new MenuItem(); - copyProcessName.Header = "复制应用进程名称"; + copyProcessName.Header = Translated("page.detail.copyProcessname"); copyProcessName.Click += (e, c) => { OnInfoMenuActionCommand("copy processname"); }; MenuItem copyProcessFile = new MenuItem(); - copyProcessFile.Header = "复制应用文件路径"; + copyProcessFile.Header = Translated("page.detail.copyPath"); copyProcessFile.Click += (e, c) => { OnInfoMenuActionCommand("copy process file"); }; MenuItem openDir = new MenuItem(); - openDir.Header = "打开应用所在目录"; + openDir.Header = Translated("page.detail.openDir"); openDir.Click += (e, c) => { OnInfoMenuActionCommand("open dir"); }; MenuItem reLoadData = new MenuItem(); - reLoadData.Header = "刷新"; + reLoadData.Header = Translated("page.detail.reload"); reLoadData.Click += async (e, c) => { LoadChartData(); @@ -164,13 +165,13 @@ private void CreateContextMenu() }; MenuItem clear = new MenuItem(); - clear.Header = "清空统计"; + clear.Header = Translated("page.detail.clearAppData"); clear.Click += ClearAppData_Click; _setCategoryMenuItem = new MenuItem(); - _setCategoryMenuItem.Header = "设置分类"; + _setCategoryMenuItem.Header = Translated("page.detail.setCategory"); MenuItem editAlias = new MenuItem(); - editAlias.Header = "编辑别名"; + editAlias.Header = Translated("page.detail.editAlias"); editAlias.Click += EditAlias_ClickAsync; _whiteListMenuItem = new MenuItem(); @@ -179,12 +180,12 @@ private void CreateContextMenu() if (config.Behavior.ProcessWhiteList.Contains(App.Name)) { config.Behavior.ProcessWhiteList.Remove(App.Name); - main.Toast($"已从白名单移除此应用 {App.Description}", Controls.Window.ToastType.Success); + main.Toast(Translated("page.detail.removedFromWhitelist", App.Description), Controls.Window.ToastType.Success); } else { config.Behavior.ProcessWhiteList.Add(App.Name); - main.Toast($"已添加至白名单 {App.Description}", Controls.Window.ToastType.Success); + main.Toast(Translated("page.detail.addedToWhitelist", App.Description), Controls.Window.ToastType.Success); } }; @@ -264,11 +265,11 @@ private void AppContextMenu_Opened(object sender, RoutedEventArgs e) if (config.Behavior.ProcessWhiteList.Contains(App.Name)) { - _whiteListMenuItem.Header = "从白名单移除"; + _whiteListMenuItem.Header = Translated("page.detail.removeFromWhitelist"); } else { - _whiteListMenuItem.Header = "添加到白名单"; + _whiteListMenuItem.Header = Translated("page.detail.addToWhitelist"); } } @@ -514,7 +515,7 @@ await Task.Run(() => var monthData = data.GetProcessMonthLogList(App.ID, Date); int monthTotal = monthData.Sum(m => m.Time); - Total = Time.ToString(monthTotal); + Total = Translated(Time.ToString(monthTotal)); DateTime start = new DateTime(Date.Year, Date.Month, 1); DateTime end = new DateTime(Date.Year, Date.Month, DateTime.DaysInMonth(Date.Year, Date.Month)); @@ -524,7 +525,7 @@ await Task.Run(() => if (monthData.Count > 0) { var longDayData = monthData.OrderByDescending(m => m.Time).FirstOrDefault(); - LongDay = longDayData.Date.ToString("最长一天是在 dd 号,使用了 " + Time.ToString(longDayData.Time)); + LongDay = longDayData.Date.ToString("最长一天是在 dd 号,使用了 " + Translated(Time.ToString(longDayData.Time))); } @@ -578,7 +579,7 @@ private List MapToChartsData(List li bindModel.Data = item; bindModel.Name = !string.IsNullOrEmpty(item.AppModel?.Alias) ? item.AppModel.Alias : string.IsNullOrEmpty(item.AppModel?.Description) ? item.AppModel.Name : item.AppModel.Description; bindModel.Value = item.Time; - bindModel.Tag = Time.ToString(item.Time); + bindModel.Tag = Translated(Time.ToString(item.Time)); bindModel.PopupText = item.AppModel.File; bindModel.Icon = item.AppModel.IconFile; bindModel.DateTime = item.Date; diff --git a/UI/ViewModels/IndexPageVM.cs b/UI/ViewModels/IndexPageVM.cs index 7f3de7a..c9793e6 100644 --- a/UI/ViewModels/IndexPageVM.cs +++ b/UI/ViewModels/IndexPageVM.cs @@ -35,6 +35,7 @@ public class IndexPageVM : IndexPageModel private readonly IWebSiteContextMenuServicer _webSiteContextMenu; public List MoreTypeOptions { get; set; } public IndexPageVM( + ILocalizationServicer localizationService, IData data, MainViewModel main, IMain mainServicer, @@ -42,7 +43,7 @@ public IndexPageVM( IInputServicer inputServicer, IAppConfig appConfig, IWebData webData_, - IWebSiteContextMenuServicer webSiteContext_) + IWebSiteContextMenuServicer webSiteContext_) : base(localizationService) { this.data = data; this.main = main; @@ -274,7 +275,7 @@ private List MapToChartsData(IEnumerable MapToChartsData(IEnumerable() { - "常规","关联","行为","数据","关于" + Translated("page.settings.category.general"), + Translated("page.settings.category.associations"), + Translated("page.settings.category.behavior"), + Translated("page.settings.category.data"), + Translated("page.settings.category.about") }; PropertyChanged += SettingPageVM_PropertyChanged; diff --git a/UI/Views/SettingPage.xaml b/UI/Views/SettingPage.xaml index 4fd695c..2695bc2 100644 --- a/UI/Views/SettingPage.xaml +++ b/UI/Views/SettingPage.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:UI.Views" xmlns:SettingPanel="clr-namespace:UI.Controls.SettingPanel" x:Class="UI.Views.SettingPage" + xmlns:loc="clr-namespace:UI.Markup" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" Title="SettingPage" @@ -13,7 +14,7 @@ - + - + From aafca08f20a8a78d774efadb76f4e9aed64cc159 Mon Sep 17 00:00:00 2001 From: ccetl <109693935+ccetl@users.noreply.github.com> Date: Sun, 28 Sep 2025 14:30:20 +0200 Subject: [PATCH 2/4] Fix key --- .../Localization.zh-CN.Designer.cs | 18 +++++++++--------- .../Localization/Localization.zh-CN.resx | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/UI/Resources/Localization/Localization.zh-CN.Designer.cs b/UI/Resources/Localization/Localization.zh-CN.Designer.cs index 03db3e9..ec45eb2 100644 --- a/UI/Resources/Localization/Localization.zh-CN.Designer.cs +++ b/UI/Resources/Localization/Localization.zh-CN.Designer.cs @@ -635,6 +635,15 @@ internal static string page_settings_category_about { } } + /// + /// Looks up a localized string similar to 关联. + /// + internal static string page_settings_category_associations { + get { + return ResourceManager.GetString("page.settings.category.associations", resourceCulture); + } + } + /// /// Looks up a localized string similar to 行为. /// @@ -662,15 +671,6 @@ internal static string page_settings_category_general { } } - /// - /// Looks up a localized string similar to 关联. - /// - internal static string page_settings_category_integrations { - get { - return ResourceManager.GetString("page.settings.category.integrations", resourceCulture); - } - } - /// /// Looks up a localized string similar to 无法正确启动检查更新程序. /// diff --git a/UI/Resources/Localization/Localization.zh-CN.resx b/UI/Resources/Localization/Localization.zh-CN.resx index 808b126..5d4cf30 100644 --- a/UI/Resources/Localization/Localization.zh-CN.resx +++ b/UI/Resources/Localization/Localization.zh-CN.resx @@ -81,7 +81,7 @@ 常规 - + 关联 From 3436f5a795c69a4be7a9c217ef4baaa5b2419abb Mon Sep 17 00:00:00 2001 From: ccetl <109693935+ccetl@users.noreply.github.com> Date: Sun, 28 Sep 2025 16:45:13 +0200 Subject: [PATCH 3/4] Progress --- Core/Models/Config/BehaviorModel.cs | 2 +- UI/MainWindow.xaml | 3 +- .../Localization/Localization.Designer.cs | 99 +++++++++++++++++++ UI/Resources/Localization/Localization.resx | 41 ++++++++ .../Localization.zh-CN.Designer.cs | 99 +++++++++++++++++++ .../Localization/Localization.zh-CN.resx | 41 ++++++++ UI/Themes/Base/EmptyData.xaml | 7 +- UI/ViewModels/IndexPageVM.cs | 7 +- UI/ViewModels/MainViewModel.cs | 2 +- UI/Views/CategoryPage.xaml | 7 +- UI/Views/ChartPage.xaml | 3 +- UI/Views/DataPage.xaml | 3 +- UI/Views/IndexPage.xaml | 21 ++-- UI/Views/SettingPage.xaml | 2 +- 14 files changed, 311 insertions(+), 26 deletions(-) diff --git a/Core/Models/Config/BehaviorModel.cs b/Core/Models/Config/BehaviorModel.cs index 763fd97..cc0493d 100644 --- a/Core/Models/Config/BehaviorModel.cs +++ b/Core/Models/Config/BehaviorModel.cs @@ -32,7 +32,7 @@ public class BehaviorModel public List IgnoreProcessList { get; set; } = new List(); /// - /// 忽略的 URL 列表 + /// 忽略的进程列表 /// [Config( IsCanImportExport = true, diff --git a/UI/MainWindow.xaml b/UI/MainWindow.xaml index 11a5373..9f48743 100644 --- a/UI/MainWindow.xaml +++ b/UI/MainWindow.xaml @@ -4,6 +4,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:UI" + xmlns:loc="clr-namespace:UI.Markup" mc:Ignorable="d" xmlns:ui="clr-namespace:UI.Controls.Window" Title="Tai" Height="585" Width="815" MinHeight="585" MinWidth="814" @@ -39,7 +40,7 @@ --> - + diff --git a/UI/Resources/Localization/Localization.Designer.cs b/UI/Resources/Localization/Localization.Designer.cs index ff08c83..a769952 100644 --- a/UI/Resources/Localization/Localization.Designer.cs +++ b/UI/Resources/Localization/Localization.Designer.cs @@ -482,6 +482,33 @@ internal static string config_linkMode_processList_name { } } + /// + /// Looks up a localized string similar to No data available. + /// + internal static string emptyData_noData { + get { + return ResourceManager.GetString("emptyData.noData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nothing. + /// + internal static string emptyData_tooltip { + get { + return ResourceManager.GetString("emptyData.tooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Categories. + /// + internal static string main_categories { + get { + return ResourceManager.GetString("main.categories", resourceCulture); + } + } + /// /// Looks up a localized string similar to Details. /// @@ -500,6 +527,15 @@ internal static string main_overview { } } + /// + /// Looks up a localized string similar to Settings. + /// + internal static string main_settings { + get { + return ResourceManager.GetString("main.settings", resourceCulture); + } + } + /// /// Looks up a localized string similar to Statistics. /// @@ -617,6 +653,69 @@ internal static string page_detail_setCategory { } } + /// + /// Looks up a localized string similar to Apps. + /// + internal static string page_index_apps { + get { + return ResourceManager.GetString("page.index.apps", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Other. + /// + internal static string page_index_more { + get { + return ResourceManager.GetString("page.index.more", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Refresh. + /// + internal static string page_index_refresh { + get { + return ResourceManager.GetString("page.index.refresh", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Today. + /// + internal static string page_index_time_today { + get { + return ResourceManager.GetString("page.index.time.today", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This Week. + /// + internal static string page_index_time_week { + get { + return ResourceManager.GetString("page.index.time.week", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Top. + /// + internal static string page_index_top { + get { + return ResourceManager.GetString("page.index.top", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Websites. + /// + internal static string page_index_websites { + get { + return ResourceManager.GetString("page.index.websites", resourceCulture); + } + } + /// /// Looks up a localized string similar to Tai Version:. /// diff --git a/UI/Resources/Localization/Localization.resx b/UI/Resources/Localization/Localization.resx index 0070a3e..e47f06c 100644 --- a/UI/Resources/Localization/Localization.resx +++ b/UI/Resources/Localization/Localization.resx @@ -19,6 +19,31 @@ {0}h {1}min + + + Today + + + This Week + + + Apps + + + Websites + + + + + Top + + + Refresh + + + Other + + Details @@ -29,6 +54,14 @@ Overview + + Categories + + + + + Settings + @@ -260,6 +293,14 @@ Track website visits in supported browsers: Google Chrome, MS Edge, or any browser supporting Chrome extensions. Go to “About > Browser Tracking Plugin” for installation and usage instructions. + + + + No data available + + + Nothing + diff --git a/UI/Resources/Localization/Localization.zh-CN.Designer.cs b/UI/Resources/Localization/Localization.zh-CN.Designer.cs index ec45eb2..478a26c 100644 --- a/UI/Resources/Localization/Localization.zh-CN.Designer.cs +++ b/UI/Resources/Localization/Localization.zh-CN.Designer.cs @@ -482,6 +482,33 @@ internal static string config_linkMode_processList_name { } } + /// + /// Looks up a localized string similar to 暂时没有数据. + /// + internal static string emptyData_noData { + get { + return ResourceManager.GetString("emptyData.noData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 什么都没有. + /// + internal static string emptyData_tooltip { + get { + return ResourceManager.GetString("emptyData.tooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 分类. + /// + internal static string main_categories { + get { + return ResourceManager.GetString("main.categories", resourceCulture); + } + } + /// /// Looks up a localized string similar to 详细. /// @@ -500,6 +527,15 @@ internal static string main_overview { } } + /// + /// Looks up a localized string similar to 设置. + /// + internal static string main_settings { + get { + return ResourceManager.GetString("main.settings", resourceCulture); + } + } + /// /// Looks up a localized string similar to 统计. /// @@ -617,6 +653,69 @@ internal static string page_detail_setCategory { } } + /// + /// Looks up a localized string similar to 应用. + /// + internal static string page_index_apps { + get { + return ResourceManager.GetString("page.index.apps", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 更多. + /// + internal static string page_index_more { + get { + return ResourceManager.GetString("page.index.more", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 刷新. + /// + internal static string page_index_refresh { + get { + return ResourceManager.GetString("page.index.refresh", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 今日. + /// + internal static string page_index_time_today { + get { + return ResourceManager.GetString("page.index.time.today", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 本周. + /// + internal static string page_index_time_week { + get { + return ResourceManager.GetString("page.index.time.week", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 最为频繁. + /// + internal static string page_index_top { + get { + return ResourceManager.GetString("page.index.top", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 网站. + /// + internal static string page_index_websites { + get { + return ResourceManager.GetString("page.index.websites", resourceCulture); + } + } + /// /// Looks up a localized string similar to Tai 版本号. /// diff --git a/UI/Resources/Localization/Localization.zh-CN.resx b/UI/Resources/Localization/Localization.zh-CN.resx index 5d4cf30..761a231 100644 --- a/UI/Resources/Localization/Localization.zh-CN.resx +++ b/UI/Resources/Localization/Localization.zh-CN.resx @@ -19,6 +19,31 @@ {0}小时{1}分 + + + + 今日 + + + 本周 + + + 应用 + + + 网站 + + + + + 最为频繁 + + + 刷新 + + + 更多 + @@ -30,6 +55,14 @@ 概览 + + 分类 + + + + + 设置 + @@ -258,6 +291,14 @@ 统计浏览器的网站访问数据,支持:Google Chrome、MSEdge或任何能够安装Chrome拓展的浏览器。请点击 “关于 > 浏览器统计插件” 了解如何安装和使用此功能。 + + + + 暂时没有数据 + + + 什么都没有 + diff --git a/UI/Themes/Base/EmptyData.xaml b/UI/Themes/Base/EmptyData.xaml index 1d33b16..c8e7b74 100644 --- a/UI/Themes/Base/EmptyData.xaml +++ b/UI/Themes/Base/EmptyData.xaml @@ -1,13 +1,14 @@  + xmlns:local="clr-namespace:UI.Controls.Base" + xmlns:loc="clr-namespace:UI.Markup">