From 5bbd3fa65ea55db3cf5c76eb9f7bc09b5ecd95fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:55:08 +0000 Subject: [PATCH] Adopt MarkdownToInlinesConverter for instruction text formatting Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> --- .../Converters/MarkdownToInlinesConverter.cs | 160 +++++++++++++++++ .../DiscordChatExporter.Gui.csproj | 1 + .../LocalizationManager.English.cs | 40 ++--- .../LocalizationManager.French.cs | 41 +++-- .../LocalizationManager.German.cs | 42 +++-- .../LocalizationManager.Spanish.cs | 41 +++-- .../LocalizationManager.Ukrainian.cs | 42 +++-- .../Localization/LocalizationManager.cs | 19 +-- .../Views/Components/DashboardView.axaml | 161 +++++++----------- 9 files changed, 321 insertions(+), 226 deletions(-) create mode 100644 DiscordChatExporter.Gui/Converters/MarkdownToInlinesConverter.cs diff --git a/DiscordChatExporter.Gui/Converters/MarkdownToInlinesConverter.cs b/DiscordChatExporter.Gui/Converters/MarkdownToInlinesConverter.cs new file mode 100644 index 00000000..0837d4af --- /dev/null +++ b/DiscordChatExporter.Gui/Converters/MarkdownToInlinesConverter.cs @@ -0,0 +1,160 @@ +using System; +using System.Globalization; +using System.Linq; +using Avalonia.Controls.Documents; +using Avalonia.Data.Converters; +using Avalonia.Media; +using Markdig; +using Markdig.Syntax; +using Markdig.Syntax.Inlines; +using MarkdownInline = Markdig.Syntax.Inlines.Inline; + +namespace DiscordChatExporter.Gui.Converters; + +public class MarkdownToInlinesConverter : IValueConverter +{ + public static readonly MarkdownToInlinesConverter Instance = new(); + + private static readonly MarkdownPipeline MarkdownPipeline = new MarkdownPipelineBuilder() + .UseEmphasisExtras() + .Build(); + + private static void ProcessInline( + InlineCollection inlines, + MarkdownInline markdownInline, + FontWeight? fontWeight = null, + FontStyle? fontStyle = null, + TextDecorationCollection? textDecorations = null + ) + { + switch (markdownInline) + { + case LiteralInline literal: + { + var run = new Run(literal.Content.ToString()); + + if (fontWeight is not null) + run.FontWeight = fontWeight.Value; + if (fontStyle is not null) + run.FontStyle = fontStyle.Value; + if (textDecorations is not null) + run.TextDecorations = textDecorations; + + inlines.Add(run); + break; + } + + case LineBreakInline: + { + inlines.Add(new LineBreak()); + break; + } + + case EmphasisInline emphasis: + { + var newWeight = fontWeight; + var newStyle = fontStyle; + var newDecorations = textDecorations; + + switch (emphasis.DelimiterChar) + { + case '*' or '_' when emphasis.DelimiterCount == 2: + newWeight = FontWeight.SemiBold; + break; + case '*' or '_': + newStyle = FontStyle.Italic; + break; + case '~': + newDecorations = TextDecorations.Strikethrough; + break; + case '+': + newDecorations = TextDecorations.Underline; + break; + } + + foreach (var child in emphasis) + ProcessInline(inlines, child, newWeight, newStyle, newDecorations); + + break; + } + + case ContainerInline container: + { + foreach (var child in container) + ProcessInline(inlines, child, fontWeight, fontStyle, textDecorations); + + break; + } + } + } + + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + { + var inlines = new InlineCollection(); + if (value is not string { Length: > 0 } text) + return inlines; + + var isFirst = true; + + void RenderParagraph(ParagraphBlock paragraph) + { + if (!isFirst) + { + // Insert a blank line between paragraphs + inlines.Add(new LineBreak()); + inlines.Add(new LineBreak()); + } + + isFirst = false; + + foreach (var markdownInline in paragraph.Inline!) + ProcessInline(inlines, markdownInline); + } + + void RenderListBlock(ListBlock list) + { + var itemOrder = 1; + if (list.IsOrdered && int.TryParse(list.OrderedStart, out var startNum)) + itemOrder = startNum; + + foreach (var listItem in list.OfType()) + { + if (!isFirst) + inlines.Add(new LineBreak()); + isFirst = false; + + var prefix = list.IsOrdered ? $"{itemOrder++}. " : $"{list.BulletType} "; + inlines.Add(new Run(prefix)); + + foreach (var subBlock in listItem.OfType()) + { + if (subBlock is { Inline: not null } p) + foreach (var markdownInline in p.Inline) + ProcessInline(inlines, markdownInline); + } + } + } + + foreach (var block in Markdown.Parse(text, MarkdownPipeline)) + { + switch (block) + { + case ParagraphBlock { Inline: not null } paragraph: + RenderParagraph(paragraph); + break; + case ListBlock list: + RenderListBlock(list); + break; + } + } + + return inlines; + } + + public object? ConvertBack( + object? value, + Type targetType, + object? parameter, + CultureInfo culture + ) => throw new NotSupportedException(); +} diff --git a/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj b/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj index d52770a3..c2bca8c4 100644 --- a/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj +++ b/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj @@ -37,6 +37,7 @@ + diff --git a/DiscordChatExporter.Gui/Localization/LocalizationManager.English.cs b/DiscordChatExporter.Gui/Localization/LocalizationManager.English.cs index e6f66aef..063fdf7d 100644 --- a/DiscordChatExporter.Gui/Localization/LocalizationManager.English.cs +++ b/DiscordChatExporter.Gui/Localization/LocalizationManager.English.cs @@ -15,34 +15,34 @@ public partial class LocalizationManager // Token instructions (personal account) [nameof(TokenPersonalHeader)] = "To get the token for your personal account:", [nameof(TokenPersonalTosWarning)] = - "* Automating user accounts is technically against TOS —", - [nameof(TokenPersonalTosRisk)] = "use at your own risk", + "* Automating user accounts is technically against TOS — **use at your own risk**!", [nameof(TokenPersonalStep1Before)] = "1. Open Discord in your", [nameof(TokenPersonalStep1After)] = "and login", - [nameof(TokenPersonalStep2)] = "2. Open any server or direct message channel", - [nameof(TokenPersonalStep3)] = "3. Press Ctrl+Shift+I to show developer tools", - [nameof(TokenPersonalStep4)] = "4. Navigate to the Network tab", - [nameof(TokenPersonalStep5)] = "5. Press Ctrl+R to reload", - [nameof(TokenPersonalStep6)] = - "6. Switch between random channels to trigger network requests", - [nameof(TokenPersonalStep7)] = "7. Search for a request that starts with messages", - [nameof(TokenPersonalStep8)] = "8. Select the Headers tab on the right", - [nameof(TokenPersonalStep9)] = "9. Scroll down to the Request Headers section", - [nameof(TokenPersonalStep10)] = "10. Copy the value of the authorization header", + [nameof(TokenPersonalInstructions)] = """ + 2. Open any server or direct message channel + 3. Press **Ctrl+Shift+I** to show developer tools + 4. Navigate to the **Network** tab + 5. Press **Ctrl+R** to reload + 6. Switch between random channels to trigger network requests + 7. Search for a request that starts with **messages** + 8. Select the **Headers** tab on the right + 9. Scroll down to the **Request Headers** section + 10. Copy the value of the **authorization** header + """, [nameof(TokenWebBrowserLinkText)] = "web browser", // Token instructions (bot) [nameof(TokenBotHeader)] = "To get the token for your bot:", [nameof(TokenBotIntro)] = "The token is generated during bot creation. If you lost it, generate a new one:", [nameof(TokenBotStep1)] = "1. Open Discord", - [nameof(TokenBotStep2)] = "2. Open your application's settings", - [nameof(TokenBotStep3)] = "3. Navigate to the Bot section on the left", - [nameof(TokenBotStep4)] = "4. Under Token click Reset Token", - [nameof(TokenBotStep5)] = "5. Click Yes, do it! and authenticate to confirm", - [nameof(TokenBotStep6)] = - "* Integrations using the previous token will stop working until updated", - [nameof(TokenBotStep7Before)] = "* Your bot needs to have the", - [nameof(TokenBotStep7After)] = "enabled to read messages", + [nameof(TokenBotInstructions)] = """ + 2. Open your application's settings + 3. Navigate to the **Bot** section on the left + 4. Under **Token** click **Reset Token** + 5. Click **Yes, do it!** and authenticate to confirm + * Integrations using the previous token will stop working until updated + * Your bot needs to have the **Message Content Intent** enabled to read messages + """, [nameof(TokenDeveloperPortalLinkText)] = "developer portal", [nameof(TokenDocumentationLinkText)] = "documentation", [nameof(TokenHelpText)] = "If you have questions or issues, please refer to the", diff --git a/DiscordChatExporter.Gui/Localization/LocalizationManager.French.cs b/DiscordChatExporter.Gui/Localization/LocalizationManager.French.cs index 2a559885..ac048888 100644 --- a/DiscordChatExporter.Gui/Localization/LocalizationManager.French.cs +++ b/DiscordChatExporter.Gui/Localization/LocalizationManager.French.cs @@ -17,35 +17,34 @@ public partial class LocalizationManager // Token instructions (personal account) [nameof(TokenPersonalHeader)] = "Obtenir le token pour votre compte personnel :", [nameof(TokenPersonalTosWarning)] = - "* L'automatisation des comptes est techniquement contraire aux CGU —", - [nameof(TokenPersonalTosRisk)] = "à vos risques et périls", + "* L'automatisation des comptes est techniquement contraire aux CGU — **à vos risques et périls**!", [nameof(TokenPersonalStep1Before)] = "1. Ouvrez Discord dans votre", [nameof(TokenPersonalStep1After)] = "et connectez-vous", - [nameof(TokenPersonalStep2)] = - "2. Ouvrez n'importe quel serveur ou canal de message direct", - [nameof(TokenPersonalStep3)] = - "3. Appuyez sur Ctrl+Shift+I pour afficher les outils de développement", - [nameof(TokenPersonalStep4)] = "4. Naviguez vers l'onglet Network", - [nameof(TokenPersonalStep5)] = "5. Appuyez sur Ctrl+R pour recharger", - [nameof(TokenPersonalStep6)] = "6. Changez de canal pour déclencher des requêtes réseau", - [nameof(TokenPersonalStep7)] = "7. Cherchez une requête commençant par messages", - [nameof(TokenPersonalStep8)] = "8. Sélectionnez l'onglet Headers à droite", - [nameof(TokenPersonalStep9)] = "9. Faites défiler jusqu'à la section Request Headers", - [nameof(TokenPersonalStep10)] = "10. Copiez la valeur de l'en-tête authorization", + [nameof(TokenPersonalInstructions)] = """ + 2. Ouvrez n'importe quel serveur ou canal de message direct + 3. Appuyez sur **Ctrl+Shift+I** pour afficher les outils de développement + 4. Naviguez vers l'onglet **Network** + 5. Appuyez sur **Ctrl+R** pour recharger + 6. Changez de canal pour déclencher des requêtes réseau + 7. Cherchez une requête commençant par **messages** + 8. Sélectionnez l'onglet **Headers** à droite + 9. Faites défiler jusqu'à la section **Request Headers** + 10. Copiez la valeur de l'en-tête **authorization** + """, [nameof(TokenWebBrowserLinkText)] = "navigateur web", // Token instructions (bot) [nameof(TokenBotHeader)] = "Obtenir le token pour votre bot :", [nameof(TokenBotIntro)] = "Le token est généré lors de la création du bot. Si vous l'avez perdu, générez-en un nouveau :", [nameof(TokenBotStep1)] = "1. Ouvrez Discord", - [nameof(TokenBotStep2)] = "2. Ouvrez les paramètres de votre application", - [nameof(TokenBotStep3)] = "3. Naviguez vers la section Bot à gauche", - [nameof(TokenBotStep4)] = "4. Sous Token, cliquez sur Reset Token", - [nameof(TokenBotStep5)] = "5. Cliquez sur Yes, do it! et confirmez", - [nameof(TokenBotStep6)] = - "* Les intégrations utilisant l'ancien token cesseront de fonctionner jusqu'à leur mise à jour", - [nameof(TokenBotStep7Before)] = "* Votre bot doit avoir l'option", - [nameof(TokenBotStep7After)] = "activée pour lire les messages", + [nameof(TokenBotInstructions)] = """ + 2. Ouvrez les paramètres de votre application + 3. Naviguez vers la section **Bot** à gauche + 4. Sous **Token**, cliquez sur **Reset Token** + 5. Cliquez sur **Yes, do it!** et confirmez + * Les intégrations utilisant l'ancien token cesseront de fonctionner jusqu'à leur mise à jour + * Votre bot doit avoir l'option **Message Content Intent** activée pour lire les messages + """, [nameof(TokenDeveloperPortalLinkText)] = "portail développeur", [nameof(TokenDocumentationLinkText)] = "documentation", [nameof(TokenHelpText)] = "Pour les questions ou problèmes, veuillez consulter la", diff --git a/DiscordChatExporter.Gui/Localization/LocalizationManager.German.cs b/DiscordChatExporter.Gui/Localization/LocalizationManager.German.cs index 5cb3e3b8..b568077d 100644 --- a/DiscordChatExporter.Gui/Localization/LocalizationManager.German.cs +++ b/DiscordChatExporter.Gui/Localization/LocalizationManager.German.cs @@ -17,36 +17,34 @@ public partial class LocalizationManager // Token instructions (personal account) [nameof(TokenPersonalHeader)] = "Token für Ihr persönliches Konto abrufen:", [nameof(TokenPersonalTosWarning)] = - "* Das Automatisieren von Benutzerkonten verstößt technisch gegen die AGB —", - [nameof(TokenPersonalTosRisk)] = "auf eigene Gefahr", + "* Das Automatisieren von Benutzerkonten verstößt technisch gegen die AGB — **auf eigene Gefahr**!", [nameof(TokenPersonalStep1Before)] = "1. Öffnen Sie Discord in Ihrem", [nameof(TokenPersonalStep1After)] = "und melden Sie sich an", - [nameof(TokenPersonalStep2)] = - "2. Öffnen Sie einen Server oder einen direkten Nachrichtenkanal", - [nameof(TokenPersonalStep3)] = - "3. Drücken Sie Ctrl+Shift+I, um die Entwicklertools anzuzeigen", - [nameof(TokenPersonalStep4)] = "4. Navigieren Sie zum Reiter Network", - [nameof(TokenPersonalStep5)] = "5. Drücken Sie Ctrl+R zum Neuladen", - [nameof(TokenPersonalStep6)] = - "6. Wechseln Sie zwischen Kanälen, um Netzwerkanfragen auszulösen", - [nameof(TokenPersonalStep7)] = "7. Suchen Sie nach einer Anfrage, die mit messages beginnt", - [nameof(TokenPersonalStep8)] = "8. Wählen Sie den Reiter Headers auf der rechten Seite", - [nameof(TokenPersonalStep9)] = "9. Scrollen Sie nach unten zum Abschnitt Request Headers", - [nameof(TokenPersonalStep10)] = "10. Kopieren Sie den Wert des Headers authorization", + [nameof(TokenPersonalInstructions)] = """ + 2. Öffnen Sie einen Server oder einen direkten Nachrichtenkanal + 3. Drücken Sie **Ctrl+Shift+I**, um die Entwicklertools anzuzeigen + 4. Navigieren Sie zum Reiter **Network** + 5. Drücken Sie **Ctrl+R** zum Neuladen + 6. Wechseln Sie zwischen Kanälen, um Netzwerkanfragen auszulösen + 7. Suchen Sie nach einer Anfrage, die mit **messages** beginnt + 8. Wählen Sie den Reiter **Headers** auf der rechten Seite + 9. Scrollen Sie nach unten zum Abschnitt **Request Headers** + 10. Kopieren Sie den Wert des Headers **authorization** + """, [nameof(TokenWebBrowserLinkText)] = "Webbrowser", // Token instructions (bot) [nameof(TokenBotHeader)] = "Token für Ihren Bot abrufen:", [nameof(TokenBotIntro)] = "Der Token wird bei der Bot-Erstellung generiert. Falls er verloren gegangen ist, generieren Sie einen neuen:", [nameof(TokenBotStep1)] = "1. Öffnen Sie Discord", - [nameof(TokenBotStep2)] = "2. Öffnen Sie die Einstellungen Ihrer Anwendung", - [nameof(TokenBotStep3)] = "3. Navigieren Sie zum Abschnitt Bot auf der linken Seite", - [nameof(TokenBotStep4)] = "4. Klicken Sie unter Token auf Reset Token", - [nameof(TokenBotStep5)] = "5. Klicken Sie auf Yes, do it! und bestätigen Sie", - [nameof(TokenBotStep6)] = - "* Integrationen, die den alten Token verwenden, hören auf zu funktionieren, bis sie aktualisiert werden", - [nameof(TokenBotStep7Before)] = "* Ihr Bot benötigt die aktivierte", - [nameof(TokenBotStep7After)] = "um Nachrichten zu lesen", + [nameof(TokenBotInstructions)] = """ + 2. Öffnen Sie die Einstellungen Ihrer Anwendung + 3. Navigieren Sie zum Abschnitt **Bot** auf der linken Seite + 4. Klicken Sie unter **Token** auf **Reset Token** + 5. Klicken Sie auf **Yes, do it!** und bestätigen Sie + * Integrationen, die den alten Token verwenden, hören auf zu funktionieren, bis sie aktualisiert werden + * Ihr Bot benötigt die aktivierte **Message Content Intent**, um Nachrichten zu lesen + """, [nameof(TokenDeveloperPortalLinkText)] = "Entwicklerportal", [nameof(TokenDocumentationLinkText)] = "Dokumentation", [nameof(TokenHelpText)] = "Bei Fragen oder Problemen lesen Sie die", diff --git a/DiscordChatExporter.Gui/Localization/LocalizationManager.Spanish.cs b/DiscordChatExporter.Gui/Localization/LocalizationManager.Spanish.cs index 96ec3c23..d0d91b08 100644 --- a/DiscordChatExporter.Gui/Localization/LocalizationManager.Spanish.cs +++ b/DiscordChatExporter.Gui/Localization/LocalizationManager.Spanish.cs @@ -15,35 +15,34 @@ public partial class LocalizationManager // Token instructions (personal account) [nameof(TokenPersonalHeader)] = "Cómo obtener el token para tu cuenta personal:", [nameof(TokenPersonalTosWarning)] = - "* Automatizar cuentas de usuario técnicamente va en contra de los ToS —", - [nameof(TokenPersonalTosRisk)] = "bajo tu propio riesgo", + "* Automatizar cuentas de usuario técnicamente va en contra de los ToS — **bajo tu propio riesgo**!", [nameof(TokenPersonalStep1Before)] = "1. Abre Discord en tu", [nameof(TokenPersonalStep1After)] = "e inicia sesión", - [nameof(TokenPersonalStep2)] = "2. Abre cualquier servidor o canal de mensaje directo", - [nameof(TokenPersonalStep3)] = - "3. Presiona Ctrl+Shift+I para mostrar las herramientas de desarrollo", - [nameof(TokenPersonalStep4)] = "4. Navega a la pestaña Network", - [nameof(TokenPersonalStep5)] = "5. Presiona Ctrl+R para recargar", - [nameof(TokenPersonalStep6)] = - "6. Cambia entre canales para activar solicitudes de red", - [nameof(TokenPersonalStep7)] = "7. Busca una solicitud que comience con messages", - [nameof(TokenPersonalStep8)] = "8. Selecciona la pestaña Headers a la derecha", - [nameof(TokenPersonalStep9)] = "9. Desplázate hasta la sección Request Headers", - [nameof(TokenPersonalStep10)] = "10. Copia el valor del encabezado authorization", + [nameof(TokenPersonalInstructions)] = """ + 2. Abre cualquier servidor o canal de mensaje directo + 3. Presiona **Ctrl+Shift+I** para mostrar las herramientas de desarrollo + 4. Navega a la pestaña **Network** + 5. Presiona **Ctrl+R** para recargar + 6. Cambia entre canales para activar solicitudes de red + 7. Busca una solicitud que comience con **messages** + 8. Selecciona la pestaña **Headers** a la derecha + 9. Desplázate hasta la sección **Request Headers** + 10. Copia el valor del encabezado **authorization** + """, [nameof(TokenWebBrowserLinkText)] = "navegador web", // Token instructions (bot) [nameof(TokenBotHeader)] = "Cómo obtener el token para tu bot:", [nameof(TokenBotIntro)] = "El token se genera al crear el bot. Si lo perdiste, genera uno nuevo:", [nameof(TokenBotStep1)] = "1. Abre Discord", - [nameof(TokenBotStep2)] = "2. Abre la configuración de tu aplicación", - [nameof(TokenBotStep3)] = "3. Navega a la sección Bot en el lado izquierdo", - [nameof(TokenBotStep4)] = "4. En Token, haz clic en Reset Token", - [nameof(TokenBotStep5)] = "5. Haz clic en Yes, do it! y autentica para confirmar", - [nameof(TokenBotStep6)] = - "* Las integraciones que usen el token anterior dejarán de funcionar hasta que se actualicen", - [nameof(TokenBotStep7Before)] = "* Tu bot necesita tener habilitado", - [nameof(TokenBotStep7After)] = "para leer mensajes", + [nameof(TokenBotInstructions)] = """ + 2. Abre la configuración de tu aplicación + 3. Navega a la sección **Bot** en el lado izquierdo + 4. En **Token**, haz clic en **Reset Token** + 5. Haz clic en **Yes, do it!** y autentica para confirmar + * Las integraciones que usen el token anterior dejarán de funcionar hasta que se actualicen + * Tu bot necesita tener habilitado **Message Content Intent** para leer mensajes + """, [nameof(TokenDeveloperPortalLinkText)] = "portal de desarrolladores", [nameof(TokenDocumentationLinkText)] = "documentación", [nameof(TokenHelpText)] = "Si tienes preguntas o problemas, consulta la", diff --git a/DiscordChatExporter.Gui/Localization/LocalizationManager.Ukrainian.cs b/DiscordChatExporter.Gui/Localization/LocalizationManager.Ukrainian.cs index 7241a26d..56e4d1cb 100644 --- a/DiscordChatExporter.Gui/Localization/LocalizationManager.Ukrainian.cs +++ b/DiscordChatExporter.Gui/Localization/LocalizationManager.Ukrainian.cs @@ -15,36 +15,34 @@ public partial class LocalizationManager // Token instructions (personal account) [nameof(TokenPersonalHeader)] = "Як отримати токен для персонального акаунту:", [nameof(TokenPersonalTosWarning)] = - "* Автоматизація облікових записів технічно порушує Умови обслуговування —", - [nameof(TokenPersonalTosRisk)] = "на власний ризик", + "* Автоматизація облікових записів технічно порушує Умови обслуговування — **на власний ризик**!", [nameof(TokenPersonalStep1Before)] = "1. Відкрийте Discord у вашому", [nameof(TokenPersonalStep1After)] = "та увійдіть", - [nameof(TokenPersonalStep2)] = - "2. Відкрийте будь-який сервер або канал особистих повідомлень", - [nameof(TokenPersonalStep3)] = - "3. Натисніть Ctrl+Shift+I, щоб відкрити інструменти розробника", - [nameof(TokenPersonalStep4)] = "4. Перейдіть на вкладку Network", - [nameof(TokenPersonalStep5)] = "5. Натисніть Ctrl+R для перезавантаження", - [nameof(TokenPersonalStep6)] = - "6. Перемикайтеся між каналами, щоб викликати мережеві запити", - [nameof(TokenPersonalStep7)] = "7. Знайдіть запит, що починається з messages", - [nameof(TokenPersonalStep8)] = "8. Виберіть вкладку Headers праворуч", - [nameof(TokenPersonalStep9)] = "9. Прокрутіть до розділу Request Headers", - [nameof(TokenPersonalStep10)] = "10. Скопіюйте значення заголовка authorization", + [nameof(TokenPersonalInstructions)] = """ + 2. Відкрийте будь-який сервер або канал особистих повідомлень + 3. Натисніть **Ctrl+Shift+I**, щоб відкрити інструменти розробника + 4. Перейдіть на вкладку **Network** + 5. Натисніть **Ctrl+R** для перезавантаження + 6. Перемикайтеся між каналами, щоб викликати мережеві запити + 7. Знайдіть запит, що починається з **messages** + 8. Виберіть вкладку **Headers** праворуч + 9. Прокрутіть до розділу **Request Headers** + 10. Скопіюйте значення заголовка **authorization** + """, [nameof(TokenWebBrowserLinkText)] = "веб-браузер", // Token instructions (bot) [nameof(TokenBotHeader)] = "Як отримати токен для бота:", [nameof(TokenBotIntro)] = "Токен генерується під час створення бота. Якщо ви його втратили, згенеруйте новий:", [nameof(TokenBotStep1)] = "1. Відкрийте Discord", - [nameof(TokenBotStep2)] = "2. Відкрийте налаштування вашого застосунку", - [nameof(TokenBotStep3)] = "3. Перейдіть до розділу Bot ліворуч", - [nameof(TokenBotStep4)] = "4. В розділі Token натисніть Reset Token", - [nameof(TokenBotStep5)] = "5. Натисніть Yes, do it! та підтвердьте", - [nameof(TokenBotStep6)] = - "* Інтеграції, що використовують попередній токен, перестануть працювати", - [nameof(TokenBotStep7Before)] = "* Ваш бот повинен мати включений", - [nameof(TokenBotStep7After)] = "для читання повідомлень", + [nameof(TokenBotInstructions)] = """ + 2. Відкрийте налаштування вашого застосунку + 3. Перейдіть до розділу **Bot** ліворуч + 4. В розділі **Token** натисніть **Reset Token** + 5. Натисніть **Yes, do it!** та підтвердьте + * Інтеграції, що використовують попередній токен, перестануть працювати + * Ваш бот повинен мати включений **Message Content Intent** для читання повідомлень + """, [nameof(TokenDeveloperPortalLinkText)] = "портал розробника", [nameof(TokenDocumentationLinkText)] = "документацію", [nameof(TokenHelpText)] = "Якщо у вас є запитання або проблеми, зверніться до", diff --git a/DiscordChatExporter.Gui/Localization/LocalizationManager.cs b/DiscordChatExporter.Gui/Localization/LocalizationManager.cs index 16697715..a599917a 100644 --- a/DiscordChatExporter.Gui/Localization/LocalizationManager.cs +++ b/DiscordChatExporter.Gui/Localization/LocalizationManager.cs @@ -87,31 +87,16 @@ public partial class LocalizationManager // Token instructions (personal account) public string TokenPersonalHeader => Get(); public string TokenPersonalTosWarning => Get(); - public string TokenPersonalTosRisk => Get(); public string TokenPersonalStep1Before => Get(); public string TokenPersonalStep1After => Get(); - public string TokenPersonalStep2 => Get(); - public string TokenPersonalStep3 => Get(); - public string TokenPersonalStep4 => Get(); - public string TokenPersonalStep5 => Get(); - public string TokenPersonalStep6 => Get(); - public string TokenPersonalStep7 => Get(); - public string TokenPersonalStep8 => Get(); - public string TokenPersonalStep9 => Get(); - public string TokenPersonalStep10 => Get(); + public string TokenPersonalInstructions => Get(); public string TokenWebBrowserLinkText => Get(); // Token instructions (bot) public string TokenBotHeader => Get(); public string TokenBotIntro => Get(); public string TokenBotStep1 => Get(); - public string TokenBotStep2 => Get(); - public string TokenBotStep3 => Get(); - public string TokenBotStep4 => Get(); - public string TokenBotStep5 => Get(); - public string TokenBotStep6 => Get(); - public string TokenBotStep7Before => Get(); - public string TokenBotStep7After => Get(); + public string TokenBotInstructions => Get(); public string TokenDeveloperPortalLinkText => Get(); public string TokenDocumentationLinkText => Get(); public string TokenHelpText => Get(); diff --git a/DiscordChatExporter.Gui/Views/Components/DashboardView.axaml b/DiscordChatExporter.Gui/Views/Components/DashboardView.axaml index e5162259..347c5d6f 100644 --- a/DiscordChatExporter.Gui/Views/Components/DashboardView.axaml +++ b/DiscordChatExporter.Gui/Views/Components/DashboardView.axaml @@ -219,119 +219,74 @@ - + + + + + - - - - - - + + + + + + + - - - + - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + + + + + + + - - + - - - + + + + - - + - - - - - - - - - - - - - - - - - - - - - + + + + +