Skip to content

Commit 4c20beb

Browse files
committed
Merge remote-tracking branch 'sourcegit-origin/develop' into feature/create-pr-dialog
2 parents 6488388 + 9d168f0 commit 4c20beb

54 files changed

Lines changed: 1474 additions & 225 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎TRANSLATION.md‎

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ This document shows the translation status of each locale file in the repository
66

77
### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen)
88

9-
### ![de__DE](https://img.shields.io/badge/de__DE-93.94%25-yellow)
9+
### ![ca__ES](https://img.shields.io/badge/ca__ES-%E2%88%9A-brightgreen)
10+
11+
### ![de__DE](https://img.shields.io/badge/de__DE-93.85%25-yellow)
1012

1113
<details>
1214
<summary>Missing keys in de_DE.axaml</summary>
@@ -37,6 +39,7 @@ This document shows the translation status of each locale file in the repository
3739
- Text.OpenAppDataDir.Config
3840
- Text.Preferences.AI.ExtraHeaders
3941
- Text.Preferences.AI.ReasoningEffortLevel
42+
- Text.Preferences.Shell.Args.ToolTip
4043
- Text.Remote.ResetPushURL
4144
- Text.RemoteCM.SetPushURL
4245
- Text.Repository.Search.Method
@@ -79,7 +82,7 @@ This document shows the translation status of each locale file in the repository
7982

8083
</details>
8184

82-
### ![el__GR](https://img.shields.io/badge/el__GR-93.48%25-yellow)
85+
### ![el__GR](https://img.shields.io/badge/el__GR-93.38%25-yellow)
8386

8487
<details>
8588
<summary>Missing keys in el_GR.axaml</summary>
@@ -111,6 +114,7 @@ This document shows the translation status of each locale file in the repository
111114
- Text.OpenAppDataDir.Config
112115
- Text.Preferences.AI.ExtraHeaders
113116
- Text.Preferences.AI.ReasoningEffortLevel
117+
- Text.Preferences.Shell.Args.ToolTip
114118
- Text.Remote.ResetPushURL
115119
- Text.RemoteCM.SetPushURL
116120
- Text.Repository.FilterCommits.Collapse
@@ -157,9 +161,16 @@ This document shows the translation status of each locale file in the repository
157161

158162
</details>
159163

160-
### ![es__ES](https://img.shields.io/badge/es__ES-%E2%88%9A-brightgreen)
164+
### ![es__ES](https://img.shields.io/badge/es__ES-99.91%25-yellow)
165+
166+
<details>
167+
<summary>Missing keys in es_ES.axaml</summary>
168+
169+
- Text.Preferences.Shell.Args.ToolTip
161170

162-
### ![fr__FR](https://img.shields.io/badge/fr__FR-89.75%25-yellow)
171+
</details>
172+
173+
### ![fr__FR](https://img.shields.io/badge/fr__FR-89.66%25-yellow)
163174

164175
<details>
165176
<summary>Missing keys in fr_FR.axaml</summary>
@@ -223,6 +234,7 @@ This document shows the translation status of each locale file in the repository
223234
- Text.Preferences.AI.ExtraHeaders
224235
- Text.Preferences.AI.ReasoningEffortLevel
225236
- Text.Preferences.General.UseCompactBranchNames
237+
- Text.Preferences.Shell.Args.ToolTip
226238
- Text.Rebase.Test
227239
- Text.Rebase.Test.OK
228240
- Text.Rebase.Test.UnknownError
@@ -277,7 +289,7 @@ This document shows the translation status of each locale file in the repository
277289

278290
</details>
279291

280-
### ![he__IL](https://img.shields.io/badge/he__IL-89.75%25-yellow)
292+
### ![he__IL](https://img.shields.io/badge/he__IL-89.66%25-yellow)
281293

282294
<details>
283295
<summary>Missing keys in he_IL.axaml</summary>
@@ -341,6 +353,7 @@ This document shows the translation status of each locale file in the repository
341353
- Text.Preferences.AI.ExtraHeaders
342354
- Text.Preferences.AI.ReasoningEffortLevel
343355
- Text.Preferences.General.UseCompactBranchNames
356+
- Text.Preferences.Shell.Args.ToolTip
344357
- Text.Rebase.Test
345358
- Text.Rebase.Test.OK
346359
- Text.Rebase.Test.UnknownError
@@ -395,7 +408,7 @@ This document shows the translation status of each locale file in the repository
395408

