optimize<Statistics>: use localized text for weekdays

This commit is contained in:
leo 2022-01-11 20:35:17 +08:00
parent c52ed4a711
commit 4ef2a70ebd
3 changed files with 17 additions and 2 deletions

View file

@ -496,6 +496,14 @@
<sys:String x:Key="Text.Statistics.CommitterName">COMMITTER</sys:String>
<sys:String x:Key="Text.Statistics.CommitAmount">COMMITS</sys:String>
<sys:String x:Key="Text.Weekday.0">SUN</sys:String>
<sys:String x:Key="Text.Weekday.1">MON</sys:String>
<sys:String x:Key="Text.Weekday.2">TUE</sys:String>
<sys:String x:Key="Text.Weekday.3">WED</sys:String>
<sys:String x:Key="Text.Weekday.4">THU</sys:String>
<sys:String x:Key="Text.Weekday.5">FRI</sys:String>
<sys:String x:Key="Text.Weekday.6">SAT</sys:String>
<sys:String x:Key="Text.NotConfigured">Git has NOT been configured. Please to go [Preference] and configure it first.</sys:String>
<sys:String x:Key="Text.PathNotFound">Path[{0}] not exists!</sys:String>
<sys:String x:Key="Text.MissingBash">Can NOT locate bash.exe. Make sure bash.exe exists under the same folder with git.exe</sys:String>

View file

@ -495,6 +495,14 @@
<sys:String x:Key="Text.Statistics.CommitterName">提交者</sys:String>
<sys:String x:Key="Text.Statistics.CommitAmount">提交次数</sys:String>
<sys:String x:Key="Text.Weekday.0">星期日</sys:String>
<sys:String x:Key="Text.Weekday.1">星期一</sys:String>
<sys:String x:Key="Text.Weekday.2">星期二</sys:String>
<sys:String x:Key="Text.Weekday.3">星期三</sys:String>
<sys:String x:Key="Text.Weekday.4">星期四</sys:String>
<sys:String x:Key="Text.Weekday.5">星期五</sys:String>
<sys:String x:Key="Text.Weekday.6">星期六</sys:String>
<sys:String x:Key="Text.NotConfigured">GIT尚未配置。请打开【偏好设置】配置GIT路径。</sys:String>
<sys:String x:Key="Text.PathNotFound">路径({0})不存在或不可读取!</sys:String>
<sys:String x:Key="Text.MissingBash">无法找到bash.exe请确保其在git.exe同目录中</sys:String>

View file

@ -8,7 +8,6 @@ namespace SourceGit.Views {
/// 提交统计
/// </summary>
public partial class Statistics : Controls.Window {
private static readonly string[] WEEK_DAYS = new string[] { "一", "二", "三", "四", "五", "六", "日" };
private string repo = null;
public Statistics(string repo) {
@ -25,7 +24,7 @@ namespace SourceGit.Views {
var mapsWeek = new Dictionary<int, Models.StatisticSample>();
for (int i = 0; i < 7; i++) {
mapsWeek.Add(i, new Models.StatisticSample {
Name = $"星期{WEEK_DAYS[i]}",
Name = App.Text($"Weekday.{i}"),
Count = 0,
});
}