From 3f6851d91e10d165cf3152024d2e9d5676a6c39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Mart=C3=ADnez?= <171921708+rubenitx@users.noreply.github.com> Date: Mon, 23 Nov 2026 17:19:58 +0100 Subject: [PATCH 1/4] fix(i18n): Write Markdown in Hangul in Korean, translate the tray panel and keep incomplete languages hidden --- src/Home/LanguagePicker.cs | 5 +- src/Home/TrayPanel.cs | 6 +- src/I18n.Korean.Core.cs | 8 +- src/I18n.Korean.Documents.cs | 16 +- src/I18n.Korean.HomeSettings.cs | 5 +- src/I18n.Languages.cs | 27 ++- src/Markdown/MarkdownWindow.cs | 11 +- src/Settings.cs | 2 +- tests/app/AppTestsI18n.cs | 18 +- tests/app/AppTestsI18nFinal.cs | 322 +++++++++++++++++++++++++++++++ tests/app/AppTestsW6Contrast.cs | 30 ++- tests/app/AppTestsW6Sensitive.cs | 2 +- 12 files changed, 426 insertions(+), 26 deletions(-) diff --git a/src/Home/LanguagePicker.cs b/src/Home/LanguagePicker.cs index 33211fc..cab80b3 100644 --- a/src/Home/LanguagePicker.cs +++ b/src/Home/LanguagePicker.cs @@ -93,8 +93,9 @@ double P(double dip) header.Children.Add(new TextBlock { Text = Title, FontFamily = Ds.Title.FontFamily, FontWeight = Ds.Title.Weight, FontSize = 25, Foreground = Ds.Brush(pal.Label) }); header.Children.Add(new TextBlock { - Text = I18n.T("Busca por nombre o código. Los idiomas en vista previa usan inglés donde falte traducción.", - "Search by name or code. Preview languages use English where translations are missing."), + Text = I18n.PreviewsListed ? I18n.T("Busca por nombre o código. Los idiomas en vista previa usan inglés donde falte traducción.", + "Search by name or code. Preview languages use English where translations are missing.") + : I18n.T("Busca por nombre o código.", "Search by name or code.", "Suche nach Name oder Sprachcode."), Margin = new Thickness(0, 5, 0, 10), TextWrapping = TextWrapping.Wrap, Foreground = Ds.Brush(pal.Label2) }); var field = new Border diff --git a/src/Home/TrayPanel.cs b/src/Home/TrayPanel.cs index e821a94..cfb6c2a 100644 --- a/src/Home/TrayPanel.cs +++ b/src/Home/TrayPanel.cs @@ -489,8 +489,8 @@ void BuildItems(bool recording, bool scrolling, bool strip) AddCapture("video", recording ? I18n.T("Detener grabaci\u00F3n", "Stop recording") : I18n.T("V\u00EDdeo", "Video"), recording ? "stop!" : "video", 2).Alert = recording; bool paused = recording && Recorder.Paused; if (recording && Recorder.CanPause) Add(KRow, "pause", paused ? I18n.T("Reanudar grabaci\u00F3n", "Resume recording") : I18n.T("Pausar grabaci\u00F3n", "Pause recording"), paused ? "play" : "pause", 2); - if (!recording) AddCapture("gif", "GIF", "gif", 2); - AddCapture("markdown", "Markdown", "markdown", 2); + if (!recording) AddCapture("gif", I18n.T("GIF", "GIF", "GIF"), "gif", 2); + AddCapture("markdown", I18n.T("Markdown", "Markdown", "Markdown"), "markdown", 2); Add(KLine, null, null, null, 0); if (strip && recent.Count > 0) { @@ -974,7 +974,7 @@ static string When(DateTime t) if (d == now) return I18n.T("Hoy, ", "Today, ") + hm; if (d == now.AddDays(-1)) return I18n.T("Ayer, ", "Yesterday, ") + hm; if (I18n.IsKorean) return t.ToString("M/d HH:mm", CultureInfo.InvariantCulture); - if (I18n.IsGerman) return t.ToString("d. MMM", Es).TrimEnd('.') + ", " + hm; + if (I18n.IsGerman) return t.ToString("d. MMM", I18n.Culture).TrimEnd('.') + ", " + hm; return (I18n.IsSpanish ? t.ToString("d MMM", Es).TrimEnd('.') : t.ToString("MMM d", CultureInfo.GetCultureInfo("en-US"))) + ", " + hm; } diff --git a/src/I18n.Korean.Core.cs b/src/I18n.Korean.Core.cs index caa931d..b547955 100644 --- a/src/I18n.Korean.Core.cs +++ b/src/I18n.Korean.Core.cs @@ -9,7 +9,7 @@ public static partial class I18n static void RegisterKoreanCore(Dictionary map) { // FileAssoc.cs - map["Screenshots, video and GIF, with a video player and a Markdown and XML viewer"] = "\uCEA1\uCC98\uC640 \uB3D9\uC601\uC0C1\u00B7GIF \uB179\uD654, \uB3D9\uC601\uC0C1 \uD50C\uB808\uC774\uC5B4\uC640 Markdown\u00B7XML \uBDF0\uC5B4"; + map["Screenshots, video and GIF, with a video player and a Markdown and XML viewer"] = "\uCEA1\uCC98\uC640 \uB3D9\uC601\uC0C1\u00B7GIF \uB179\uD654, \uB3D9\uC601\uC0C1 \uD50C\uB808\uC774\uC5B4\uC640 \uB9C8\uD06C\uB2E4\uC6B4\u00B7XML \uBDF0\uC5B4"; // LinksWindow.cs map["Quick links"] = "\uBC14\uB85C\uAC00\uAE30"; @@ -208,7 +208,7 @@ static void RegisterKoreanCore(Dictionary map) map["Noted {0} folders in my quick links!"] = "\uD3F4\uB354 {0}\uAC1C\uB97C \uBC14\uB85C\uAC00\uAE30\uC5D0 \uCD94\uAC00\uD588\uC5B4\uC694!"; map["And I'll open the file for you."] = "\uD30C\uC77C\uB3C4 \uC5F4\uC5B4 \uB4DC\uB9B4\uAC8C\uC694."; map["And I'll open the {0} files for you."] = "\uD30C\uC77C {0}\uAC1C\uB3C4 \uC5F4\uC5B4 \uB4DC\uB9B4\uAC8C\uC694."; - map["I don't know what to do with \u201C{0}\u201D. Drop images, videos, XML or Markdown."] = "\u2018{0}\u2019\uC740(\uB294) \uC5F4 \uC218 \uC5C6\uC5B4\uC694. \uC774\uBBF8\uC9C0, \uB3D9\uC601\uC0C1, XML \uB610\uB294 Markdown \uD30C\uC77C\uC744 \uB193\uC544 \uC8FC\uC138\uC694."; + map["I don't know what to do with \u201C{0}\u201D. Drop images, videos, XML or Markdown."] = "\u2018{0}\u2019\uC740(\uB294) \uC5F4 \uC218 \uC5C6\uC5B4\uC694. \uC774\uBBF8\uC9C0, \uB3D9\uC601\uC0C1, XML \uB610\uB294 \uB9C8\uD06C\uB2E4\uC6B4 \uD30C\uC77C\uC744 \uB193\uC544 \uC8FC\uC138\uC694."; map["Opening {0} files!"] = "\uD30C\uC77C {0}\uAC1C\uB97C \uC5F4\uAC8C\uC694!"; map["To the editor!"] = "\uD3B8\uC9D1\uAE30\uC5D0\uC11C \uC5F4\uAC8C\uC694!"; map["Let's watch it!"] = "\uAC19\uC774 \uBCFC\uAE4C\uC694?"; @@ -459,7 +459,9 @@ static void RegisterKoreanCore(Dictionary map) map["Settings"] = "\uC124\uC815"; map["Language"] = "\uC5B8\uC5B4"; map["Auto"] = "\uC790\uB3D9"; - map["Markdown document"] = "Markdown \uBB38\uC11C"; + map["GIF"] = "GIF"; + map["Markdown"] = "\uB9C8\uD06C\uB2E4\uC6B4"; + map["Markdown document"] = "\uB9C8\uD06C\uB2E4\uC6B4 \uBB38\uC11C"; map["XML document"] = "XML \uBB38\uC11C"; map["MKV video"] = "MKV \uB3D9\uC601\uC0C1"; map["Red"] = "\uBE68\uAC15"; diff --git a/src/I18n.Korean.Documents.cs b/src/I18n.Korean.Documents.cs index ac74c61..3390d83 100644 --- a/src/I18n.Korean.Documents.cs +++ b/src/I18n.Korean.Documents.cs @@ -76,7 +76,7 @@ static void RegisterKoreanDocuments(Dictionary map) // Markdown/MarkdownWindow.Access.cs map["Mode"] = "\uBAA8\uB4DC"; map["XML text"] = "XML \uD14D\uC2A4\uD2B8"; - map["Markdown text"] = "Markdown \uD14D\uC2A4\uD2B8"; + map["Markdown text"] = "\uB9C8\uD06C\uB2E4\uC6B4 \uD14D\uC2A4\uD2B8"; map["Preview"] = "\uBBF8\uB9AC \uBCF4\uAE30"; map["Search or filter"] = "\uAC80\uC0C9 \uB610\uB294 \uD544\uD130"; map["Width of the text and the preview"] = "\uD14D\uC2A4\uD2B8\uC640 \uBBF8\uB9AC \uBCF4\uAE30 \uB108\uBE44"; @@ -84,7 +84,7 @@ static void RegisterKoreanDocuments(Dictionary map) // Markdown/MarkdownWindow.cs map["No earlier XML in the folder."] = "\uD3F4\uB354\uC5D0 \uC774\uC804 XML\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."; map["No later XML in the folder."] = "\uD3F4\uB354\uC5D0 \uB2E4\uC74C XML\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."; - map["Markdown and XML"] = "Markdown \uBC0F XML"; + map["Markdown and XML"] = "\uB9C8\uD06C\uB2E4\uC6B4 \uBC0F XML"; map["Save changes to \u201C{0}\u201D?"] = "\u2018{0}\u2019\uC758 \uBCC0\uACBD \uC0AC\uD56D\uC744 \uC800\uC7A5\uD560\uAE4C\uC694?"; map["Untitled"] = "\uC81C\uBAA9 \uC5C6\uC74C"; map["If you don't save them, they will be lost."] = "\uC800\uC7A5\uD558\uC9C0 \uC54A\uC73C\uBA74 \uBCC0\uACBD \uC0AC\uD56D\uC774 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."; @@ -107,7 +107,7 @@ static void RegisterKoreanDocuments(Dictionary map) map["Copy XML"] = "XML \uBCF5\uC0AC"; map["Tidy"] = "\uBB38\uC11C \uC815\uB9AC"; map["Insert contents"] = "\uBAA9\uCC28 \uC0BD\uC785"; - map["Copy Markdown"] = "Markdown \uBCF5\uC0AC"; + map["Copy Markdown"] = "\uB9C8\uD06C\uB2E4\uC6B4 \uBCF5\uC0AC"; map["Copy as image"] = "\uC774\uBBF8\uC9C0\uB85C \uBCF5\uC0AC"; map["Bold (Ctrl+B)"] = "\uAD75\uAC8C (Ctrl+B)"; map["Italic (Ctrl+I)"] = "\uAE30\uC6B8\uC784\uAF34 (Ctrl+I)"; @@ -165,7 +165,7 @@ static void RegisterKoreanDocuments(Dictionary map) map["Fix it in the editor: this view updates by itself."] = "\uD3B8\uC9D1\uAE30\uC5D0\uC11C \uC218\uC815\uD558\uBA74 \uC774 \uBCF4\uAE30\uC5D0 \uC790\uB3D9\uC73C\uB85C \uBC18\uC601\uB429\uB2C8\uB2E4."; map["Switch to Edit to fix it."] = "\uD3B8\uC9D1 \uBAA8\uB4DC\uB85C \uC804\uD658\uD574 \uC218\uC815\uD558\uC138\uC694."; map["Go to error"] = "\uC624\uB958 \uC704\uCE58\uB85C \uC774\uB3D9"; - map["View, edit and turn Markdown or XML into a capture"] = "Markdown \uB610\uB294 XML \uBB38\uC11C\uB97C \uBCF4\uACE0 \uD3B8\uC9D1\uD558\uAC70\uB098 \uCEA1\uCC98\uB85C \uB9CC\uB4DC\uC138\uC694"; + map["View, edit and turn Markdown or XML into a capture"] = "\uB9C8\uD06C\uB2E4\uC6B4 \uB610\uB294 XML \uBB38\uC11C\uB97C \uBCF4\uACE0 \uD3B8\uC9D1\uD558\uAC70\uB098 \uCEA1\uCC98\uB85C \uB9CC\uB4DC\uC138\uC694"; map["unsaved"] = "\uC800\uC7A5 \uC548 \uB428"; map["saved"] = "\uC800\uC7A5\uB428"; map["no changes"] = "\uBCC0\uACBD \uC5C6\uC74C"; @@ -183,8 +183,8 @@ static void RegisterKoreanDocuments(Dictionary map) map["Some bytes are not valid {0}: they show as \u201C\uFFFD\u201D."] = "{0} \uD615\uC2DD\uC5D0 \uB9DE\uC9C0 \uC54A\uB294 \uBC14\uC774\uD2B8\uB294 \u2018\uFFFD\u2019\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4."; map["Loading {0}\u2026"] = "{0} \uBD88\uB7EC\uC624\uB294 \uC911\u2026"; map["Could not read the file."] = "\uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."; - map["Open a Markdown or XML document"] = "Markdown \uB610\uB294 XML \uBB38\uC11C \uC5F4\uAE30"; - map["Markdown, XML and text|*.md;*.markdown;*.mdown;*.mkd;*.xml;*.xsd;*.config;*.svg;*.xaml;*.txt|All files|*.*"] = "Markdown, XML \uBC0F \uD14D\uC2A4\uD2B8|*.md;*.markdown;*.mdown;*.mkd;*.xml;*.xsd;*.config;*.svg;*.xaml;*.txt|\uBAA8\uB4E0 \uD30C\uC77C|*.*"; + map["Open a Markdown or XML document"] = "\uB9C8\uD06C\uB2E4\uC6B4 \uB610\uB294 XML \uBB38\uC11C \uC5F4\uAE30"; + map["Markdown, XML and text|*.md;*.markdown;*.mdown;*.mkd;*.xml;*.xsd;*.config;*.svg;*.xaml;*.txt|All files|*.*"] = "\uB9C8\uD06C\uB2E4\uC6B4, XML \uBC0F \uD14D\uC2A4\uD2B8|*.md;*.markdown;*.mdown;*.mkd;*.xml;*.xsd;*.config;*.svg;*.xaml;*.txt|\uBAA8\uB4E0 \uD30C\uC77C|*.*"; map["Could not open file picker."] = "\uD30C\uC77C \uC120\uD0DD \uCC3D\uC744 \uC5F4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."; map["There is no text or .md/.xml file on the clipboard."] = "\uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uD14D\uC2A4\uD2B8\uB098 .md/.xml \uD30C\uC77C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."; map["Could not read clipboard."] = "\uD074\uB9BD\uBCF4\uB4DC\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."; @@ -200,7 +200,7 @@ static void RegisterKoreanDocuments(Dictionary map) map["Saved at {0}."] = "{0}\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4."; map["Save as"] = "\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"; map["XML|*.xml|All files|*.*"] = "XML|*.xml|\uBAA8\uB4E0 \uD30C\uC77C|*.*"; - map["Markdown|*.md|Text|*.txt|All files|*.*"] = "Markdown|*.md|\uD14D\uC2A4\uD2B8|*.txt|\uBAA8\uB4E0 \uD30C\uC77C|*.*"; + map["Markdown|*.md|Text|*.txt|All files|*.*"] = "\uB9C8\uD06C\uB2E4\uC6B4|*.md|\uD14D\uC2A4\uD2B8|*.txt|\uBAA8\uB4E0 \uD30C\uC77C|*.*"; map["Could not open save dialog."] = "\uC800\uC7A5 \uB300\uD654 \uC0C1\uC790\uB97C \uC5F4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."; map["Could not open the folder."] = "\uD3F4\uB354\uB97C \uC5F4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."; map["Reload \u201C{0}\u201D from disk?"] = "\uB514\uC2A4\uD06C\uC5D0\uC11C \u2018{0}\u2019\uC744(\uB97C) \uB2E4\uC2DC \uBD88\uB7EC\uC62C\uAE4C\uC694?"; @@ -242,7 +242,7 @@ static void RegisterKoreanDocuments(Dictionary map) map["As an image it would be over 16,000 pixels high and hard to view properly. In PDF it stays whole, split across pages."] = "\uC774\uBBF8\uC9C0 \uB192\uC774\uAC00 16,000\uD53D\uC140\uC744 \uB118\uC5B4 \uC77D\uAE30 \uC5B4\uB835\uC2B5\uB2C8\uB2E4. PDF\uB85C \uC800\uC7A5\uD558\uBA74 \uC804\uCCB4 \uB0B4\uC6A9\uC744 \uC5EC\uB7EC \uD398\uC774\uC9C0\uC5D0 \uB098\uB204\uC5B4 \uB2F4\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."; map["Save as PDF"] = "PDF\uB85C \uC800\uC7A5"; map["XML copied."] = "XML\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4."; - map["Markdown copied."] = "Markdown\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4."; + map["Markdown copied."] = "\uB9C8\uD06C\uB2E4\uC6B4\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4."; map["Copied"] = "\uBCF5\uC0AC\uB428"; map["Image copied."] = "\uC774\uBBF8\uC9C0\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4."; map["Could not create image."] = "\uC774\uBBF8\uC9C0\uB97C \uB9CC\uB4E4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."; diff --git a/src/I18n.Korean.HomeSettings.cs b/src/I18n.Korean.HomeSettings.cs index 5070bdf..89068c3 100644 --- a/src/I18n.Korean.HomeSettings.cs +++ b/src/I18n.Korean.HomeSettings.cs @@ -20,7 +20,7 @@ static void RegisterKoreanHomeSettings(Dictionary map) map["Only counts active time at the PC: if you step away for 5 minutes, your eyes and body have rested and timer resets. Never interrupts during calls, presentations, recordings, full screen, or Windows Focus Assist: waits until you finish. Take a break anytime from the desktop mascot menu (\u201CTake a break with me\u201D)."] = "PC\uB97C \uC2E4\uC81C\uB85C \uC0AC\uC6A9\uD558\uB294 \uC2DC\uAC04\uB9CC \uC149\uB2C8\uB2E4. \uC790\uB9AC\uB97C 5\uBD84 \uBE44\uC6B0\uBA74 \uD734\uC2DD\uC73C\uB85C \uBCF4\uACE0 \uD0C0\uC774\uBA38\uB97C \uCD08\uAE30\uD654\uD569\uB2C8\uB2E4. \uD1B5\uD654, \uBC1C\uD45C, \uB179\uD654, \uC804\uCCB4 \uD654\uBA74 \uB610\uB294 Windows \uC9D1\uC911 \uC9C0\uC6D0 \uC0AC\uC6A9 \uC911\uC5D0\uB294 \uB05D\uB0A0 \uB54C\uAE4C\uC9C0 \uAE30\uB2E4\uB9BD\uB2C8\uB2E4. \uBC14\uD0D5 \uD654\uBA74 \uB9C8\uC2A4\uCF54\uD2B8 \uBA54\uB274\uC758 \u2018\uD568\uAED8 \uC26C\uAE30\u2019\uB85C \uC5B8\uC81C\uB4E0\uC9C0 \uC274 \uC218 \uC788\uC2B5\uB2C8\uB2E4."; map["Start from here or from the mascot desktop menu (\u201CFocus\u201D). During focus, mascot quietly reads by your side without speaking, wearing a timer on its head. Healthy breaks wait until rest periods. If you step away for 5+ minutes, timer pauses. Without the mascot on desktop, runs quietly and notifies via system toasts."] = "\uC5EC\uAE30 \uB610\uB294 \uBC14\uD0D5 \uD654\uBA74 \uB9C8\uC2A4\uCF54\uD2B8\uC758 \u2018\uC9D1\uC911\u2019 \uBA54\uB274\uC5D0\uC11C \uC2DC\uC791\uD558\uC138\uC694. \uC9D1\uC911\uD558\uB294 \uB3D9\uC548 \uB9C8\uC2A4\uCF54\uD2B8\uB294 \uBA38\uB9AC\uC5D0 \uD0C0\uC774\uBA38\uB97C \uC5B9\uACE0 \uC870\uC6A9\uD788 \uCC45\uC744 \uC77D\uC2B5\uB2C8\uB2E4. \uAC74\uAC15 \uC54C\uB9BC\uC740 \uD734\uC2DD \uC2DC\uAC04\uAE4C\uC9C0 \uAE30\uB2E4\uB9AC\uACE0, \uC790\uB9AC\uB97C 5\uBD84 \uC774\uC0C1 \uBE44\uC6B0\uBA74 \uD0C0\uC774\uBA38\uAC00 \uBA48\uCDA5\uB2C8\uB2E4. \uBC14\uD0D5 \uD654\uBA74 \uB9C8\uC2A4\uCF54\uD2B8\uAC00 \uAEBC\uC838 \uC788\uC73C\uBA74 \uC2DC\uC2A4\uD15C \uC54C\uB9BC\uC73C\uB85C \uC54C\uB824 \uC90D\uB2C8\uB2E4."; map["Everything stays local. With smartwatch connected, data travels directly between Google and your PC; credentials are encrypted with Windows DPAPI and you can disconnect anytime. Mascot offers encouragement, not medical advice. If you sleep under 6 hours, break intervals adapt slightly earlier; if you recently walked, movement pauses wait; once daily water goal is reached, reminders stop."] = "\uB370\uC774\uD130\uB294 \uC774 \uAE30\uAE30\uC5D0 \uC800\uC7A5\uD569\uB2C8\uB2E4. \uC6CC\uCE58\uB97C \uC5F0\uACB0\uD558\uBA74 PC\uC640 Google\uC774 \uC9C1\uC811 \uD1B5\uC2E0\uD569\uB2C8\uB2E4. \uC778\uC99D \uC815\uBCF4\uB294 Windows DPAPI\uB85C \uC554\uD638\uD654\uD558\uBA70 \uC5B8\uC81C\uB4E0\uC9C0 \uC5F0\uACB0\uC744 \uB04A\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uB9C8\uC2A4\uCF54\uD2B8\uB294 \uC77C\uC0C1\uC758 \uAC74\uAC15 \uC2B5\uAD00\uC744 \uC751\uC6D0\uD558\uBA70 \uC758\uB8CC \uC870\uC5B8\uC744 \uC81C\uACF5\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC218\uBA74\uC774 6\uC2DC\uAC04 \uBBF8\uB9CC\uC774\uBA74 \uC870\uAE08 \uC77C\uCC0D \uD734\uC2DD\uC744 \uAD8C\uD558\uACE0, \uCD5C\uADFC\uC5D0 \uAC78\uC5C8\uB2E4\uBA74 \uC6C0\uC9C1\uC774\uAE30 \uC54C\uB9BC\uC744 \uBBF8\uB8F9\uB2C8\uB2E4. \uBB3C \uC12D\uCDE8 \uBAA9\uD45C\uB97C \uB2EC\uC131\uD558\uBA74 \uD574\uB2F9 \uC54C\uB9BC\uC744 \uBA48\uCDA5\uB2C8\uB2E4."; - map["You can also drag & drop files onto the mascot: images go to editor, videos to player, XML/Markdown to viewer, text to notes, folders to quick links. Reminders wait until you are active, and overdue reminders alert upon wake."] = "\uD30C\uC77C\uC744 \uB9C8\uC2A4\uCF54\uD2B8\uC5D0 \uB04C\uC5B4\uB2E4 \uB193\uC73C\uBA74 \uC774\uBBF8\uC9C0\uB294 \uD3B8\uC9D1\uAE30, \uB3D9\uC601\uC0C1\uC740 \uD50C\uB808\uC774\uC5B4, XML\uACFC Markdown\uC740 \uBDF0\uC5B4\uB85C \uC5FD\uB2C8\uB2E4. \uD14D\uC2A4\uD2B8\uB294 \uBA54\uBAA8\uC5D0, \uD3F4\uB354\uB294 \uBC14\uB85C\uAC00\uAE30\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4. \uC54C\uB9BC\uC740 PC\uB97C \uB2E4\uC2DC \uC0AC\uC6A9\uD560 \uB54C \uD45C\uC2DC\uD558\uBA70, \uC808\uC804 \uC911\uC5D0 \uC9C0\uB09C \uC54C\uB9BC\uC740 \uC808\uC804 \uD574\uC81C \uD6C4 \uC54C\uB824 \uC90D\uB2C8\uB2E4."; + map["You can also drag & drop files onto the mascot: images go to editor, videos to player, XML/Markdown to viewer, text to notes, folders to quick links. Reminders wait until you are active, and overdue reminders alert upon wake."] = "\uD30C\uC77C\uC744 \uB9C8\uC2A4\uCF54\uD2B8\uC5D0 \uB04C\uC5B4\uB2E4 \uB193\uC73C\uBA74 \uC774\uBBF8\uC9C0\uB294 \uD3B8\uC9D1\uAE30, \uB3D9\uC601\uC0C1\uC740 \uD50C\uB808\uC774\uC5B4, XML\uACFC \uB9C8\uD06C\uB2E4\uC6B4\uC740 \uBDF0\uC5B4\uB85C \uC5FD\uB2C8\uB2E4. \uD14D\uC2A4\uD2B8\uB294 \uBA54\uBAA8\uC5D0, \uD3F4\uB354\uB294 \uBC14\uB85C\uAC00\uAE30\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4. \uC54C\uB9BC\uC740 PC\uB97C \uB2E4\uC2DC \uC0AC\uC6A9\uD560 \uB54C \uD45C\uC2DC\uD558\uBA70, \uC808\uC804 \uC911\uC5D0 \uC9C0\uB09C \uC54C\uB9BC\uC740 \uC808\uC804 \uD574\uC81C \uD6C4 \uC54C\uB824 \uC90D\uB2C8\uB2E4."; map["On the desktop it consumes slightly more: ~10 MB RAM and ~1% CPU while moving (almost none while sleeping). Automatically hides during full-screen games or presentations, and never appears in screenshots or screen shares. Click to open menu, rapid clicks to tickle; drag anywhere you like."] = "\uBC14\uD0D5 \uD654\uBA74\uC5D0\uC11C\uB294 \uBA54\uBAA8\uB9AC\uB97C \uC57D 10MB, \uC6C0\uC9C1\uC77C \uB54C CPU\uB97C \uC57D 1% \uC0AC\uC6A9\uD569\uB2C8\uB2E4. \uC7A0\uB4E4\uBA74 CPU\uB97C \uAC70\uC758 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC804\uCCB4 \uD654\uBA74 \uAC8C\uC784\uC774\uB098 \uBC1C\uD45C \uC911\uC5D0\uB294 \uC790\uB3D9\uC73C\uB85C \uC228\uACE0 \uCEA1\uCC98\uC640 \uD654\uBA74 \uACF5\uC720\uC5D0\uB3C4 \uB098\uD0C0\uB098\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uD074\uB9AD\uD558\uBA74 \uBA54\uB274\uAC00 \uC5F4\uB9AC\uACE0 \uC5F0\uB2EC\uC544 \uD074\uB9AD\uD558\uBA74 \uAC04\uC9C0\uB7FC\uC744 \uD0D1\uB2C8\uB2E4. \uC6D0\uD558\uB294 \uACF3\uC73C\uB85C \uB04C\uC5B4 \uC62E\uAE30\uC138\uC694."; map["The mascot uses your activity data to care for you: alerts after an hour of inactivity, encourages movement in morning/afternoon, celebrates walks, active minutes and step goals, adapts breaks if you had poor sleep, and includes steps in daily summary."] = "\uB9C8\uC2A4\uCF54\uD2B8\uB294 \uD65C\uB3D9 \uAE30\uB85D\uC744 \uBCF4\uACE0 \uD55C \uC2DC\uAC04 \uB3D9\uC548 \uC6C0\uC9C1\uC774\uC9C0 \uC54A\uC73C\uBA74 \uC54C\uB824 \uC90D\uB2C8\uB2E4. \uC544\uCE68\uACFC \uC624\uD6C4\uC5D0 \uC6C0\uC9C1\uC784\uC744 \uAD8C\uD558\uACE0 \uC0B0\uCC45, \uD65C\uB3D9 \uC2DC\uAC04, \uAC78\uC74C \uBAA9\uD45C \uB2EC\uC131\uC744 \uCD95\uD558\uD569\uB2C8\uB2E4. \uC7A0\uC744 \uC124\uCCE4\uB2E4\uBA74 \uD734\uC2DD \uAC04\uACA9\uC744 \uC870\uC815\uD558\uACE0 \uD558\uB8E8 \uC694\uC57D\uC5D0 \uAC78\uC74C \uC218\uB3C4 \uD45C\uC2DC\uD569\uB2C8\uB2E4."; map["You cancelled the connection."] = "\uC5F0\uACB0\uC744 \uCDE8\uC18C\uD588\uC2B5\uB2C8\uB2E4."; @@ -471,7 +471,7 @@ static void RegisterKoreanHomeSettings(Dictionary map) map["Capture full screen"] = "\uC804\uCCB4 \uD654\uBA74 \uCEA1\uCC98"; map["Capture active window"] = "\uD65C\uC131 \uCC3D \uCEA1\uCC98"; map["Copy screen text"] = "\uD654\uBA74 \uD14D\uC2A4\uD2B8 \uBCF5\uC0AC"; - map["View and sort Markdown"] = "Markdown \uBCF4\uAE30 \uBC0F \uC815\uB82C"; + map["View and sort Markdown"] = "\uB9C8\uD06C\uB2E4\uC6B4 \uBCF4\uAE30 \uBC0F \uC815\uB82C"; map["Timed capture"] = "\uD0C0\uC774\uBA38 \uCEA1\uCC98"; map["An area"] = "\uC601\uC5ED"; map["Last area"] = "\uB9C8\uC9C0\uB9C9 \uC601\uC5ED"; @@ -651,6 +651,7 @@ static void RegisterKoreanHomeSettings(Dictionary map) map["Capture, annotate and share in seconds"] = "\uCEA1\uCC98\uD558\uACE0 \uC8FC\uC11D\uC744 \uB2EC\uC544 \uBC14\uB85C \uACF5\uC720\uD558\uC138\uC694"; map["Choose language"] = "\uC5B8\uC5B4 \uC120\uD0DD"; map["Search by name or code. Preview languages use English where translations are missing."] = "\uC774\uB984\uC774\uB098 \uCF54\uB4DC\uB85C \uAC80\uC0C9\uD558\uC138\uC694. \uBBF8\uB9AC \uBCF4\uAE30 \uC5B8\uC5B4\uC5D0\uC11C \uBC88\uC5ED\uC774 \uBE60\uC9C4 \uBB38\uAD6C\uB294 \uC601\uC5B4\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4."; + map["Search by name or code."] = "\uC774\uB984\uC774\uB098 \uCF54\uB4DC\uB85C \uAC80\uC0C9\uD558\uC138\uC694."; map["Search languages"] = "\uC5B8\uC5B4 \uAC80\uC0C9"; map["Languages"] = "\uC5B8\uC5B4 \uBAA9\uB85D"; map["No matching languages."] = "\uC77C\uCE58\uD558\uB294 \uC5B8\uC5B4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."; diff --git a/src/I18n.Languages.cs b/src/I18n.Languages.cs index 2e91043..9a78096 100644 --- a/src/I18n.Languages.cs +++ b/src/I18n.Languages.cs @@ -25,7 +25,15 @@ internal LanguageOption(string code, string name, string searchNames, int previe internal string Name { get { return Code == "auto" ? T("Automático", "Auto") : NativeName; } } } - internal static readonly LanguageOption[] Languages = + // The six preview languages (fr, pt, zh, hi, ar, bn) are written but not offered until their translations are + // complete: with this off the picker, the settings search, Settings and Welcome list only Automatic, Spanish, + // English, German and Korean, and a saved choice of a hidden language loads as Automatic. Flip it to list them + // again; their code and catalog (I18n.Preview.cs) stay as they are. Tests flip it to prove the way back. + internal static bool PreviewsListed = false; + + // Every language the program knows, listed or not. Apply still takes any of them, so the hidden languages' + // code paths can be exercised directly. + internal static readonly LanguageOption[] Known = { new LanguageOption("auto", "", "auto windows automático automatisch"), new LanguageOption("es", "Español", "Spanish castellano Spanisch"), @@ -40,7 +48,22 @@ internal LanguageOption(string code, string name, string searchNames, int previe new LanguageOption("bn", "বাংলা", "Bengali bengalí Bangla Bengalisch", 5) }; + // What the user can choose from: Automatic, the complete languages and, only when PreviewsListed, the previews. + internal static LanguageOption[] Languages + { + get { return PreviewsListed ? Known : Array.FindAll(Known, delegate(LanguageOption o) { return !o.Preview; }); } + } + + // Any known language by code, listed or not (Apply and direct construction of a window in a hidden language). internal static LanguageOption FindLanguage(string code) + { + foreach (LanguageOption option in Known) + if (option.Code == code) return option; + return null; + } + + // A language the user can choose now: what a saved setting or a typed code must match to be taken. + internal static LanguageOption FindListedLanguage(string code) { foreach (LanguageOption option in Languages) if (option.Code == code) return option; @@ -51,7 +74,7 @@ internal static List FilterLanguages(string query) { var result = new List(); string value = (query ?? "").Trim(); - LanguageOption byCode = FindLanguage(value.ToLowerInvariant()); + LanguageOption byCode = FindListedLanguage(value.ToLowerInvariant()); if (byCode != null) { result.Add(byCode); diff --git a/src/Markdown/MarkdownWindow.cs b/src/Markdown/MarkdownWindow.cs index ef19c6a..3d2ed31 100644 --- a/src/Markdown/MarkdownWindow.cs +++ b/src/Markdown/MarkdownWindow.cs @@ -1053,9 +1053,16 @@ void Say(string msg, bool bad) fade.Start(); } + // What the document is called in the title and in the name of its capture: a format name, written the way the + // interface language writes it (Korean spells Markdown in hangul). + internal static string KindName(bool xml) + { + return xml ? "XML" : I18n.T("Markdown", "Markdown", "Markdown"); + } + void SetTitle() { - string t = name != null ? name + " \u2014 " + (xml ? "XML" : "Markdown") : text != null ? I18n.T("Sin t\u00EDtulo \u2014 ", "Untitled \u2014 ") + (xml ? "XML" : "Markdown") : I18n.T("Markdown y XML", "Markdown and XML"); + string t = name != null ? name + " \u2014 " + KindName(xml) : text != null ? I18n.T("Sin t\u00EDtulo \u2014 ", "Untitled \u2014 ") + KindName(xml) : I18n.T("Markdown y XML", "Markdown and XML"); Title = (text != null && Dirty ? "\u25CF " : "") + t; } @@ -1965,7 +1972,7 @@ void Done() { BitmapSource img = RenderDoc(out err); if (img == null) { NoImage(err); return; } - string path = owner.SaveCapture(Ink.ToGdi(img), xml ? "XML" : "Markdown"); + string path = owner.SaveCapture(Ink.ToGdi(img), KindName(xml)); if (path == null) { Say(I18n.T("No he podido a\u00F1adir la captura.", "Could not add capture."), true); return; } try { System.IO.File.WriteAllBytes(System.IO.Path.ChangeExtension(path, xml ? ".xml" : ".md"), Companion(text, xml, file)); } catch (Exception ex) { ShotStack.Log("Markdown guardar: " + ex.Message); } diff --git a/src/Settings.cs b/src/Settings.cs index e9cbe7a..56149f8 100644 --- a/src/Settings.cs +++ b/src/Settings.cs @@ -263,7 +263,7 @@ int Parse(string[] lines) case "window": s.HotWindow = v; break; case "scroll": s.HotScroll = v; break; case "appearance": s.Appearance = Int(v, s.Appearance, 0, 2); break; - case "language": { string l = v.ToLowerInvariant().Trim(); if (I18n.FindLanguage(l) != null) s.Language = l; hasLanguage = true; break; } + case "language": { string l = v.ToLowerInvariant().Trim(); if (I18n.FindListedLanguage(l) != null) s.Language = l; hasLanguage = true; break; } case "allinone": s.AllInOne = Bool(v, s.AllInOne); break; case "adjustfirst": s.AdjustFirst = Bool(v, s.AdjustFirst); break; case "capturedelay": { int cd = Int(v, s.CaptureDelay, 0, 60); s.CaptureDelay = cd == 3 || cd == 5 || cd == 10 ? cd : s.CaptureDelay; break; } diff --git a/tests/app/AppTestsI18n.cs b/tests/app/AppTestsI18n.cs index e063873..f2100e4 100644 --- a/tests/app/AppTestsI18n.cs +++ b/tests/app/AppTestsI18n.cs @@ -99,7 +99,7 @@ public static void Suite() static void AutoFollowsWindows() { string[] spanish = { "es-ES", "es-MX", "es-AR", "ca-ES", "gl-ES", "eu-ES" }; - string[] english = { "en-US", "en-GB", "fr-FR", "pt-BR" }; + string[] english = { "en-US", "en-GB", "fr-FR", "pt-BR", "zh-CN", "hi-IN", "ar-SA", "bn-BD" }; // the hidden previews are never picked foreach (string c in new[] { "de-DE", "de-AT", "de-CH" }) { Thread.CurrentThread.CurrentUICulture = new CultureInfo(c); @@ -176,6 +176,12 @@ static void LanguageSettingContract() { "SaveAll = 1\nLanguage = de\n", "de" }, { "SaveAll = 1\nLanguage = ko\n", "ko" }, { "SaveAll = 1\nLanguage = xx\n", "auto" }, + { "SaveAll = 1\nLanguage = fr\n", "auto" }, + { "SaveAll = 1\nLanguage = pt\n", "auto" }, + { "SaveAll = 1\nLanguage = zh\n", "auto" }, + { "SaveAll = 1\nLanguage = hi\n", "auto" }, + { "SaveAll = 1\nLanguage = ar\n", "auto" }, + { "SaveAll = 1\nLanguage = bn\n", "auto" }, { "SaveAll = 1\nLanguage =\n", "auto" }, { "SaveAll = 1\n", "es" } }; @@ -809,7 +815,17 @@ static void ReaderSeek() } } + // The picker with the preview languages listed (the switch flipped): their search names, rows and settings paths + // keep working while they are hidden. The listing as shipped is in AppTestsI18nFinal. static void LanguagePickerSearch() + { + bool listed = I18n.PreviewsListed; + I18n.PreviewsListed = true; + try { LanguagePickerSearchListed(); } + finally { I18n.PreviewsListed = listed; } + } + + static void LanguagePickerSearchListed() { I18n.Apply("en"); Check(I18n.FilterLanguages("francais").Exists(o => o.Code == "fr"), "accent-insensitive search"); diff --git a/tests/app/AppTestsI18nFinal.cs b/tests/app/AppTestsI18nFinal.cs index 108705c..888e9f6 100644 --- a/tests/app/AppTestsI18nFinal.cs +++ b/tests/app/AppTestsI18nFinal.cs @@ -40,6 +40,14 @@ public static void Suite(Action T) T("mascot-name-cut-edge-cases", MascotNameCutEdgeCases); T("settings-rows-exempt-their-paths", SettingsRowsExemptTheirPaths); T("release-notices-read-their-language", ReleaseNoticesReadTheirLanguage); + T("tray-labels-follow-the-language", TrayLabelsFollowTheLanguage); + T("korean-writes-markdown-in-hangul", KoreanWritesMarkdownInHangul); + T("no-bare-markdown-label-in-src", NoBareMarkdownLabelInSrc); + T("tray-panel-has-no-foreign-leftovers", TrayPanelHasNoForeignLeftovers); + T("tray-recent-dates-follow-the-language", TrayRecentDatesFollowTheLanguage); + T("picker-lists-only-the-complete-languages", PickerListsOnlyTheCompleteLanguages); + T("hidden-languages-load-as-automatic", HiddenLanguagesLoadAsAutomatic); + T("previews-come-back-with-the-switch", PreviewsComeBackWithTheSwitch); T("last-audit-screens-as-pictures", Pictures); } @@ -573,6 +581,289 @@ public static void ReleaseNoticesReadTheirLanguage() Check(News.FromRelease(lines + block("novedades-de", "Deutsch")).Count == 0, "a German block read as the Spanish one"); } + // ---- Markdown in Korean, and the tray panel in every language + + const string KoMarkdown = "\uB9C8\uD06C\uB2E4\uC6B4"; + + // The tray panel's rows (id, text) as BuildItems makes them, plus its status line under the id "status". + static List> TrayRows(bool recording, bool scrolling) + { + BindingFlags np = BindingFlags.NonPublic | BindingFlags.Instance; + TrayPanel tp = new TrayPanel(new Settings()); + try + { + typeof(TrayPanel).GetMethod("BuildItems", np).Invoke(tp, new object[] { recording, scrolling, false }); + List> rows = new List>(); + foreach (object it in (System.Collections.IEnumerable)typeof(TrayPanel).GetField("items", np).GetValue(tp)) + rows.Add(new KeyValuePair((string)it.GetType().GetField("Id").GetValue(it), (string)it.GetType().GetField("Text").GetValue(it))); + rows.Add(new KeyValuePair("status", (string)typeof(TrayPanel).GetField("status", np).GetValue(tp))); + return rows; + } + finally { try { tp.Dispose(); } catch (Exception) { } } + } + + static string RowText(List> rows, string id) + { + foreach (KeyValuePair r in rows) if (r.Key == id) return r.Value; + return null; + } + + // The tray panel's GIF and Markdown rows: GIF is GIF everywhere; Markdown is written in hangul in Korean and stays + // Markdown in the others (the preview languages show English by design). + public static void TrayLabelsFollowTheLanguage() + { + foreach (string lang in AllLanguages) + InLanguage(lang, delegate + { + List> rows = TrayRows(false, false); + Same("GIF", RowText(rows, "gif"), lang + " tray GIF"); + Same(lang == "ko" ? KoMarkdown : "Markdown", RowText(rows, "markdown"), lang + " tray Markdown"); + }); + } + + // Korean spells Markdown in hangul wherever the interface says it: the catalog, the Home action names, the document + // window's title and the prefix of its captures. GIF stays GIF. + public static void KoreanWritesMarkdownInHangul() + { + FieldInfo f = typeof(I18n).GetField("KoreanCatalog", BindingFlags.NonPublic | BindingFlags.Static); + object lazy = f.GetValue(null); + Dictionary catalog = (Dictionary)lazy.GetType().GetProperty("Value").GetValue(lazy, null); + List latin = new List(), unread = new List(), particle = new List(); + Regex vowelParticle = new Regex(KoMarkdown + "(\uB97C|\uAC00|\uB294|\uC640)"); + foreach (KeyValuePair p in catalog) + { + if (p.Value.IndexOf("Markdown", StringComparison.Ordinal) >= 0) latin.Add(p.Key + " => " + Show(p.Value)); + if (p.Key.IndexOf("Markdown", StringComparison.Ordinal) >= 0 && p.Value.IndexOf(KoMarkdown, StringComparison.Ordinal) < 0) unread.Add(p.Key); + if (vowelParticle.IsMatch(p.Value)) particle.Add(p.Key + " => " + Show(p.Value)); + } + foreach (string s in latin) Console.WriteLine(" latin Markdown: " + s); + foreach (string s in particle) Console.WriteLine(" wrong particle: " + s); + Check(latin.Count == 0, latin.Count + " Korean catalog values still say Markdown in Latin letters"); + Check(unread.Count == 0, unread.Count + " Korean catalog entries about Markdown do not say it in hangul"); + Check(particle.Count == 0, "the name ends in a consonant (" + KoMarkdown + "), so its particles are \uC744 \uC774 \uC740 \uACFC: " + particle.Count + " texts differ"); + Same(KoMarkdown, catalog["Markdown"], "the bare word"); + Same(KoMarkdown + " \uBB38\uC11C", catalog["Markdown document"], "Markdown document"); + Same("\uCEA1\uCC98\uC640 \uB3D9\uC601\uC0C1\u00B7GIF \uB179\uD654, \uB3D9\uC601\uC0C1 \uD50C\uB808\uC774\uC5B4\uC640 " + KoMarkdown + "\u00B7XML \uBDF0\uC5B4", + catalog["Screenshots, video and GIF, with a video player and a Markdown and XML viewer"], "the app description"); + + foreach (string lang in AllLanguages) + InLanguage(lang, delegate + { + bool ko = lang == "ko"; + string md = ko ? KoMarkdown : "Markdown"; + Check(HomeWindow.ActionShort[8].Contains(md) && (ko || HomeWindow.ActionShort[8] == "Markdown"), lang + " short action: " + HomeWindow.ActionShort[8]); + Same(md, HomeWindow.ActionShortest[8], lang + " shortest action"); + Same("GIF", HomeWindow.ActionShortest[7], lang + " shortest GIF"); + Check(HomeWindow.ActionNames[8].Contains(md), lang + " action name: " + HomeWindow.ActionNames[8]); + Same(md, MarkdownWindow.KindName(false), lang + " document kind"); + Same("XML", MarkdownWindow.KindName(true), lang + " XML kind"); + }); + } + + // No user-visible text says "Markdown" outside I18n: every string literal that has the word is a routed text (an + // I18n call), a log line, an ini key or a registry name, or one of the Spanish/English action lists the Home window + // reads through I18n. + public static void NoBareMarkdownLabelInSrc() + { + string src = Path.Combine(AppTestsI18nCoverage.RepoRoot(), "src"); + Regex literal = new Regex("\"(?:[^\"\\\\]|\\\\.)*Markdown(?:[^\"\\\\]|\\\\.)*\""); + List bare = new List(); + foreach (string path in Directory.GetFiles(src, "*.cs", SearchOption.AllDirectories)) + { + string name = Path.GetFileName(path); + if (name.StartsWith("I18n.", StringComparison.Ordinal)) continue; // the catalogs + string[] lines = File.ReadAllLines(path, Encoding.UTF8); + for (int i = 0; i < lines.Length; i++) + { + string line = lines[i]; + if (line.TrimStart().StartsWith("//", StringComparison.Ordinal) || !literal.IsMatch(line)) continue; + bool routed = false; + // The call may start on an earlier line of the same statement. + for (int k = i; k >= Math.Max(0, i - 4) && !routed; k--) + { + routed = lines[k].Contains("I18n.T(") || lines[k].Contains("I18n.Fmt(") || lines[k].Contains("I18n.Own(") || lines[k].Contains("I18n.Localize("); + string before = k > 0 ? lines[k - 1].TrimEnd() : ";"; + if (before.EndsWith(";", StringComparison.Ordinal) || before.EndsWith("{", StringComparison.Ordinal) || before.EndsWith("}", StringComparison.Ordinal)) break; + } + bool data = line.Contains("Log(") || line.Contains("new AssocKind(") || (name == "Settings.cs" && line.Contains("AppendLine(")) || + line.Contains("ActionNamesEs") || line.Contains("ActionNamesEn") || line.Contains("ActionShortEs") || line.Contains("ActionShortEn") || + line.Contains("ActionShortestEs") || line.Contains("ActionShortestEn"); + if (!routed && !data) bare.Add(name + ":" + (i + 1) + ": " + line.Trim()); + } + } + foreach (string b in bare) Console.WriteLine(" bare Markdown: " + b); + Check(bare.Count == 0, bare.Count + " bare \"Markdown\" literals reach the interface without I18n (listed above)"); + } + + // Everything the tray panel says (rows while idle, recording and scrolling, and its status line) in the four complete + // languages: no Spanish or English left over except format names that read the same in that language. + public static void TrayPanelHasNoForeignLeftovers() + { + Dictionary>[]> all = new Dictionary>[]>(); + foreach (string lang in new[] { "es", "en", "de", "ko" }) + InLanguage(lang, delegate { all[lang] = new[] { TrayRows(false, false), TrayRows(true, false), TrayRows(false, true) }; }); + Dictionary same = new Dictionary(); + same["es"] = new[] { "GIF", "Markdown" }; + same["en"] = new[] { "GIF", "Markdown" }; + same["de"] = new[] { "GIF", "Markdown", "Video", "Text" }; + same["ko"] = new[] { "GIF" }; + List found = new List(); + foreach (string lang in new[] { "es", "de", "ko" }) + for (int state = 0; state < 3; state++) + { + List> mine = all[lang][state], en = all["en"][state], es = all["es"][state]; + Check(mine.Count == en.Count, lang + " tray has the same rows as English"); + for (int i = 0; i < mine.Count; i++) + { + string t = mine[i].Value; + if (string.IsNullOrEmpty(t) || Array.IndexOf(same[lang], t) >= 0) continue; + if (lang != "en" && t == en[i].Value) found.Add(lang + " [" + mine[i].Key + "] reads as English: " + t); + if (lang != "es" && t == es[i].Value) found.Add(lang + " [" + mine[i].Key + "] reads as Spanish: " + t); + } + } + foreach (KeyValuePair r in all["ko"][0].Concat(all["ko"][1]).Concat(all["ko"][2])) + if (r.Value != null && Regex.IsMatch(Regex.Replace(r.Value, "GIF|Stackshot|XML", ""), "[A-Za-z]{2,}")) found.Add("ko [" + r.Key + "] has Latin words: " + r.Value); + // What a screen reader gets from the panel (names, actions, descriptions) in the same languages. + Dictionary> heard = new Dictionary>(); + foreach (string lang in new[] { "en", "de", "ko" }) InLanguage(lang, delegate { heard[lang] = AppTestsI18n.AuditTray(); }); + Check(heard["en"].Count >= 20 && heard["ko"].Count == heard["en"].Count && heard["de"].Count == heard["en"].Count, "the panel tells a reader the same things in every language"); + foreach (string t in heard["ko"]) + if (t != null && Regex.IsMatch(Regex.Replace(t, "GIF|Stackshot|XML|Ctrl|Alt|Shift|PrtScn", ""), "[A-Za-z]{2,}")) found.Add("ko (reader) has Latin words: " + t); + for (int i = 0; i < heard["de"].Count; i++) + if (heard["de"][i] != null && heard["de"][i] == heard["en"][i] && Array.IndexOf(same["de"], heard["de"][i]) < 0 && heard["de"][i] != "Stackshot") found.Add("de (reader) reads as English: " + heard["de"][i]); + foreach (string lang in new[] { "en" }) + foreach (List> rows in all[lang]) + foreach (KeyValuePair r in rows) if (r.Value != null && AppTestsI18n.LooksSpanish(r.Value)) found.Add("en [" + r.Key + "] reads as Spanish: " + r.Value); + foreach (string s in found) Console.WriteLine(" tray: " + s); + Check(found.Count == 0, found.Count + " tray texts are in the wrong language (listed above)"); + } + + // The date of a recent capture in the tray: the weekday-less "5 Jan" in the language's own month names (German + // is not read with the Spanish ones) and Today / Yesterday in the language. + public static void TrayRecentDatesFollowTheLanguage() + { + MethodInfo when = typeof(TrayPanel).GetMethod("When", BindingFlags.NonPublic | BindingFlags.Static); + DateTime old = new DateTime(2020, 1, 5, 14, 30, 0), today = DateTime.Today.AddHours(9).AddMinutes(5); + Dictionary want = new Dictionary { { "es", "5 ene, 14:30" }, { "en", "Jan 5, 14:30" }, { "de", "5. Jan, 14:30" }, { "ko", "1/5 14:30" } }; + Dictionary now = new Dictionary { { "es", "Hoy, 09:05" }, { "en", "Today, 09:05" } }; + foreach (string lang in AllLanguages) + InLanguage(lang, delegate + { + string d = (string)when.Invoke(null, new object[] { old }), n = (string)when.Invoke(null, new object[] { today }); + Same(want.ContainsKey(lang) ? want[lang] : want["en"], d, lang + " old date"); + if (now.ContainsKey(lang)) Same(now[lang], n, lang + " today"); + else if (lang == "de" || lang == "ko") Check(!n.StartsWith("Hoy") && !n.StartsWith("Today") && n.EndsWith("09:05"), lang + " today: " + n); + }); + } + + // ---- The six preview languages are hidden for this release + + static readonly string[] Hidden = { "fr", "pt", "zh", "hi", "ar", "bn" }; + + static string[] Codes(IEnumerable options) { return options.Select(o => o.Code).ToArray(); } + + static LanguagePicker NewPicker(string current) + { + return (LanguagePicker)typeof(LanguagePicker).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new[] { typeof(string) }, null).Invoke(new object[] { current }); + } + + // As shipped, the picker (and the search behind Settings, Welcome and the tray's language row) offers Automatic, + // Spanish, English, German and Korean and nothing else, whatever the interface language is. + public static void PickerListsOnlyTheCompleteLanguages() + { + Check(!I18n.PreviewsListed, "the previews are hidden by default"); + Same("auto,es,en,de,ko", string.Join(",", Codes(I18n.Languages)), "the languages on offer"); + Same("auto,es,en,de,ko", string.Join(",", Codes(I18n.FilterLanguages(""))), "an empty search"); + foreach (string q in new[] { "fr", "francais", "French", "pt", "Portuguese", "zh", "mandarin", "hi", "Hindi", "ar", "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", "bn", "Bengali" }) + Check(I18n.FilterLanguages(q).Count == 0, "searching '" + q + "' finds a hidden language"); + Same("de", string.Join(",", Codes(I18n.FilterLanguages("German"))), "a complete language is still found"); + foreach (string lang in AllLanguages) + InLanguage(lang, delegate + { + LanguagePicker picker = NewPicker("de"); + try + { + ListBox list = (ListBox)typeof(LanguagePicker).GetField("list", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(picker); + Same("auto,es,en,de,ko", string.Join(",", list.Items.Cast().Select(i => (string)i.Tag).ToArray()), lang + " picker rows"); + // The hint under the title only makes sense with previews: it is gone, in every language. + foreach (string t in AppTestsI18n.Strings(picker.Content)) + Check(t.IndexOf("preview", StringComparison.OrdinalIgnoreCase) < 0 && t.IndexOf("vista previa", StringComparison.OrdinalIgnoreCase) < 0 && + t.IndexOf("Vorschau", StringComparison.OrdinalIgnoreCase) < 0 && t.IndexOf("\uBBF8\uB9AC \uBCF4\uAE30", StringComparison.Ordinal) < 0, lang + " picker still mentions previews: " + t); + } + finally { picker.Close(); } + }); + string hint = null; + foreach (string lang in new[] { "es", "en", "de", "ko" }) + InLanguage(lang, delegate + { + LanguagePicker picker = NewPicker("de"); + try { hint = AppTestsI18n.Strings(picker.Content).FirstOrDefault(t => t.StartsWith("Busca por") || t.StartsWith("Search by") || t.StartsWith("Suche nach") || t.StartsWith("\uC774\uB984\uC774\uB098")); } + finally { picker.Close(); } + Same(lang == "es" ? "Busca por nombre o c\u00F3digo." : lang == "en" ? "Search by name or code." : lang == "de" ? "Suche nach Name oder Sprachcode." : "\uC774\uB984\uC774\uB098 \uCF54\uB4DC\uB85C \uAC80\uC0C9\uD558\uC138\uC694.", hint, lang + " picker hint"); + }); + } + + // A settings file that names a hidden language reads as Automatic, like an unknown code; the complete ones stay. + public static void HiddenLanguagesLoadAsAutomatic() + { + string dir = Path.Combine(Path.GetTempPath(), "stackshot-app-tests", "t20-hidden-" + Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(dir); + try + { + foreach (string code in Hidden.Concat(new[] { "FR", " ar " })) + { + string file = Path.Combine(dir, "h" + code.Trim() + ".ini"); + File.WriteAllText(file, "SaveAll = 1\nLanguage = " + code + "\n"); + Same("auto", Settings.Load(file).Language, "Language = " + code); + } + foreach (string code in new[] { "es", "en", "de", "ko", "auto" }) + { + string file = Path.Combine(dir, "k" + code + ".ini"); + File.WriteAllText(file, "SaveAll = 1\nLanguage = " + code + "\n"); + Same(code, Settings.Load(file).Language, "Language = " + code); + } + } + finally { I18n.Apply("es"); try { Directory.Delete(dir, true); } catch (Exception) { } } + } + + // One switch (I18n.PreviewsListed) brings the six languages back: listed, found, kept from the settings file, and + // the picker's hint about them returns. Their catalog is untouched, so they still translate when applied. + public static void PreviewsComeBackWithTheSwitch() + { + string dir = Path.Combine(Path.GetTempPath(), "stackshot-app-tests", "t20-back-" + Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(dir); + I18n.PreviewsListed = true; + try + { + Same("auto,es,en,de,ko,fr,pt,zh,hi,ar,bn", string.Join(",", Codes(I18n.Languages)), "the languages on offer"); + Check(I18n.FilterLanguages("francais").Count == 1 && I18n.FilterLanguages("mandarin").Count == 1, "the previews are searchable again"); + foreach (string code in Hidden) + { + string file = Path.Combine(dir, code + ".ini"); + File.WriteAllText(file, "SaveAll = 1\nLanguage = " + code + "\n"); + Same(code, Settings.Load(file).Language, "Language = " + code); + I18n.Apply(code); + Check(I18n.Language == code && I18n.Save != "Save", code + " translates"); + } + I18n.Apply("en"); + LanguagePicker picker = NewPicker("de"); + try + { + ListBox list = (ListBox)typeof(LanguagePicker).GetField("list", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(picker); + Check(list.Items.Count == 11, "Automatic and the ten languages in the list: " + list.Items.Count); + Check(AppTestsI18n.Strings(picker.Content).Any(t => t.StartsWith("Search by name or code. Preview languages")), "the hint about previews returns"); + } + finally { picker.Close(); } + } + finally + { + I18n.PreviewsListed = false; + I18n.Apply("es"); + try { Directory.Delete(dir, true); } catch (Exception) { } + } + Check(I18n.Languages.Length == 5, "the switch back off hides them again"); + } + // ---- Pictures: with STACKSHOT_UI_SHOTS set to a folder, the screens this audit touched are saved there as PNG. static void SavePng(BitmapSource b, string name) @@ -599,6 +890,34 @@ static void SaveElement(FrameworkElement root, double width, double height, stri SavePng(rtb, name); } + // The tray panel as it paints on screen, in this language. + static void TrayPicture(string lang, int appearance, string file) + { + I18n.Apply(lang); + Ds.Apply(appearance); + Settings s = new Settings(); + s.Appearance = appearance; + BindingFlags np = BindingFlags.NonPublic | BindingFlags.Instance; + TrayPanel tp = new TrayPanel(s); + try + { + typeof(TrayPanel).GetMethod("Rebuild", np).Invoke(tp, new object[] { 1f, 0 }); + System.Drawing.Size body = (System.Drawing.Size)typeof(FloatWindow).GetField("body", np).GetValue(tp); + int pad = (int)typeof(FloatWindow).GetField("Pad", np).GetValue(tp); + int w = body.Width + 2 * pad, h = body.Height + 2 * pad; + DrawingVisual v = new DrawingVisual(); + using (DrawingContext dc = v.RenderOpen()) + { + dc.DrawRectangle(new SolidColorBrush(appearance == 2 ? Color.FromRgb(30, 30, 32) : Color.FromRgb(214, 224, 238)), null, new Rect(0, 0, w, h)); + typeof(TrayPanel).GetMethod("PaintSurface", np).Invoke(tp, new object[] { dc, w, h }); + } + RenderTargetBitmap rtb = new RenderTargetBitmap(w, h, 96, 96, PixelFormats.Pbgra32); + rtb.Render(v); + SavePng(rtb, file); + } + finally { try { tp.Dispose(); } catch (Exception) { } } + } + public static void Pictures() { string dir = Environment.GetEnvironmentVariable("STACKSHOT_UI_SHOTS"); @@ -607,6 +926,9 @@ public static void Pictures() BindingFlags np = BindingFlags.NonPublic | BindingFlags.Instance; try { + foreach (string lang in new[] { "es", "en", "de", "ko", "ar" }) TrayPicture(lang, 1, "t20-tray-" + lang + ".png"); + TrayPicture("ko", 2, "t20-tray-ko-dark.png"); + // The mascot's menu button on the Home page, in Korean, for names that end in a consonant, a vowel and Latin script. foreach (string[] n in new[] { new[] { "\uD558\uB298", "hanul" }, new[] { "\uB098\uBE44", "nabi" }, new[] { "Pixel", "pixel" } }) { diff --git a/tests/app/AppTestsW6Contrast.cs b/tests/app/AppTestsW6Contrast.cs index 92a9a4d..f6688f7 100644 --- a/tests/app/AppTestsW6Contrast.cs +++ b/tests/app/AppTestsW6Contrast.cs @@ -1012,13 +1012,31 @@ static void LanguageRows() Check(row == wanted, "Deutsch's row in " + ui + ": '" + row + "' instead of '" + wanted + "'"); string ko = RowName(list, "\uD55C\uAD6D\uC5B4"); Check(ko == "\uD55C\uAD6D\uC5B4, " + complete + " \u00B7 ko", "the Korean row in " + ui + ": '" + ko + "'"); + Check(RowName(list, "Fran\u00E7ais") == null && list.Items.Count == 5, "the hidden French row is listed in " + ui); + } + finally { picker.Close(); } + } + } + finally { I18n.Apply(save); Drain(); } + // With the switch flipped the previews are listed again, as previews. + bool listed = I18n.PreviewsListed; + I18n.PreviewsListed = true; + try + { + foreach (string ui in new[] { "es", "en", "de", "ko" }) + { + I18n.Apply(ui); + LanguagePicker picker = (LanguagePicker)typeof(LanguagePicker).GetConstructor(NP, null, new[] { typeof(string) }, null).Invoke(new object[] { "de" }); + try + { + System.Windows.Controls.ListBox list = (System.Windows.Controls.ListBox)typeof(LanguagePicker).GetField("list", NP).GetValue(picker); string fr = RowName(list, "Fran\u00E7ais"); Check(fr == "Fran\u00E7ais, " + I18n.T("Vista previa", "Preview") + " \u00B7 fr", "the French preview row in " + ui + ": '" + fr + "'"); } finally { picker.Close(); } } } - finally { I18n.Apply(save); Drain(); } + finally { I18n.PreviewsListed = listed; I18n.Apply(save); Drain(); } } // The Aurora treatment keeps AA wherever it paints, shows the gradient in dark and light, and a contrast theme @@ -1086,7 +1104,17 @@ static void AuroraContrast() // The picker's room (owner: "está muy apretado"): rows 56 tall with a gap between them so a selected ring never // meets the hover of its neighbour, the ring clear of the scrollbar, and the whole sheet inside a laptop's area. + // Measured with the ten languages listed: five rows never reach the scrollbar, and the room has to hold when the + // previews come back. static void PickerRoom() + { + bool listed = I18n.PreviewsListed; + I18n.PreviewsListed = true; + try { PickerRoomListed(); } + finally { I18n.PreviewsListed = listed; } + } + + static void PickerRoomListed() { W.Size fit = LanguagePicker.Preferred(1366, 728); Check(fit.Width <= 1366 && fit.Height <= 728, "the sheet does not fit a 1366 x 728 work area: " + fit); diff --git a/tests/app/AppTestsW6Sensitive.cs b/tests/app/AppTestsW6Sensitive.cs index 99a8e66..7e2aad2 100644 --- a/tests/app/AppTestsW6Sensitive.cs +++ b/tests/app/AppTestsW6Sensitive.cs @@ -1374,7 +1374,7 @@ static void LanguageIndependent() try { string baseKinds = null; - string[] languages = Array.FindAll(Array.ConvertAll(I18n.Languages, delegate(I18n.LanguageOption o) { return o.Code; }), + string[] languages = Array.FindAll(Array.ConvertAll(I18n.Known, delegate(I18n.LanguageOption o) { return o.Code; }), // the hidden previews too: their code stays safe delegate(string code) { return code != "auto"; }); Check(languages.Length >= 10, "every interface language is checked, only " + languages.Length); foreach (string lang in languages) From 53358c86dbf99156b713efed9115ea2c15b39bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Mart=C3=ADnez?= <171921708+rubenitx@users.noreply.github.com> Date: Mon, 23 Nov 2026 17:20:02 +0100 Subject: [PATCH 2/4] docs: Describe the four complete languages and keep incomplete ones hidden --- CHANGELOG.md | 1 + CONTRIBUTING.md | 8 +++++++- README.es.md | 2 +- README.md | 2 +- docs/new-features-tutorial.md | 2 +- docs/novedades.de.md | 3 +-- docs/novedades.en.md | 3 +-- docs/novedades.ko.md | 7 +++---- docs/novedades.md | 3 +-- 9 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 302de52..c07138a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- **Language picker.** Under Settings › General › Appearance › Language, search by name or code and choose Automatic, Español, English, Deutsch or 한국어, each marked as complete. French, Portuguese, Simplified Chinese, Hindi, Arabic and Bengali are written but kept hidden (one switch, `I18n.PreviewsListed`) until their translations are complete; a settings file that names one of them reads as Automatic. - **English interface.** Stackshot follows the Windows language: English on an English Windows, and English can be chosen under Settings › General › Appearance › Language. Contributed by @altmashnaveed (PR #12). - **Korean interface.** Select 한국어 in the language picker or use Automatic on Korean Windows. Existing language preferences are preserved. Contributed by @Hobeom (PR #30). - **German, complete.** The German interface that arrived with PR #13 (by Aamer Shahzad) now covers the whole app: capture and the area picker, the editor, recording and the video tools, the desktop mascot included, the Home window, history, reports and the Markdown and XML viewers. Notices keep their kind in every language (their kind comes from the text's key, not from the words of one language), a document that is not UTF-8 is rescued the same in all languages, and shown numbers use each language's own thousands and decimal marks. The in-app news come in the interface language (Spanish, English, German and Korean). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 16df391..1830c37 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ A screenshot tool for Windows in the spirit of CleanShot X: its own capture (scrolling capture too), a stack of floating thumbnails, a quick editor with a presentation backdrop, video and GIF through FFmpeg, a main window with a customizable mascot, and a per-user installation. A single `.exe` (about 2.2 MB) written in C# 5 + WinForms and WPF on .NET Framework 4.8. -Windows 10 and 11 only. The user interface is in Spanish, English, German and Korean (the language registry is in `src/I18n.Languages.cs`, the German catalog is split by area into `src/I18n.German..cs` and the Korean one into `src/I18n.Korean*.cs`); code comments are in English. +Windows 10 and 11 only. The user interface is in Spanish, English, German and Korean (the language registry is in `src/I18n.Languages.cs`, the German catalog is split by area into `src/I18n.German..cs` and the Korean one into `src/I18n.Korean*.cs`); code comments are in English. French, Portuguese, Simplified Chinese, Hindi, Arabic and Bengali (`src/I18n.Preview.cs`) are kept hidden until they are complete. ## Build and test @@ -87,6 +87,12 @@ Windows 10 and 11 only. The user interface is in Spanish, English, German and Ko `tests\app\run-tests.ps1 i18n` checks that Automatic follows Windows and that no page shows Spanish in English, and `tests\app\run-tests.ps1 news` checks that the four news files carry the same versions and that the program's version is the newest one. +- **Adding a language.** Add a `LanguageOption` to `I18n.Known` in `src/I18n.Languages.cs` (code, native name, search + names) and its catalog: a `src/I18n.*.cs` keyed by the English text, like Korean, or a column in + `src/I18n.Preview.cs` for a partial one (give it a `previewIndex`). A language with a `previewIndex` is hidden + (`I18n.PreviewsListed` is off): the picker lists only complete languages, a saved choice of a hidden one reads as + Automatic, and Automatic never picks it. Make it complete (every screen, notice, news file and test in `tests\app`), + then remove its `previewIndex` so it is listed, and add it to the Windows languages Automatic follows if it should be. - **ASCII literals**: accented characters in strings are Unicode escapes. Some editing tools turn them into real characters; after editing, `perl tools/escape-literals.pl ` escapes them again. - The process is per-monitor DPI aware (PerMonitorV2 manifest): sizes are in physical pixels and scaled with diff --git a/README.es.md b/README.es.md index 8637b95..b12c611 100644 --- a/README.es.md +++ b/README.es.md @@ -649,7 +649,7 @@ Al abrir `Stackshot.exe` te ofrece instalarlo para tu usuario (sin permisos de a ¿Tiene la interfaz en español?
-Sí: en español, inglés, alemán y coreano. Una instalación nueva sigue el idioma de Windows (coreano en un Windows en coreano; español en un Windows en español, catalán, gallego o euskera; alemán en uno alemán; inglés en los demás), y **Ajustes › General › Apariencia › Idioma** lo cambia al momento (Automático, Español, English, Deutsch, 한국어), durante la instalación o desde la bandeja. Quien ya usaba Stackshot sigue en español; si su Windows está en otro idioma, se le ofrece una sola vez el que corresponde, y no cambia nada si no lo acepta. Francés, portugués, chino simplificado, hindi, árabe y bengalí se ofrecen como vista previa: traducen el selector de idioma y los controles comunes, y el resto queda en inglés; los textos que falten en coreano se muestran en inglés. La traducción al inglés la aportó [@altmashnaveed](https://github.com/altmashnaveed) y la del coreano [@Hobeom](https://github.com/Hobeom); el alemán y la redacción de claves vinieron de la PR #13 de [@aamershahzad2](https://github.com/aamershahzad2). +Sí: en español, inglés, alemán y coreano. Una instalación nueva sigue el idioma de Windows (coreano en un Windows en coreano; español en un Windows en español, catalán, gallego o euskera; alemán en uno alemán; inglés en los demás), y **Ajustes › General › Apariencia › Idioma** lo cambia al momento (Automático, Español, English, Deutsch, 한국어), durante la instalación o desde la bandeja. Quien ya usaba Stackshot sigue en español; si su Windows está en otro idioma, se le ofrece una sola vez el que corresponde, y no cambia nada si no lo acepta. Los textos que falten en coreano se muestran en inglés. La traducción al inglés la aportó [@altmashnaveed](https://github.com/altmashnaveed) y la del coreano [@Hobeom](https://github.com/Hobeom); el alemán y la redacción de claves vinieron de la PR #13 de [@aamershahzad2](https://github.com/aamershahzad2). ## Compilar desde el código diff --git a/README.md b/README.md index f07a2ce..1b12d40 100644 --- a/README.md +++ b/README.md @@ -649,7 +649,7 @@ Running `Stackshot.exe` offers to install it for your user (no administrator rig Is there an English interface?
-Yes. Stackshot speaks Spanish, English, German and Korean. A new installation follows the Windows display language (Korean on a Korean Windows; Spanish on a Spanish, Catalan, Galician or Basque Windows; German on a German one; English everywhere else), and **Settings › General › Appearance › Language** switches it at once (Automatic, Español, English, Deutsch, 한국어), at setup or from the tray. Those who already used Stackshot keep Spanish; if their Windows is in another language, the matching language is offered once, and nothing changes unless they accept. French, Portuguese, Simplified Chinese, Hindi, Arabic and Bengali are offered as previews: they translate the language picker and the common controls, and the rest stays in English; any Korean text still missing is shown in English. The English translation was contributed by [@altmashnaveed](https://github.com/altmashnaveed) and the Korean one by [@Hobeom](https://github.com/Hobeom); German and the secrets redaction came from PR #13 by [@aamershahzad2](https://github.com/aamershahzad2). +Yes. Stackshot speaks Spanish, English, German and Korean. A new installation follows the Windows display language (Korean on a Korean Windows; Spanish on a Spanish, Catalan, Galician or Basque Windows; German on a German one; English everywhere else), and **Settings › General › Appearance › Language** switches it at once (Automatic, Español, English, Deutsch, 한국어), at setup or from the tray. Those who already used Stackshot keep Spanish; if their Windows is in another language, the matching language is offered once, and nothing changes unless they accept. Any Korean text still missing is shown in English. The English translation was contributed by [@altmashnaveed](https://github.com/altmashnaveed) and the Korean one by [@Hobeom](https://github.com/Hobeom); German and the secrets redaction came from PR #13 by [@aamershahzad2](https://github.com/aamershahzad2). ## Building from source diff --git a/docs/new-features-tutorial.md b/docs/new-features-tutorial.md index 100fbed..c783976 100644 --- a/docs/new-features-tutorial.md +++ b/docs/new-features-tutorial.md @@ -17,7 +17,7 @@ Stackshot adds **German (Deutsch)** alongside English and Spanish, and it is com - All other display languages -> English (`en`) - **One-time offer**: If you already used Stackshot in Spanish and your Windows is in another language, Stackshot offers the matching language once in a notice; nothing changes unless you accept, and you can always change it later in the settings. - **Settings Selector**: Under **Settings › General › Appearance › Language**, open the picker and search by name or language code. Choose a language and select **Apply language**. -- **Preview languages**: French, Portuguese, Simplified Chinese, Hindi, Arabic and Bengali translate the picker and common controls. Other text appears in English. Select these languages manually. Automatic mode continues to choose Spanish, German, Korean or English based on Windows. +- **Languages kept back**: French, Portuguese, Simplified Chinese, Hindi, Arabic and Bengali exist as partial translations but are hidden for now (they are not in the picker, and a settings file that names one reads as Automatic); they return when each one is complete. Automatic mode chooses Spanish, German, Korean or English based on Windows. --- diff --git a/docs/novedades.de.md b/docs/novedades.de.md index 84d3af6..c50efad 100644 --- a/docs/novedades.de.md +++ b/docs/novedades.de.md @@ -10,9 +10,8 @@ Format: ein Abschnitt `## X.Y.Z` pro Version und darin eine Zeile pro Neuerung: - **Oberfläche auf Englisch.** Stackshot folgt der Windows-Sprache: Eine neue Installation auf einem englischen Windows startet auf Englisch. Ändern kannst du das unter Einstellungen › Allgemein › Erscheinungsbild › Sprache. - **Deutsch, vollständig.** Deutsch deckt jetzt die ganze App ab: Aufnahme, Editor, Aufzeichnung, das Maskottchen, Startseite, Verlauf und Berichte. - **Oberfläche auf Koreanisch.** Wähle 한국어 unter Einstellungen › Allgemein › Erscheinungsbild › Sprache. Danke an @Hobeom für die Übersetzung. -- **Neue Sprachauswahl.** Suche Sprachen nach Name oder Code und erkenne, ob die Übersetzung vollständig oder nur eine Vorschau ist. +- **Neue Sprachauswahl.** Suche Sprachen nach Name oder Code; jede zeigt, dass ihre Übersetzung vollständig ist. - **Automatische Sprache und ein einmaliges Angebot.** Automatisch folgt der Windows-Sprache (Spanisch, Englisch, Deutsch oder Koreanisch). Wenn du Stackshot schon auf Spanisch benutzt hast und Windows in einer anderen Sprache läuft, wird dir die passende Sprache einmal angeboten; wenn du nicht zustimmst, ändert sich nichts. -- **Sprachen als Vorschau.** Französisch, Portugiesisch, vereinfachtes Chinesisch, Hindi, Arabisch und Bengalisch erscheinen in der Auswahl als Vorschau: Die häufigsten Wörter sind übersetzt, der Rest bleibt Englisch. - **Sensible Daten in jeder Sprache abgedeckt.** Sensible Daten in einer Aufnahme zu finden und abzudecken funktioniert gleich, egal welche Oberflächensprache eingestellt ist. ## 2.2.1 diff --git a/docs/novedades.en.md b/docs/novedades.en.md index f42e494..4b228d9 100644 --- a/docs/novedades.en.md +++ b/docs/novedades.en.md @@ -10,9 +10,8 @@ Format: one `## X.Y.Z` section per version and, in it, one line per item: `- **T - **English interface.** Stackshot follows your Windows language: a new installation on an English Windows opens in English. You can change it under Settings › General › Appearance › Language. - **German, complete.** German now covers the whole app: capture, editor, recording, the mascot, Home, history and reports. - **Korean interface.** Choose 한국어 under Settings › General › Appearance › Language. Thanks to @Hobeom for the translation. -- **New language picker.** Search languages by name or code and check whether a translation is complete or a preview. +- **New language picker.** Search languages by name or code; each one says its translation is complete. - **Automatic language and a one-time offer.** Automatic follows the Windows language (Spanish, English, German or Korean). If you already used Stackshot in Spanish on a Windows in another language, you are offered the matching language once; if you do not accept, nothing changes. -- **Preview languages.** French, Portuguese, Simplified Chinese, Hindi, Arabic and Bengali appear in the picker as previews: the most common words are translated and the rest stays in English. - **Sensitive data covered in any language.** Finding and covering the sensitive data in a capture works the same whatever the interface language is. ## 2.2.1 diff --git a/docs/novedades.ko.md b/docs/novedades.ko.md index e2f7108..10034de 100644 --- a/docs/novedades.ko.md +++ b/docs/novedades.ko.md @@ -5,9 +5,8 @@ - **영어 인터페이스.** Stackshot은 Windows 언어를 따릅니다. 영어 Windows에 새로 설치하면 영어로 열립니다. 설정 > 일반 > 화면 모양 > 언어에서 바꿀 수 있습니다. - **독일어 번역 완료.** 이제 캡처, 편집기, 녹화, 마스코트, 홈, 기록, 보고서까지 앱 전체를 독일어로 사용할 수 있습니다. - **한국어 인터페이스.** 설정 > 일반 > 화면 모양 > 언어에서 한국어를 선택할 수 있습니다. 번역해 주신 @Hobeom 님께 감사드립니다. -- **새 언어 선택기.** 이름이나 코드로 언어를 검색하고, 번역이 완료되었는지 미리 보기인지 확인할 수 있습니다. +- **새 언어 선택기.** 이름이나 코드로 언어를 검색할 수 있고, 각 언어에 번역이 완료되었다고 표시됩니다. - **자동 언어와 한 번만 나오는 제안.** 자동 모드는 Windows 언어(스페인어, 영어, 독일어, 한국어)를 따릅니다. 이미 스페인어로 Stackshot을 쓰고 있는데 Windows가 다른 언어라면 맞는 언어로 바꿀지 한 번만 묻습니다. 수락하지 않으면 아무것도 바뀌지 않습니다. -- **미리 보기 언어.** 프랑스어, 포르투갈어, 중국어 간체, 힌디어, 아랍어, 벵골어는 선택기에 미리 보기로 표시됩니다. 자주 쓰는 표현만 번역되고 나머지는 영어로 보입니다. - **어떤 언어에서도 민감한 정보 가림.** 인터페이스 언어와 관계없이 캡처에서 민감한 정보를 찾아 가리는 방식은 같습니다. ## 2.2.1 @@ -44,11 +43,11 @@ - **스크롤 캡처 안내.** 처음 사용할 때 방법을 알려 주고, 페이지가 내려가지 않으면 알림을 표시합니다. 몇 화면을 캡처했는지도 볼 수 있습니다. - **바탕 화면 메모.** 메모를 색상 카드로 고정하고, 항상 위에 표시하거나 위치를 잠글 수 있습니다. 할 일은 클릭으로 완료하고, Enter로 목록을 이어 쓰며, 재시작 후에도 메모가 복원됩니다. - **화면에 맞는 창.** 내 신고, 변경 사항, 알림 창이 커져도 화면 밖으로 잘리지 않습니다. 빈 곳을 드래그하면 창을 이동할 수 있습니다. -- **긴 Markdown 문서 PDF 저장.** 한 장의 이미지로 만들기에는 너무 긴 문서는 PDF로 저장할 수 있습니다. +- **긴 마크다운 문서 PDF 저장.** 한 장의 이미지로 만들기에는 너무 긴 문서는 PDF로 저장할 수 있습니다. - **사용하는 기능만 표시.** 물 마시기, 휴식, 걸음 수 중 활성화한 항목만 마스코트 메뉴와 하루 요약에 표시합니다. - **앱에서 문제 신고와 아이디어 제안.** 홈의 정보 페이지에서 GitHub 계정 없이 의견을 보낼 수 있습니다. 내 신고에서 진행 상황과 답변을 확인하세요. - **마스코트와 건강한 휴식.** 물 마시기, 눈 휴식, 스트레칭, 호흡 운동 시간을 알려 줍니다. 마스코트 설정에서 조절할 수 있고, 알림에 응답하면 처리 결과를 알려 줍니다. -- **메모와 바로가기 도우미.** 마스코트 메뉴에서 알림을 예약하거나 Notas.md에 메모를 남기세요. PC가 꺼져 있을 때 놓친 알림은 다음 사용 시 표시됩니다. 이미지, 동영상, XML, Markdown, 텍스트도 끌어 놓을 수 있습니다. 감시 중인 폴더에 오류 응답 XML이 도착하면 알려 줍니다. +- **메모와 바로가기 도우미.** 마스코트 메뉴에서 알림을 예약하거나 Notas.md에 메모를 남기세요. PC가 꺼져 있을 때 놓친 알림은 다음 사용 시 표시됩니다. 이미지, 동영상, XML, 마크다운, 텍스트도 끌어 놓을 수 있습니다. 감시 중인 폴더에 오류 응답 XML이 도착하면 알려 줍니다. - **워치 연동과 목표.** 물 한 잔을 기록하고, 하루 요약과 활동에 맞춘 휴식을 설정할 수 있습니다. Google Health를 통해 Pixel Watch 또는 Fitbit을 연결할 수 있습니다. - **마스코트 집중 모드.** 집중 시간과 휴식을 번갈아 진행합니다. 마스코트가 옆에서 책을 읽고 남은 시간을 표시합니다. 건강 알림은 쉬는 시간까지 기다리고, 자리를 비우면 타이머가 멈춥니다. - **성능 개선.** 큰 XML 파일이 더 빨리 열리고, 썸네일, 트레이 패널, 편집기, 동영상 플레이어가 더 적은 자원으로 부드럽게 동작합니다. diff --git a/docs/novedades.md b/docs/novedades.md index 0a28b41..337b1f6 100644 --- a/docs/novedades.md +++ b/docs/novedades.md @@ -10,9 +10,8 @@ Formato: una sección `## X.Y.Z` por versión y, en ella, una línea por novedad - **Interfaz en inglés.** Stackshot sigue el idioma de Windows: una instalación nueva en un Windows en inglés se abre en inglés. Puedes cambiarlo en Ajustes > General > Apariencia > Idioma. - **Alemán completo.** El alemán cubre ya toda la aplicación: captura, editor, grabación, la mascota, Inicio, el historial y los informes. - **Interfaz en coreano.** Elige 한국어 en Ajustes > General > Apariencia > Idioma. Gracias a @Hobeom por la traducción. -- **Selector de idioma nuevo.** Busca el idioma por nombre o por código y comprueba si su traducción está completa o es una vista previa. +- **Selector de idioma nuevo.** Busca el idioma por nombre o por código; cada uno indica que su traducción está completa. - **Idioma automático y una oferta única.** El modo automático sigue el idioma de Windows (español, inglés, alemán o coreano). Si ya usabas Stackshot en español en un Windows en otro idioma, se te ofrece una sola vez el idioma que corresponde; si no aceptas, no cambia nada. -- **Idiomas en vista previa.** Francés, portugués, chino simplificado, hindi, árabe y bengalí aparecen en el selector como vista previa: traducen lo más común y el resto sigue en inglés. - **Datos sensibles tapados en cualquier idioma.** Detectar y tapar los datos sensibles de una captura funciona igual sea cual sea el idioma de la interfaz. ## 2.2.1 From 937be981d9335c3c4c94ab556ea11eadbcb621dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Mart=C3=ADnez?= <171921708+rubenitx@users.noreply.github.com> Date: Mon, 23 Nov 2026 18:58:29 +0100 Subject: [PATCH 3/4] docs: Stop naming hidden languages in the changelog and tutorial --- CHANGELOG.md | 2 +- docs/new-features-tutorial.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c07138a..1cc4b76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- **Language picker.** Under Settings › General › Appearance › Language, search by name or code and choose Automatic, Español, English, Deutsch or 한국어, each marked as complete. French, Portuguese, Simplified Chinese, Hindi, Arabic and Bengali are written but kept hidden (one switch, `I18n.PreviewsListed`) until their translations are complete; a settings file that names one of them reads as Automatic. +- **Language picker.** Under Settings › General › Appearance › Language, search by name or code and choose Automatic, Español, English, Deutsch or 한국어, each marked as complete. - **English interface.** Stackshot follows the Windows language: English on an English Windows, and English can be chosen under Settings › General › Appearance › Language. Contributed by @altmashnaveed (PR #12). - **Korean interface.** Select 한국어 in the language picker or use Automatic on Korean Windows. Existing language preferences are preserved. Contributed by @Hobeom (PR #30). - **German, complete.** The German interface that arrived with PR #13 (by Aamer Shahzad) now covers the whole app: capture and the area picker, the editor, recording and the video tools, the desktop mascot included, the Home window, history, reports and the Markdown and XML viewers. Notices keep their kind in every language (their kind comes from the text's key, not from the words of one language), a document that is not UTF-8 is rescued the same in all languages, and shown numbers use each language's own thousands and decimal marks. The in-app news come in the interface language (Spanish, English, German and Korean). diff --git a/docs/new-features-tutorial.md b/docs/new-features-tutorial.md index c783976..d39544b 100644 --- a/docs/new-features-tutorial.md +++ b/docs/new-features-tutorial.md @@ -17,7 +17,7 @@ Stackshot adds **German (Deutsch)** alongside English and Spanish, and it is com - All other display languages -> English (`en`) - **One-time offer**: If you already used Stackshot in Spanish and your Windows is in another language, Stackshot offers the matching language once in a notice; nothing changes unless you accept, and you can always change it later in the settings. - **Settings Selector**: Under **Settings › General › Appearance › Language**, open the picker and search by name or language code. Choose a language and select **Apply language**. -- **Languages kept back**: French, Portuguese, Simplified Chinese, Hindi, Arabic and Bengali exist as partial translations but are hidden for now (they are not in the picker, and a settings file that names one reads as Automatic); they return when each one is complete. Automatic mode chooses Spanish, German, Korean or English based on Windows. +- **Complete languages only**: The picker lists only languages whose translation is complete: Spanish, English, German and Korean. Automatic mode chooses Spanish, German, Korean or English based on Windows. --- From 20fe550692d40758aec4b1af1c0ce7d409ed0b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Mart=C3=ADnez?= <171921708+rubenitx@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:48:28 +0100 Subject: [PATCH 4/4] docs: Drop the README line that called Korean incomplete --- README.es.md | 2 +- README.md | 2 +- tests/app/AppTestsI18nFinal.cs | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.es.md b/README.es.md index b12c611..32c8e75 100644 --- a/README.es.md +++ b/README.es.md @@ -649,7 +649,7 @@ Al abrir `Stackshot.exe` te ofrece instalarlo para tu usuario (sin permisos de a ¿Tiene la interfaz en español?
-Sí: en español, inglés, alemán y coreano. Una instalación nueva sigue el idioma de Windows (coreano en un Windows en coreano; español en un Windows en español, catalán, gallego o euskera; alemán en uno alemán; inglés en los demás), y **Ajustes › General › Apariencia › Idioma** lo cambia al momento (Automático, Español, English, Deutsch, 한국어), durante la instalación o desde la bandeja. Quien ya usaba Stackshot sigue en español; si su Windows está en otro idioma, se le ofrece una sola vez el que corresponde, y no cambia nada si no lo acepta. Los textos que falten en coreano se muestran en inglés. La traducción al inglés la aportó [@altmashnaveed](https://github.com/altmashnaveed) y la del coreano [@Hobeom](https://github.com/Hobeom); el alemán y la redacción de claves vinieron de la PR #13 de [@aamershahzad2](https://github.com/aamershahzad2). +Sí: en español, inglés, alemán y coreano. Una instalación nueva sigue el idioma de Windows (coreano en un Windows en coreano; español en un Windows en español, catalán, gallego o euskera; alemán en uno alemán; inglés en los demás), y **Ajustes › General › Apariencia › Idioma** lo cambia al momento (Automático, Español, English, Deutsch, 한국어), durante la instalación o desde la bandeja. Quien ya usaba Stackshot sigue en español; si su Windows está en otro idioma, se le ofrece una sola vez el que corresponde, y no cambia nada si no lo acepta. La traducción al inglés la aportó [@altmashnaveed](https://github.com/altmashnaveed) y la del coreano [@Hobeom](https://github.com/Hobeom); el alemán y la redacción de claves vinieron de la PR #13 de [@aamershahzad2](https://github.com/aamershahzad2). ## Compilar desde el código diff --git a/README.md b/README.md index 1b12d40..830a48c 100644 --- a/README.md +++ b/README.md @@ -649,7 +649,7 @@ Running `Stackshot.exe` offers to install it for your user (no administrator rig Is there an English interface?
-Yes. Stackshot speaks Spanish, English, German and Korean. A new installation follows the Windows display language (Korean on a Korean Windows; Spanish on a Spanish, Catalan, Galician or Basque Windows; German on a German one; English everywhere else), and **Settings › General › Appearance › Language** switches it at once (Automatic, Español, English, Deutsch, 한국어), at setup or from the tray. Those who already used Stackshot keep Spanish; if their Windows is in another language, the matching language is offered once, and nothing changes unless they accept. Any Korean text still missing is shown in English. The English translation was contributed by [@altmashnaveed](https://github.com/altmashnaveed) and the Korean one by [@Hobeom](https://github.com/Hobeom); German and the secrets redaction came from PR #13 by [@aamershahzad2](https://github.com/aamershahzad2). +Yes. Stackshot speaks Spanish, English, German and Korean. A new installation follows the Windows display language (Korean on a Korean Windows; Spanish on a Spanish, Catalan, Galician or Basque Windows; German on a German one; English everywhere else), and **Settings › General › Appearance › Language** switches it at once (Automatic, Español, English, Deutsch, 한국어), at setup or from the tray. Those who already used Stackshot keep Spanish; if their Windows is in another language, the matching language is offered once, and nothing changes unless they accept. The English translation was contributed by [@altmashnaveed](https://github.com/altmashnaveed) and the Korean one by [@Hobeom](https://github.com/Hobeom); German and the secrets redaction came from PR #13 by [@aamershahzad2](https://github.com/aamershahzad2). ## Building from source diff --git a/tests/app/AppTestsI18nFinal.cs b/tests/app/AppTestsI18nFinal.cs index 888e9f6..3f5be3b 100644 --- a/tests/app/AppTestsI18nFinal.cs +++ b/tests/app/AppTestsI18nFinal.cs @@ -44,6 +44,7 @@ public static void Suite(Action T) T("korean-writes-markdown-in-hangul", KoreanWritesMarkdownInHangul); T("no-bare-markdown-label-in-src", NoBareMarkdownLabelInSrc); T("tray-panel-has-no-foreign-leftovers", TrayPanelHasNoForeignLeftovers); + T("readmes-call-korean-complete", ReadmesCallKoreanComplete); T("tray-recent-dates-follow-the-language", TrayRecentDatesFollowTheLanguage); T("picker-lists-only-the-complete-languages", PickerListsOnlyTheCompleteLanguages); T("hidden-languages-load-as-automatic", HiddenLanguagesLoadAsAutomatic); @@ -62,6 +63,18 @@ static void Same(string expected, string actual, string what) static string Show(string s) { return s == null ? "null" : Regex.Replace(s, "[^\\x20-\\x7e]", m => "\\u" + ((int)m.Value[0]).ToString("X4")); } + // Korean is one of the four complete languages: no README may say some of its texts are still missing. + static void ReadmesCallKoreanComplete() + { + string root = AppTestsI18nCoverage.RepoRoot(); + foreach (string f in new[] { "README.md", "README.es.md" }) + { + string t = File.ReadAllText(Path.Combine(root, f), Encoding.UTF8); + Check(t.IndexOf("Korean text still missing", StringComparison.Ordinal) < 0 && + t.IndexOf("falten en coreano", StringComparison.Ordinal) < 0, f + " says Korean is incomplete"); + } + } + static string Src(string rel) { return File.ReadAllText(Path.Combine(AppTestsI18nCoverage.RepoRoot(), "src", rel), Encoding.UTF8); } static void InLanguage(string lang, Action body)