396409
</details>
397410

398-
### ![id__ID](https://img.shields.io/badge/id__ID-93.94%25-yellow)
411+
### ![id__ID](https://img.shields.io/badge/id__ID-93.85%25-yellow)
399412

400413
<details>
401414
<summary>Missing keys in id_ID.axaml</summary>
@@ -425,6 +438,7 @@ This document shows the translation status of each locale file in the repository
425438
- Text.OpenAppDataDir.Cache
426439
- Text.OpenAppDataDir.Config
427440
- Text.Preferences.AI.ReasoningEffortLevel
441+
- Text.Preferences.Shell.Args.ToolTip
428442
- Text.Remote.ResetPushURL
429443
- Text.RemoteCM.SetPushURL
430444
- Text.Repository.Search.Method
@@ -468,7 +482,7 @@ This document shows the translation status of each locale file in the repository
468482

469483
</details>
470484

471-
### ![it__IT](https://img.shields.io/badge/it__IT-83.78%25-yellow)
485+
### ![it__IT](https://img.shields.io/badge/it__IT-83.69%25-yellow)
472486

473487
<details>
474488
<summary>Missing keys in it_IT.axaml</summary>
@@ -585,6 +599,7 @@ This document shows the translation status of each locale file in the repository
585599
- Text.Preferences.General.Use24Hours
586600
- Text.Preferences.General.UseCompactBranchNames
587601
- Text.Preferences.Git.UseStashAndReapplyByDefault
602+
- Text.Preferences.Shell.Args.ToolTip
588603
- Text.Rebase.NoVerify
589604
- Text.Rebase.Test
590605
- Text.Rebase.Test.OK
@@ -650,7 +665,7 @@ This document shows the translation status of each locale file in the repository
650665

651666
</details>
652667

653-
### ![ja__JP](https://img.shields.io/badge/ja__JP-97.95%25-yellow)
668+
### ![ja__JP](https://img.shields.io/badge/ja__JP-97.86%25-yellow)
654669

655670
<details>
656671
<summary>Missing keys in ja_JP.axaml</summary>
@@ -665,6 +680,7 @@ This document shows the translation status of each locale file in the repository
665680
- Text.CheckoutAsWorktree.WorktreePath
666681
- Text.CheckoutAsWorktree.WorktreePath.Placeholder
667682
- Text.CommitDetail.Files.Tips
683+
- Text.Preferences.Shell.Args.ToolTip
668684
- Text.Statistics.Commits
669685
- Text.Statistics.TopAuthors
670686
- Text.Statistics.TopAuthors.Count
@@ -680,7 +696,7 @@ This document shows the translation status of each locale file in the repository
680696

681697
</details>
682698

683-
### ![ko__KR](https://img.shields.io/badge/ko__KR-91.15%25-yellow)
699+
### ![ko__KR](https://img.shields.io/badge/ko__KR-91.05%25-yellow)
684700

685701
<details>
686702
<summary>Missing keys in ko_KR.axaml</summary>
@@ -733,6 +749,7 @@ This document shows the translation status of each locale file in the repository
733749
- Text.OpenAppDataDir.Config
734750
- Text.Preferences.AI.ExtraHeaders
735751
- Text.Preferences.AI.ReasoningEffortLevel
752+
- Text.Preferences.Shell.Args.ToolTip
736753
- Text.Remote.ResetPushURL
737754
- Text.RemoteCM.SetPushURL
738755
- Text.Repository.FilterCommits.Collapse
@@ -1071,7 +1088,7 @@ This document shows the translation status of each locale file in the repository
10711088
- Text.Preferences.Git.UseLibsecret
10721089
- Text.Preferences.Git.UseStashAndReapplyByDefault
10731090
- Text.Preferences.Shell.Args
1074-
- Text.Preferences.Shell.Args.Tip
1091+
- Text.Preferences.Shell.Args.ToolTip
10751092
- Text.Push.New
10761093
- Text.Push.Revision
10771094
- Text.Push.Revision.Title
@@ -1231,7 +1248,14 @@ This document shows the translation status of each locale file in the repository
12311248

12321249
</details>
12331250

1234-
### ![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen)
1251+
### ![ru__RU](https://img.shields.io/badge/ru__RU-99.91%25-yellow)
1252+
1253+
<details>
1254+
<summary>Missing keys in ru_RU.axaml</summary>
1255+
1256+
- Text.Preferences.Shell.Args.ToolTip
1257+
1258+
</details>
12351259

