diff --git a/src/Commands/Statistics.cs b/src/Commands/Statistics.cs index b9f33367..6b2296ca 100644 --- a/src/Commands/Statistics.cs +++ b/src/Commands/Statistics.cs @@ -10,7 +10,7 @@ namespace SourceGit.Commands WorkingDirectory = repo; Context = repo; - Args = $"log --date-order --branches --remotes --since=\"{_statistics.Since()}\" --pretty=format:\"%ct$%cn\""; + Args = $"log --date-order --branches --remotes --since=\"{_statistics.Since()}\" --pretty=format:\"%ct$%an\""; } public Models.Statistics Result() diff --git a/src/Models/Statistics.cs b/src/Models/Statistics.cs index f5f2eb41..60517e59 100644 --- a/src/Models/Statistics.cs +++ b/src/Models/Statistics.cs @@ -13,34 +13,34 @@ namespace SourceGit.Models { public int Total { get; set; } = 0; public List Samples { get; set; } = new List(); - public List ByCommitter { get; set; } = new List(); + public List ByAuthor { get; set; } = new List(); - public void AddCommit(int index, string committer) + public void AddCommit(int index, string author) { Total++; Samples[index].Count++; - if (_mapByCommitter.TryGetValue(committer, out var value)) + if (_mapUsers.TryGetValue(author, out var value)) { value.Count++; } else { - var sample = new StatisticsSample(committer); + var sample = new StatisticsSample(author); sample.Count++; - _mapByCommitter.Add(committer, sample); - ByCommitter.Add(sample); + _mapUsers.Add(author, sample); + ByAuthor.Add(sample); } } public void Complete() { - ByCommitter.Sort((l, r) => r.Count - l.Count); - _mapByCommitter.Clear(); + ByAuthor.Sort((l, r) => r.Count - l.Count); + _mapUsers.Clear(); } - private readonly Dictionary _mapByCommitter = new Dictionary(); + private readonly Dictionary _mapUsers = new Dictionary(); } public class Statistics @@ -72,16 +72,16 @@ namespace SourceGit.Models return _today.AddMonths(-11).ToString("yyyy-MM-01 00:00:00"); } - public void AddCommit(string committer, double timestamp) + public void AddCommit(string author, double timestamp) { var time = DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime(); if (time.CompareTo(_thisWeekStart) >= 0 && time.CompareTo(_thisWeekEnd) < 0) - Week.AddCommit((int)time.DayOfWeek, committer); + Week.AddCommit((int)time.DayOfWeek, author); if (time.Month == _today.Month) - Month.AddCommit(time.Day - 1, committer); + Month.AddCommit(time.Day - 1, author); - Year.AddCommit(time.Month - 1, committer); + Year.AddCommit(time.Month - 1, author); } public void Complete() diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index afff2a31..7f6a6a18 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -555,9 +555,9 @@ COMMITTER MONAT WOCHE - JAHR + JAHR COMMITS: - COMMITTERS: + AUTOREN: SUBMODULE Submodul hinzufügen Relativen Pfad kopieren diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index c59189d8..0f7ea7f3 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -555,9 +555,9 @@ COMMITTER MONTH WEEK - YEAR + YEAR COMMITS: - COMMITTERS: + AUTHORS: SUBMODULES Add Submodule Copy Relative Path diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index c8baf25f..6209a100 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -554,9 +554,9 @@ COMMITTER MONTH WEEK - YEAR + YEAR COMMITS: - COMMITTERS: + AUTHORS: SUBMODULES Add Submodule Copy Relative Path diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index df177873..1b3dc48f 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -547,9 +547,9 @@ COMMITTER MÊS SEMANA - ANO + ANO COMMITS: - COMMITTERS: + AUTORES: SUBMÓDULOS Adicionar Submódulo Copiar Caminho Relativo diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 50bdc8ac..5da23686 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -557,9 +557,9 @@ 提交者 本月 本周 - 最近一年 + 最近一年 提交次数: - 提交者: + 贡献者人数: 子模块 添加子模块 复制路径 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index c2ed70ed..1f026d0f 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -558,9 +558,9 @@ 提交者 本月 本週 - 最近一年 + 最近一年 提交次數: - 提交者: + 貢獻者人數: 子模組 新增子模組 複製路徑 diff --git a/src/ViewModels/Statistics.cs b/src/ViewModels/Statistics.cs index 44cec313..587b1b71 100644 --- a/src/ViewModels/Statistics.cs +++ b/src/ViewModels/Statistics.cs @@ -1,7 +1,5 @@ using System.Threading.Tasks; - using Avalonia.Threading; - using CommunityToolkit.Mvvm.ComponentModel; namespace SourceGit.ViewModels diff --git a/src/Views/Statistics.axaml b/src/Views/Statistics.axaml index 5ab8b97a..61b1151e 100644 --- a/src/Views/Statistics.axaml +++ b/src/Views/Statistics.axaml @@ -110,7 +110,7 @@ - + @@ -135,7 +135,7 @@ - - + +