Skip to content

armgit / nota

Public Imported from GitHub
0

Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.

(fix) Open the manual in the interface language (#539) (#543)

vv7rad5b1c6f5853
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 05a50981..ebe40490 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,13 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
## [Unreleased]
+### Changed
+- **The manual opens in the interface language** (#539): Help ▸ Documentation and each device's
+ Documentation item open the French manual (`/fr/`) when Nota runs in French, the Russian one
+ for Russian, and the English one otherwise. The choice used to follow the OS language, so a
+ French interface got the English manual and a Russian OS with an English interface got the
+ Russian one.
+
## [0.59.2] — 2026-11-08
### Added
diff --git a/FEATURES.md b/FEATURES.md
index 9b1dff14..f3c0f324 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -1419,8 +1419,8 @@ audio effects after it keep running and keep their settings; saved with the proj
pads, crossovers, thresholds, trim and loop markers, the Stereo Map dots), envelope nodes
(instrument envelopes and audio clips' ADSR handles) and mod-matrix cells (double-click
or **Clear** removes a route); Tab moves to the handle's next value.
-- **User manual** (EN / RU, https://nota-daw.github.io/nota-docs/) — **Help ▸ Documentation**
- opens it in the system language, the start window links to the first-track tutorial, and
+- **User manual** (EN / FR / RU, https://nota-daw.github.io/nota-docs/) — **Help ▸ Documentation**
+ opens it in the interface language, the start window links to the first-track tutorial, and
each device header menu's **Documentation** item opens that device's page.
- **A shortcut list** in Preferences → Shortcuts, grouped by section (File, Command palette,
Transport, Arrangement & Editing, Piano roll, Play notes, Mouse).
diff --git a/src/managed/Nota.App/ManualLanguage.cs b/src/managed/Nota.App/ManualLanguage.cs
new file mode 100644
index 00000000..2b3fdbca
--- /dev/null
+++ b/src/managed/Nota.App/ManualLanguage.cs
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// Which language of the user manual (nota-daw/nota-docs) the app opens. The manual is English
+// at its root, with a translation under /<code>/ for each language listed here. The choice
+// follows the language the interface runs in (Loc.Language), never the OS language
+// (spec 068 FR-006). Pure, no Avalonia, so the smoke test can walk it.
+
+using System;
+
+namespace Nota.App;
+
+internal static class ManualLanguage
+{
+ // The translations that exist in nota-docs (src/content/docs/<code>/). Add a code here when
+ // a translation lands there. A page a translation lacks is served by the manual itself, in
+ // English with a notice, so the app never has to check pages.
+ private static readonly string[] Translated = { "fr", "ru" };
+
+ /// <summary>The manual's folder for an interface language code: "fr/", "ru/", or "" (the
+ /// English root) for English and for any language the manual does not have. A regional code
+ /// ("fr-CA") reads as its language.</summary>
+ public static string Folder(string? uiLanguage)
+ {
+ if (string.IsNullOrWhiteSpace(uiLanguage)) return "";
+ int cut = uiLanguage.AsSpan().IndexOfAny('-', '_');
+ string code = (cut < 0 ? uiLanguage : uiLanguage[..cut]).Trim().ToLowerInvariant();
+ return Array.IndexOf(Translated, code) >= 0 ? code + "/" : "";
+ }
+}
diff --git a/src/managed/Nota.App/NotaDocs.cs b/src/managed/Nota.App/NotaDocs.cs
index 3c3d5e27..a1d5fcb4 100644
--- a/src/managed/Nota.App/NotaDocs.cs
+++ b/src/managed/Nota.App/NotaDocs.cs
@@ -3,12 +3,13 @@
//
// Links into the user manual (nota-daw/nota-docs, published on GitHub Pages): Help ▸
// Documentation and each device card's "Documentation" item. The manual is English with a
-// Russian translation under /ru/; a Russian UI culture opens that one. The page slugs mirror
+// translation under /<code>/ for each language ManualLanguage lists (French, Russian); the one
+// that opens follows the language the interface runs in. The page slugs mirror
// the manual's src/content/docs tree — keep them in step when a device is added there.
using System;
-using System.Globalization;
using Avalonia.Controls;
+using Nota.Application.Localization;
namespace Nota.App;
@@ -35,10 +36,7 @@ internal static class NotaDocs
/// <summary>The manual's address for a page ("" = the home page), in the UI's language.</summary>
public static string Url(string page = "")
- {
- bool ru = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ru";
- return BaseUrl + (ru ? "ru/" : "") + (page.Length > 0 ? page.TrimEnd('/') + "/" : "");
- }
+ => BaseUrl + ManualLanguage.Folder(Loc.Language) + (page.Length > 0 ? page.TrimEnd('/') + "/" : "");
/// <summary>The page for a built-in device, or the plug-ins page for anything else.</summary>
public static string DevicePage(DeviceChainView.ChainKind kind, int engineKind)
diff --git a/tests/Nota.SmokeTest/DesignTokenCheck.Localization.cs b/tests/Nota.SmokeTest/DesignTokenCheck.Localization.cs
index 43b1305c..9eafddf8 100644
--- a/tests/Nota.SmokeTest/DesignTokenCheck.Localization.cs
+++ b/tests/Nota.SmokeTest/DesignTokenCheck.Localization.cs
@@ -354,7 +354,7 @@ internal static partial class DesignTokenCheck
{
var rel = RelManaged(root, f);
var source = File.ReadAllText(f);
- if ((source.Contains("CurrentUICulture") || source.Contains("InstalledUICulture")) && rel != "Nota.App/NotaDocs.cs") osLanguage.Add(rel);
+ if ((source.Contains("CurrentUICulture") || source.Contains("InstalledUICulture"))) osLanguage.Add(rel);
bool writesWork = rel.StartsWith("Nota.Domain/") || rel.StartsWith("Nota.Infrastructure/Settings/")
|| Regex.IsMatch(rel, @"^Nota\.Infrastructure/Persistence/(Project(Model|Service|Store|Template|Migrations)|Recovery|PresetModel|PresetStore|PresetLibrary|AudioClipState)\w*\.cs$");
if (writesWork && source.Contains("Loc.")) persistedText.Add(rel);
diff --git a/tests/Nota.SmokeTest/ManualLanguageTests.cs b/tests/Nota.SmokeTest/ManualLanguageTests.cs
new file mode 100644
index 00000000..edc92b7c
--- /dev/null
+++ b/tests/Nota.SmokeTest/ManualLanguageTests.cs
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// Which language of the user manual the app opens (nota#539): the folder follows the language
+// the interface runs in; English and any language the manual lacks open the English root.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using Nota.App;
+
+namespace Nota.SmokeTest;
+
+internal static class ManualLanguageTests
+{
+ public static IEnumerable<(bool, string)> Run()
+ {
+ foreach (var (code, folder) in new[]
+ {
+ ("en", ""), ("fr", "fr/"), ("ru", "ru/"),
+ ("FR", "fr/"), ("fr-CA", "fr/"), ("ru_RU", "ru/"),
+ ("de", ""), ("pt-BR", ""), ("", ""), (" ", ""), ("zz", ""),
+ })
+ {
+ string got = ManualLanguage.Folder(code);
+ yield return (got == folder, $"the manual for the interface language \"{code}\" is \"{folder}\" (got \"{got}\")");
+ }
+ yield return (ManualLanguage.Folder(null) == "", "no interface language opens the English manual");
+
+ // The OS language never picks the manual: NotaDocs reads the interface language only.
+ string root = AppContext.BaseDirectory;
+ while (root != null && !File.Exists(Path.Combine(root, "VERSION"))) root = Path.GetDirectoryName(root)!;
+ var docs = File.ReadAllText(Path.Combine(root!, "src/managed/Nota.App/NotaDocs.cs"));
+ yield return (docs.Contains("ManualLanguage.Folder(Loc.Language)") && !docs.Contains("CurrentUICulture"),
+ "NotaDocs.Url follows Loc.Language (the interface), not the OS culture");
+ }
+}
diff --git a/tests/Nota.SmokeTest/Nota.SmokeTest.csproj b/tests/Nota.SmokeTest/Nota.SmokeTest.csproj
index f080c531..2c583628 100644
--- a/tests/Nota.SmokeTest/Nota.SmokeTest.csproj
+++ b/tests/Nota.SmokeTest/Nota.SmokeTest.csproj
@@ -45,6 +45,8 @@
<Compile Include="..\..\src\managed\Nota.App\Input\ShortcutAvaloniaExtensions.cs" Link="ShortcutAvaloniaExtensions.cs" />
<!-- What's New's changelog / release-notes parsers (no Avalonia inside). -->
<Compile Include="..\..\src\managed\Nota.App\Changelog.cs" Link="Changelog.cs" />
+ <!-- Which language of the manual the app opens (nota#539; no Avalonia inside). -->
+ <Compile Include="..\..\src\managed\Nota.App\ManualLanguage.cs" Link="ManualLanguage.cs" />
<!-- Typed value entry's parser / read-out search (no Avalonia inside). -->
<Compile Include="..\..\src\managed\Nota.App\Controls\ValueText.cs" Link="ValueText.cs" />
<!-- Clip editor position / tempo / ruler math (specs/036; no Avalonia inside). -->
diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.cs
index c3a6990c..003b2b4d 100644
--- a/tests/Nota.SmokeTest/Program.cs
+++ b/tests/Nota.SmokeTest/Program.cs
@@ -15478,6 +15478,10 @@ foreach (var (ok, label) in AuditionTests.Run()) Check(ok, label);
Console.WriteLine("-- app: What's New release notes --");
foreach (var (ok, label) in ReleaseNotesTests.Run()) Check(ok, label);
+// --- app: the manual opens in the interface language ---
+Console.WriteLine("-- app: manual language --");
+foreach (var (ok, label) in ManualLanguageTests.Run()) Check(ok, label);
+
// --- app: typed value entry (parser + read-out search) ---
Console.WriteLine("-- typed value entry --");
foreach (var (ok, label) in ValueEntryTests.Run()) Check(ok, label);