12361260
### ![ta__IN](https://img.shields.io/badge/ta__IN-60.58%25-red)
12371261

@@ -1522,7 +1546,7 @@ This document shows the translation status of each locale file in the repository
15221546
- Text.Preferences.Git.UseLibsecret
15231547
- Text.Preferences.Git.UseStashAndReapplyByDefault
15241548
- Text.Preferences.Shell.Args
1525-
- Text.Preferences.Shell.Args.Tip
1549+
- Text.Preferences.Shell.Args.ToolTip
15261550
- Text.Push.New
15271551
- Text.Push.Revision
15281552
- Text.Push.Revision.Title
@@ -1949,7 +1973,7 @@ This document shows the translation status of each locale file in the repository
19491973
- Text.Preferences.Git.UseLibsecret
19501974
- Text.Preferences.Git.UseStashAndReapplyByDefault
19511975
- Text.Preferences.Shell.Args
1952-
- Text.Preferences.Shell.Args.Tip
1976+
- Text.Preferences.Shell.Args.ToolTip
19531977
- Text.Push.New
19541978
- Text.Push.Revision
19551979
- Text.Push.Revision.Title
@@ -2089,4 +2113,11 @@ This document shows the translation status of each locale file in the repository
20892113

20902114
### ![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen)
20912115

2092-
### ![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen)
2116+
### ![zh__TW](https://img.shields.io/badge/zh__TW-99.91%25-yellow)
2117+
2118+
<details>
2119+
<summary>Missing keys in zh_TW.axaml</summary>
2120+
2121+
- Text.Preferences.Shell.Args.ToolTip
2122+
2123+
</details>

‎src/App.axaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<ResourceInclude Source="/Resources/Themes.axaml"/>
1313
</ResourceDictionary.MergedDictionaries>
1414

15+
<ResourceInclude x:Key="ca_ES" Source="/Resources/Locales/ca_ES.axaml"/>
1516
<ResourceInclude x:Key="de_DE" Source="/Resources/Locales/de_DE.axaml"/>
1617
<ResourceInclude x:Key="el_GR" Source="/Resources/Locales/el_GR.axaml"/>
1718
<ResourceInclude x:Key="en_US" Source="/Resources/Locales/en_US.axaml"/>

‎src/Converters/StringConverters.cs‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Globalization;
34

45
using Avalonia.Data.Converters;
@@ -91,5 +92,30 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
9192

9293
public static readonly FuncValueConverter<KeyGesture, string> FromKeyGesture =
9394
new FuncValueConverter<KeyGesture, string>(v => v?.ToString("p", null) ?? string.Empty);
95+
96+
public class ToWindowTitleConverter : IMultiValueConverter
97+
{
98+
public object Convert(IList<object> values, Type targetType, object parameter, CultureInfo culture)
99+
{
100+
if (values is not { Count: 2 })
101+
return "SourceGit";
102+
103+
var page = values[0] as string;
104+
var workspace = values[1] as string;
105+
if (string.IsNullOrEmpty(page))
106+
page = "Repositories";
107+
if (string.IsNullOrEmpty(workspace))
108+
workspace = "Unnamed";
109+
110+
return $"{page} - {workspace}";
111+
}
112+
113+
public IList<object> ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
114+
{
115+
throw new NotImplementedException();
116+
}
117+
}
118+
119+
public static readonly ToWindowTitleConverter ToWindowTitle = new ToWindowTitleConverter();
94120
}
95121
}

‎src/Models/Locales.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class Locale
88
public string Key { get; set; }
99

1010
public static readonly List<Locale> Supported = new List<Locale>() {
11+
new Locale("Català", "ca_ES"),
1112
new Locale("Deutsch", "de_DE"),
1213
new Locale("Ελληνικά", "el_GR"),
1314
new Locale("English", "en_US"),

‎src/Models/RepositoryUIStates.cs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,17 @@ public bool UpdateHistoryFilters(string pattern, FilterType type, FilterMode mod
357357
return true;
358358
}
359359

360+
public bool IsCoveredByFolderFilter(string path, FilterType type)
361+
{
362+
foreach (var filter in HistoryFilters)
363+
{
364+
if (filter.Type == type && path.StartsWith($"{filter.Pattern}/", StringComparison.Ordinal))
365+
return true;
366+
}
367+
368+
return false;
369+
}
370+
360371
public void RemoveHistoryFilter(string pattern, FilterType type)
361372
{
362373
foreach (var filter in HistoryFilters)

‎src/Models/ShellOrTerminal.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static ShellOrTerminal()
4848
new ShellOrTerminal("otty", "Otty", "Otty"),
4949
new ShellOrTerminal("cmux", "cmux", "cmux"),
5050
new ShellOrTerminal("mux0", "mux0", "mux0"),
51+
new ShellOrTerminal("alacritty-term", "Alacritty", "Alacritty", "--working-directory"),
5152
};
5253
}
5354
else

