Skip to content

Commit cdd1926

Browse files
committed
refactor: rewrite git apply implementation
- Do not translate commandline options for `git` - Re-design combox layout for `git apply` popup Signed-off-by: leo <[email protected]>
1 parent ddfc868 commit cdd1926

File tree

12 files changed

+36
-99
lines changed

12 files changed

+36
-99
lines changed

src/Models/ApplyWhiteSpaceMode.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,22 @@
22
{
33
public class ApplyWhiteSpaceMode
44
{
5+
public static readonly ApplyWhiteSpaceMode[] Supported =
6+
[
7+
new ApplyWhiteSpaceMode("No Warn", "Turns off the trailing whitespace warning", "nowarn"),
8+
new ApplyWhiteSpaceMode("Warn", "Outputs warnings for a few such errors, but applies", "warn"),
9+
new ApplyWhiteSpaceMode("Error", "Raise errors and refuses to apply the patch", "error"),
10+
new ApplyWhiteSpaceMode("Error All", "Similar to 'error', but shows more", "error-all"),
11+
];
12+
513
public string Name { get; set; }
614
public string Desc { get; set; }
715
public string Arg { get; set; }
816

917
public ApplyWhiteSpaceMode(string n, string d, string a)
1018
{
11-
Name = App.Text(n);
12-
Desc = App.Text(d);
19+
Name = n;
20+
Desc = d;
1321
Arg = a;
1422
}
1523
}

src/Resources/Locales/de_DE.axaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,10 @@
2525
<x:String x:Key="Text.AIAssistant.Tip" xml:space="preserve">Verwende OpenAI, um Commit-Nachrichten zu generieren</x:String>
2626
<x:String x:Key="Text.AIAssistant.Use" xml:space="preserve">Als Commit-Nachricht verwenden</x:String>
2727
<x:String x:Key="Text.Apply" xml:space="preserve">Patch</x:String>
28-
<x:String x:Key="Text.Apply.Error" xml:space="preserve">Fehler</x:String>
29-
<x:String x:Key="Text.Apply.Error.Desc" xml:space="preserve">Fehler werfen und anwenden des Patches verweigern</x:String>
30-
<x:String x:Key="Text.Apply.ErrorAll" xml:space="preserve">Alle Fehler</x:String>
31-
<x:String x:Key="Text.Apply.ErrorAll.Desc" xml:space="preserve">Ähnlich wie 'Fehler', zeigt aber mehr an</x:String>
3228
<x:String x:Key="Text.Apply.File" xml:space="preserve">Patch-Datei:</x:String>
3329
<x:String x:Key="Text.Apply.File.Placeholder" xml:space="preserve">Wähle die anzuwendende .patch-Datei</x:String>
3430
<x:String x:Key="Text.Apply.IgnoreWS" xml:space="preserve">Ignoriere Leerzeichenänderungen</x:String>
35-
<x:String x:Key="Text.Apply.NoWarn" xml:space="preserve">Keine Warnungen</x:String>
36-
<x:String x:Key="Text.Apply.NoWarn.Desc" xml:space="preserve">Keine Warnung vor Leerzeichen am Zeilenende</x:String>
3731
<x:String x:Key="Text.Apply.Title" xml:space="preserve">Patch anwenden</x:String>
38-
<x:String x:Key="Text.Apply.Warn" xml:space="preserve">Warnen</x:String>
39-
<x:String x:Key="Text.Apply.Warn.Desc" xml:space="preserve">Gibt eine Warnung für ein paar solcher Fehler aus, aber wendet es an</x:String>
4032
<x:String x:Key="Text.Apply.WS" xml:space="preserve">Leerzeichen:</x:String>
4133
<x:String x:Key="Text.ApplyStash" xml:space="preserve">Stash anwenden</x:String>
4234
<x:String x:Key="Text.ApplyStash.DropAfterApply" xml:space="preserve">Nach dem Anwenden löschen</x:String>

src/Resources/Locales/en_US.axaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@
2222
<x:String x:Key="Text.AIAssistant.Tip" xml:space="preserve">Use AI to generate commit message</x:String>
2323
<x:String x:Key="Text.AIAssistant.Use" xml:space="preserve">APPLY AS COMMIT MESSAGE</x:String>
2424
<x:String x:Key="Text.Apply" xml:space="preserve">Patch</x:String>
25-
<x:String x:Key="Text.Apply.Error" xml:space="preserve">Error</x:String>
26-
<x:String x:Key="Text.Apply.Error.Desc" xml:space="preserve">Raise errors and refuses to apply the patch</x:String>
27-
<x:String x:Key="Text.Apply.ErrorAll" xml:space="preserve">Error All</x:String>
28-
<x:String x:Key="Text.Apply.ErrorAll.Desc" xml:space="preserve">Similar to 'error', but shows more</x:String>
2925
<x:String x:Key="Text.Apply.File" xml:space="preserve">Patch File:</x:String>
3026
<x:String x:Key="Text.Apply.File.Placeholder" xml:space="preserve">Select .patch file to apply</x:String>
3127
<x:String x:Key="Text.Apply.IgnoreWS" xml:space="preserve">Ignore whitespace changes</x:String>
32-
<x:String x:Key="Text.Apply.NoWarn" xml:space="preserve">No Warn</x:String>
33-
<x:String x:Key="Text.Apply.NoWarn.Desc" xml:space="preserve">Turns off the trailing whitespace warning</x:String>
3428
<x:String x:Key="Text.Apply.Title" xml:space="preserve">Apply Patch</x:String>
35-
<x:String x:Key="Text.Apply.Warn" xml:space="preserve">Warn</x:String>
36-
<x:String x:Key="Text.Apply.Warn.Desc" xml:space="preserve">Outputs warnings for a few such errors, but applies</x:String>
3729
<x:String x:Key="Text.Apply.WS" xml:space="preserve">Whitespace:</x:String>
3830
<x:String x:Key="Text.ApplyStash" xml:space="preserve">Apply Stash</x:String>
3931
<x:String x:Key="Text.ApplyStash.DropAfterApply" xml:space="preserve">Delete after applying</x:String>

src/Resources/Locales/es_ES.axaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,10 @@
2525
<x:String x:Key="Text.AIAssistant.Tip" xml:space="preserve">Usar OpenAI para generar mensaje de commit</x:String>
2626
<x:String x:Key="Text.AIAssistant.Use" xml:space="preserve">APLICAR CÓMO MENSAJE DE COMMIT</x:String>
2727
<x:String x:Key="Text.Apply" xml:space="preserve">Aplicar Parche</x:String>
28-
<x:String x:Key="Text.Apply.Error" xml:space="preserve">Error</x:String>
29-
<x:String x:Key="Text.Apply.Error.Desc" xml:space="preserve">Genera errores y se niega a aplicar el parche</x:String>
30-
<x:String x:Key="Text.Apply.ErrorAll" xml:space="preserve">Error Todo</x:String>
31-
<x:String x:Key="Text.Apply.ErrorAll.Desc" xml:space="preserve">Similar a 'error', pero muestra más</x:String>
3228
<x:String x:Key="Text.Apply.File" xml:space="preserve">Archivo del Parche:</x:String>
3329
<x:String x:Key="Text.Apply.File.Placeholder" xml:space="preserve">Seleccionar archivo .patch para aplicar</x:String>
3430
<x:String x:Key="Text.Apply.IgnoreWS" xml:space="preserve">Ignorar cambios de espacios en blanco</x:String>
35-
<x:String x:Key="Text.Apply.NoWarn" xml:space="preserve">Sin Advertencia</x:String>
36-
<x:String x:Key="Text.Apply.NoWarn.Desc" xml:space="preserve">Desactiva la advertencia de espacios en blanco al final</x:String>
3731
<x:String x:Key="Text.Apply.Title" xml:space="preserve">Aplicar Parche</x:String>
38-
<x:String x:Key="Text.Apply.Warn" xml:space="preserve">Advertencia</x:String>
39-
<x:String x:Key="Text.Apply.Warn.Desc" xml:space="preserve">Genera advertencias para algunos de estos errores, pero aplica</x:String>
4032
<x:String x:Key="Text.Apply.WS" xml:space="preserve">Espacios en Blanco:</x:String>
4133
<x:String x:Key="Text.ApplyStash" xml:space="preserve">Aplicar Stash</x:String>
4234
<x:String x:Key="Text.ApplyStash.DropAfterApply" xml:space="preserve">Borrar después de aplicar</x:String>

src/Resources/Locales/fr_FR.axaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,10 @@
2323
<x:String x:Key="Text.AIAssistant" xml:space="preserve">Assistant IA</x:String>
2424
<x:String x:Key="Text.AIAssistant.Tip" xml:space="preserve">Utiliser l'IA pour générer un message de commit</x:String>
2525
<x:String x:Key="Text.Apply" xml:space="preserve">Appliquer</x:String>
26-
<x:String x:Key="Text.Apply.Error" xml:space="preserve">Erreur</x:String>
27-
<x:String x:Key="Text.Apply.Error.Desc" xml:space="preserve">Soulever les erreurs et refuser d'appliquer le patch</x:String>
28-
<x:String x:Key="Text.Apply.ErrorAll" xml:space="preserve">Toutes les erreurs</x:String>
29-
<x:String x:Key="Text.Apply.ErrorAll.Desc" xml:space="preserve">Similaire à 'Erreur', mais plus détaillé</x:String>
3026
<x:String x:Key="Text.Apply.File" xml:space="preserve">Fichier de patch :</x:String>
3127
<x:String x:Key="Text.Apply.File.Placeholder" xml:space="preserve">Selectionner le fichier .patch à appliquer</x:String>
3228
<x:String x:Key="Text.Apply.IgnoreWS" xml:space="preserve">Ignorer les changements d'espaces blancs</x:String>
33-
<x:String x:Key="Text.Apply.NoWarn" xml:space="preserve">Pas d'avertissement</x:String>
34-
<x:String x:Key="Text.Apply.NoWarn.Desc" xml:space="preserve">Désactiver l'avertissement sur les espaces blancs terminaux</x:String>
3529
<x:String x:Key="Text.Apply.Title" xml:space="preserve">Appliquer le patch</x:String>
36-
<x:String x:Key="Text.Apply.Warn" xml:space="preserve">Avertissement</x:String>
37-
<x:String x:Key="Text.Apply.Warn.Desc" xml:space="preserve">Affiche des avertissements pour ce type d'erreurs tout en appliquant le patch</x:String>
3830
<x:String x:Key="Text.Apply.WS" xml:space="preserve">Espaces blancs :</x:String>
3931
<x:String x:Key="Text.Archive" xml:space="preserve">Archiver...</x:String>
4032
<x:String x:Key="Text.Archive.File" xml:space="preserve">Enregistrer l'archive sous :</x:String>

src/Resources/Locales/it_IT.axaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,10 @@
2525
<x:String x:Key="Text.AIAssistant.Tip" xml:space="preserve">Usa AI per generare il messaggio di commit</x:String>
2626
<x:String x:Key="Text.AIAssistant.Use" xml:space="preserve">APPLICA COME MESSAGGIO DI COMMIT</x:String>
2727
<x:String x:Key="Text.Apply" xml:space="preserve">Applica</x:String>
28-
<x:String x:Key="Text.Apply.Error" xml:space="preserve">Errore</x:String>
29-
<x:String x:Key="Text.Apply.Error.Desc" xml:space="preserve">Genera errori e si rifiuta di applicare la patch</x:String>
30-
<x:String x:Key="Text.Apply.ErrorAll" xml:space="preserve">Tutti gli errori</x:String>
31-
<x:String x:Key="Text.Apply.ErrorAll.Desc" xml:space="preserve">Simile a 'errore', ma mostra di più</x:String>
3228
<x:String x:Key="Text.Apply.File" xml:space="preserve">File Patch:</x:String>
3329
<x:String x:Key="Text.Apply.File.Placeholder" xml:space="preserve">Seleziona file .patch da applicare</x:String>
3430
<x:String x:Key="Text.Apply.IgnoreWS" xml:space="preserve">Ignora modifiche agli spazi</x:String>
35-
<x:String x:Key="Text.Apply.NoWarn" xml:space="preserve">Nessun avviso</x:String>
36-
<x:String x:Key="Text.Apply.NoWarn.Desc" xml:space="preserve">Disattiva l'avviso sugli spazi finali</x:String>
3731
<x:String x:Key="Text.Apply.Title" xml:space="preserve">Applica Patch</x:String>
38-
<x:String x:Key="Text.Apply.Warn" xml:space="preserve">Avviso</x:String>
39-
<x:String x:Key="Text.Apply.Warn.Desc" xml:space="preserve">Mostra avvisi per alcuni errori, ma applica comunque</x:String>
4032
<x:String x:Key="Text.Apply.WS" xml:space="preserve">Spazi:</x:String>
4133
<x:String x:Key="Text.ApplyStash" xml:space="preserve">Applica lo stash</x:String>
4234
<x:String x:Key="Text.ApplyStash.DropAfterApply" xml:space="preserve">Rimuovi dopo aver applicato</x:String>

src/Resources/Locales/pt_BR.axaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,10 @@
4848
<x:String x:Key="Text.AIAssistant" xml:space="preserve">Assietente IA</x:String>
4949
<x:String x:Key="Text.AIAssistant.Tip" xml:space="preserve">Utilizar IA para gerar mensagem de commit</x:String>
5050
<x:String x:Key="Text.Apply" xml:space="preserve">Patch</x:String>
51-
<x:String x:Key="Text.Apply.Error" xml:space="preserve">Erro</x:String>
52-
<x:String x:Key="Text.Apply.Error.Desc" xml:space="preserve">Erros levantados e se recusa a aplicar o patch</x:String>
53-
<x:String x:Key="Text.Apply.ErrorAll" xml:space="preserve">Erro Total</x:String>
54-
<x:String x:Key="Text.Apply.ErrorAll.Desc" xml:space="preserve">Semelhante a 'erro', mas mostra mais</x:String>
5551
<x:String x:Key="Text.Apply.File" xml:space="preserve">Arquivo de Patch:</x:String>
5652
<x:String x:Key="Text.Apply.File.Placeholder" xml:space="preserve">Selecione o arquivo .patch para aplicar</x:String>
5753
<x:String x:Key="Text.Apply.IgnoreWS" xml:space="preserve">Ignorar mudanças de espaço em branco</x:String>
58-
<x:String x:Key="Text.Apply.NoWarn" xml:space="preserve">Sem Aviso</x:String>
59-
<x:String x:Key="Text.Apply.NoWarn.Desc" xml:space="preserve">Desativa o aviso de espaço em branco no final</x:String>
6054
<x:String x:Key="Text.Apply.Title" xml:space="preserve">Aplicar Patch</x:String>
61-
<x:String x:Key="Text.Apply.Warn" xml:space="preserve">Aviso</x:String>
62-
<x:String x:Key="Text.Apply.Warn.Desc" xml:space="preserve">Emite avisos para alguns erros, mas aplica</x:String>
6355
<x:String x:Key="Text.Apply.WS" xml:space="preserve">Espaço em Branco:</x:String>
6456
<x:String x:Key="Text.Archive" xml:space="preserve">Arquivar...</x:String>
6557
<x:String x:Key="Text.Archive.File" xml:space="preserve">Salvar Arquivo Como:</x:String>

src/Resources/Locales/ru_RU.axaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,10 @@
2525
<x:String x:Key="Text.AIAssistant.Tip" xml:space="preserve">Использовать OpenAI для создания сообщения о ревизии</x:String>
2626
<x:String x:Key="Text.AIAssistant.Use" xml:space="preserve">ПРИМЕНИТЬ КАК СООБЩЕНИЕ РЕВИЗИИ</x:String>
2727
<x:String x:Key="Text.Apply" xml:space="preserve">Исправить </x:String>
28-
<x:String x:Key="Text.Apply.Error" xml:space="preserve">Ошибка</x:String>
29-
<x:String x:Key="Text.Apply.Error.Desc" xml:space="preserve">Выдает ошибки и отказывается применять заплатку</x:String>
30-
<x:String x:Key="Text.Apply.ErrorAll" xml:space="preserve">Все ошибки</x:String>
31-
<x:String x:Key="Text.Apply.ErrorAll.Desc" xml:space="preserve">Аналогично «ошибке», но показывает больше</x:String>
3228
<x:String x:Key="Text.Apply.File" xml:space="preserve">Файл заплатки:</x:String>
3329
<x:String x:Key="Text.Apply.File.Placeholder" xml:space="preserve">Выберите файл .patch для применения</x:String>
3430
<x:String x:Key="Text.Apply.IgnoreWS" xml:space="preserve">Игнорировать изменения пробелов</x:String>
35-
<x:String x:Key="Text.Apply.NoWarn" xml:space="preserve">Нет предупреждений</x:String>
36-
<x:String x:Key="Text.Apply.NoWarn.Desc" xml:space="preserve">Отключить предупреждения о пробелах в конце</x:String>
3731
<x:String x:Key="Text.Apply.Title" xml:space="preserve">Применить заплатку</x:String>
38-
<x:String x:Key="Text.Apply.Warn" xml:space="preserve">Предупреждать</x:String>
39-
<x:String x:Key="Text.Apply.Warn.Desc" xml:space="preserve">Выдавать предупреждения о нескольких таких ошибках, но применять</x:String>
4032
<x:String x:Key="Text.Apply.WS" xml:space="preserve">Пробел:</x:String>
4133
<x:String x:Key="Text.ApplyStash" xml:space="preserve">Отложить</x:String>
4234
<x:String x:Key="Text.ApplyStash.DropAfterApply" xml:space="preserve">Удалить после применения</x:String>

src/Resources/Locales/zh_CN.axaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,10 @@
2525
<x:String x:Key="Text.AIAssistant.Tip" xml:space="preserve">使用AI助手生成提交信息</x:String>
2626
<x:String x:Key="Text.AIAssistant.Use" xml:space="preserve">应用本次生成</x:String>
2727
<x:String x:Key="Text.Apply" xml:space="preserve">应用补丁(apply)</x:String>
28-
<x:String x:Key="Text.Apply.Error" xml:space="preserve">错误</x:String>
29-
<x:String x:Key="Text.Apply.Error.Desc" xml:space="preserve">输出错误,并终止应用补丁</x:String>
30-
<x:String x:Key="Text.Apply.ErrorAll" xml:space="preserve">更多错误</x:String>
31-
<x:String x:Key="Text.Apply.ErrorAll.Desc" xml:space="preserve">与【错误】级别相似,但输出内容更多</x:String>
3228
<x:String x:Key="Text.Apply.File" xml:space="preserve">补丁文件 :</x:String>
3329
<x:String x:Key="Text.Apply.File.Placeholder" xml:space="preserve">选择补丁文件</x:String>
3430
<x:String x:Key="Text.Apply.IgnoreWS" xml:space="preserve">忽略空白符号</x:String>
35-
<x:String x:Key="Text.Apply.NoWarn" xml:space="preserve">忽略</x:String>
36-
<x:String x:Key="Text.Apply.NoWarn.Desc" xml:space="preserve">关闭所有警告</x:String>
3731
<x:String x:Key="Text.Apply.Title" xml:space="preserve">应用补丁</x:String>
38-
<x:String x:Key="Text.Apply.Warn" xml:space="preserve">警告</x:String>
39-
<x:String x:Key="Text.Apply.Warn.Desc" xml:space="preserve">应用补丁,输出关于空白符的警告</x:String>
4032
<x:String x:Key="Text.Apply.WS" xml:space="preserve">空白符号处理 :</x:String>
4133
<x:String x:Key="Text.ApplyStash" xml:space="preserve">应用贮藏</x:String>
4234
<x:String x:Key="Text.ApplyStash.DropAfterApply" xml:space="preserve">在成功应用后丢弃该贮藏</x:String>

src/Resources/Locales/zh_TW.axaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,10 @@
2525
<x:String x:Key="Text.AIAssistant.Tip" xml:space="preserve">使用 AI 產生提交訊息</x:String>
2626
<x:String x:Key="Text.AIAssistant.Use" xml:space="preserve">套用為提交訊息</x:String>
2727
<x:String x:Key="Text.Apply" xml:space="preserve">套用修補檔 (apply patch)</x:String>
28-
<x:String x:Key="Text.Apply.Error" xml:space="preserve">錯誤</x:String>
29-
<x:String x:Key="Text.Apply.Error.Desc" xml:space="preserve">輸出錯誤,並中止套用修補檔</x:String>
30-
<x:String x:Key="Text.Apply.ErrorAll" xml:space="preserve">更多錯誤</x:String>
31-
<x:String x:Key="Text.Apply.ErrorAll.Desc" xml:space="preserve">與 [錯誤] 級別相似,但輸出更多內容</x:String>
3228
<x:String x:Key="Text.Apply.File" xml:space="preserve">修補檔:</x:String>
3329
<x:String x:Key="Text.Apply.File.Placeholder" xml:space="preserve">選擇修補檔</x:String>
3430
<x:String x:Key="Text.Apply.IgnoreWS" xml:space="preserve">忽略空白符號</x:String>
35-
<x:String x:Key="Text.Apply.NoWarn" xml:space="preserve">忽略</x:String>
36-
<x:String x:Key="Text.Apply.NoWarn.Desc" xml:space="preserve">關閉所有警告</x:String>
3731
<x:String x:Key="Text.Apply.Title" xml:space="preserve">套用修補檔</x:String>
38-
<x:String x:Key="Text.Apply.Warn" xml:space="preserve">警告</x:String>
39-
<x:String x:Key="Text.Apply.Warn.Desc" xml:space="preserve">套用修補檔,輸出關於空白字元的警告</x:String>
4032
<x:String x:Key="Text.Apply.WS" xml:space="preserve">空白字元處理:</x:String>
4133
<x:String x:Key="Text.ApplyStash" xml:space="preserve">套用擱置變更</x:String>
4234
<x:String x:Key="Text.ApplyStash.DropAfterApply" xml:space="preserve">套用擱置變更後刪除</x:String>

0 commit comments

Comments
 (0)