‎src/Native/Linux.cs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,8 @@ public void OpenInFileManager(string path)
145145

146146
public void OpenTerminal(string workdir, string args)
147147
{
148-
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
149-
var cwd = string.IsNullOrEmpty(workdir) ? home : workdir;
150-
151148
var startInfo = new ProcessStartInfo();
152-
startInfo.WorkingDirectory = cwd;
149+
startInfo.WorkingDirectory = workdir;
153150
startInfo.FileName = OS.ShellOrTerminal;
154151
startInfo.Arguments = args;
155152

‎src/Native/MacOS.cs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,12 @@ public void OpenInFileManager(string path)
118118
Process.Start("open", $"{path.Quoted()} -R");
119119
}
120120

121-
public void OpenTerminal(string workdir, string _)
121+
public void OpenTerminal(string workdir, string args)
122122
{
123-
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
124-
var dir = string.IsNullOrEmpty(workdir) ? home : workdir;
125-
Process.Start("open", $"-a {OS.ShellOrTerminal} {dir.Quoted()}");
123+
if (string.IsNullOrEmpty(args))
124+
Process.Start("open", $"-a {OS.ShellOrTerminal} {workdir.Quoted()}");
125+
else
126+
Process.Start("open", $"-a {OS.ShellOrTerminal} --args {args} {workdir.Quoted()}");
126127
}
127128

128129
public void OpenWithDefaultEditor(string file)

‎src/Native/OS.cs‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,17 @@ private static bool IsSafeBrowserTarget(string url)
273273
public static void OpenTerminal(string workdir)
274274
{
275275
if (string.IsNullOrEmpty(ShellOrTerminal))
276+
{
276277
Models.Notification.Send(workdir, "Terminal is not specified! Please confirm that the correct shell/terminal has been configured.", true);
277-
else
278-
_backend.OpenTerminal(workdir, ShellOrTerminalArgs);
278+
return;
279+
}
280+
281+
var cwd = string.IsNullOrEmpty(workdir) ? Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) : workdir;
282+
var args = ShellOrTerminalArgs;
283+
if (!string.IsNullOrEmpty(args))
284+
args = args.Replace("$FOLDER_NAME", Path.GetFileName(cwd.Trim().TrimEnd('/')));
285+
286+
_backend.OpenTerminal(cwd, args);
279287
}
280288

281289
public static void OpenWithDefaultEditor(string file)

‎src/Native/Windows.cs‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,19 @@ public void OpenBrowser(string url)
171171

172172
public void OpenTerminal(string workdir, string args)
173173
{
174-
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
175-
var cwd = string.IsNullOrEmpty(workdir) ? home : workdir;
176-
var terminal = OS.ShellOrTerminal;
174+
var startInfo = new ProcessStartInfo();
175+
startInfo.WorkingDirectory = workdir;
176+
startInfo.FileName = OS.ShellOrTerminal;
177+
startInfo.Arguments = args;
177178

178-
if (!File.Exists(terminal))
179+
try
179180
{
180-
Models.Notification.Send(workdir, "Terminal is not specified! Please confirm that the correct shell/terminal has been configured.", true);
181-
return;
181+
Process.Start(startInfo);
182+
}
183+
catch (Exception e)
184+
{
185+
Models.Notification.Send(workdir, $"Failed to start '{OS.ShellOrTerminal}'. Reason: {e.Message}", true);
182186
}
183-
184-
var startInfo = new ProcessStartInfo();
185-
startInfo.WorkingDirectory = cwd;
186-
startInfo.FileName = terminal;
187-
startInfo.Arguments = args;
188-
Process.Start(startInfo);
189187
}
190188

191189
public void OpenInFileManager(string path)

0 commit comments

Comments
 (0)