diff --git a/AGENTS.md b/AGENTS.md
index a48e764..ecd2531 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -197,13 +197,19 @@ both sides, then implement the Go `*Service` and call it from a C# ViewModel.
(`errorStatus` helper); the `ErrorCode` enum is the programmatic discriminator
and the frontend maps it to a localized string. The status message is diagnostic
only.
-- **i18n**: dynamic display messages travel as a localization **key**
- `"namespace.method.type"` (+ args) in a `LocalizedMessage`; the frontend resolves
- it against `.resw`. Resources live in
- `app/JustHostMC.App/Strings/{en-US,zh-Hant}/Resources.resw`; **en-US is the base
- and fallback**. Backend keys use `.` separators; `LocalizationService` rewrites
- `.` → `_` to match `.resw` keys. Adding a language is a new `.resw` folder, no
- code change.
+- **i18n/resources**: prefer XAML `x:Uid` property resources for all static UI,
+ including dialog chrome, InfoBars, tooltips, and automation properties.
+ Resources live in
+ `app/JustHostMC.App/Strings/{en-US,zh-TW}/Resources.resw`; **en-US is the base
+ and fallback**. Dynamic backend messages use dotted
+ `"namespace.method.type"` keys (+ args) in `LocalizedMessage`;
+ `LocalizationService` maps `.` → `/` for MRT Core lookup. Localized dialogs
+ are XAML `ContentDialog` classes, imperative controls select XAML-defined
+ tooltip styles/templates, and app-wide Community Toolkit converters stay in
+ `Application.Resources`. Deduplicate by semantic meaning and target property;
+ document unavoidable duplicates with their canonical identifier. See
+ [`docs/resources.md`](docs/resources.md) for the complete rules, approved C#
+ exceptions, assets, language addition, and validation workflow.
### MVVM Toolkit source generation
diff --git a/JustHostMC.sln b/JustHostMC.sln
index 53e1f32..5ccacfe 100644
--- a/JustHostMC.sln
+++ b/JustHostMC.sln
@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JustHostMC.Core.Tests", "ap
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JustHostMC.App", "app\JustHostMC.App\JustHostMC.App.csproj", "{E5CDD455-4BC1-459D-AE24-721828C866D4}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JustHostMC.App.ResourceTests", "app\JustHostMC.App.ResourceTests\JustHostMC.App.ResourceTests.csproj", "{A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -79,6 +81,22 @@ Global
{E5CDD455-4BC1-459D-AE24-721828C866D4}.Release|x86.ActiveCfg = Release|x86
{E5CDD455-4BC1-459D-AE24-721828C866D4}.Release|x86.Build.0 = Release|x86
{E5CDD455-4BC1-459D-AE24-721828C866D4}.Release|x86.Deploy.0 = Release|x86
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Debug|x64.Build.0 = Debug|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Debug|x86.Build.0 = Debug|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Release|ARM64.Build.0 = Release|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Release|x64.ActiveCfg = Release|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Release|x64.Build.0 = Release|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Release|x86.ActiveCfg = Release|Any CPU
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -87,6 +105,7 @@ Global
{6C695E07-80F7-4CDD-89D7-5166A97D4B6E} = {F95F473B-E98A-ACD6-1986-755F447BE36F}
{468F0BCC-71DE-4F47-BAD0-80300AE43D03} = {F95F473B-E98A-ACD6-1986-755F447BE36F}
{E5CDD455-4BC1-459D-AE24-721828C866D4} = {F95F473B-E98A-ACD6-1986-755F447BE36F}
+ {A5B1D07E-7E7C-4D72-9C9A-4B86D58C7150} = {F95F473B-E98A-ACD6-1986-755F447BE36F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7D2AD613-A606-4755-BA00-96E200813585}
diff --git a/app/JustHostMC.App.ResourceTests/BackupConfigFiniteStateTests.cs b/app/JustHostMC.App.ResourceTests/BackupConfigFiniteStateTests.cs
new file mode 100644
index 0000000..3c3cbd6
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/BackupConfigFiniteStateTests.cs
@@ -0,0 +1,74 @@
+using Xunit;
+
+namespace JustHostMC.App.ResourceTests;
+
+public sealed class BackupConfigFiniteStateTests {
+ [Fact]
+ public void BackupWorkflowUsesSemanticStateAndXamlResources() {
+ var viewModel = File.ReadAllText(
+ RepositoryLayout.AppPath("ViewModels", "BackupsViewModel.cs"));
+ var xaml = File.ReadAllText(
+ RepositoryLayout.AppPath("Views", "BackupsDialog.xaml"));
+
+ Assert.Contains("BackupStatus", viewModel, StringComparison.Ordinal);
+ Assert.DoesNotContain("_localizer.Get(\"Backups_", viewModel,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"BackupsStatusCreating\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"BackupsStatusCreated\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"BackupsStatusRestoring\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"BackupsStatusRestored\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"BackupsStatusDeleting\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"BackupsStatusDeleted\"", xaml,
+ StringComparison.Ordinal);
+ Assert.DoesNotContain("_localizer.Get(",
+ File.ReadAllText(RepositoryLayout.AppPath(
+ "Views", "BackupsDialog.xaml.cs")),
+ StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void ConfigWorkflowUsesSemanticStateAndXamlResources() {
+ var viewModel = File.ReadAllText(
+ RepositoryLayout.AppPath("ViewModels", "ServerConfigViewModel.cs"));
+ var xaml = File.ReadAllText(RepositoryLayout.AppPath(
+ "Controls", "Server", "ServerConfigPanel.xaml"));
+
+ Assert.Contains("ConfigStatus", viewModel, StringComparison.Ordinal);
+ Assert.DoesNotContain("_localizer.Get(\"Config_", viewModel,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ConfigStatusSaved\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ConfigStatusLoadFailed\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ConfigStatusSaveFailed\"", xaml,
+ StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void ConfigValueTypesUseSemanticFlagsAndXamlResources() {
+ var model = File.ReadAllText(
+ RepositoryLayout.AppPath("Models", "ConfigEntryItem.cs"));
+ var xaml = File.ReadAllText(
+ RepositoryLayout.AppPath("Controls", "ConfigEntryEditor.xaml"));
+
+ Assert.DoesNotContain("TypeText", model, StringComparison.Ordinal);
+ Assert.DoesNotContain("ConfigType_", model, StringComparison.Ordinal);
+ Assert.Contains("IsBoolean", model, StringComparison.Ordinal);
+ Assert.Contains("IsInteger", model, StringComparison.Ordinal);
+ Assert.Contains("IsChoice", model, StringComparison.Ordinal);
+ Assert.Contains("IsText", model, StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ConfigTypeBooleanText\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ConfigTypeIntegerText\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ConfigTypeChoiceText\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ConfigTypeTextText\"", xaml,
+ StringComparison.Ordinal);
+ }
+}
diff --git a/app/JustHostMC.App.ResourceTests/ControlLocalizationArchitectureTests.cs b/app/JustHostMC.App.ResourceTests/ControlLocalizationArchitectureTests.cs
new file mode 100644
index 0000000..c43889b
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/ControlLocalizationArchitectureTests.cs
@@ -0,0 +1,49 @@
+using Xunit;
+
+namespace JustHostMC.App.ResourceTests;
+
+public sealed class ControlLocalizationArchitectureTests {
+ [Fact]
+ public void AssignedControlsDoNotFetchStaticOrFiniteStateStringsFromCode() {
+ var forbiddenKeys = new[] {
+ "LogViewer_JumpToLatest",
+ "Scripts_RemoveConfirmPrimary",
+ "ServerSectionConfig/Text",
+ "ServerSectionConfigHint/Text",
+ "ConfigStoppedHint/Text",
+ "Server_PortAutoValue",
+ "Server_ValueUnknown",
+ "ServerSectionModsHint/Text",
+ "ModsStoppedHint/Text",
+ "ServerSectionPerformance/Text",
+ "ServerSectionPerformanceHint/Text",
+ "PlayersEmptyHint/Text",
+ "ServerSectionPlayersHint/Text",
+ };
+ var sourceFiles = new[] {
+ RepositoryLayout.AppPath("Controls", "LogViewer.xaml.cs"),
+ RepositoryLayout.AppPath("Controls", "ScriptEntryCard.xaml.cs"),
+ RepositoryLayout.AppPath("Controls", "Server",
+ "ServerConfigPanel.xaml.cs"),
+ RepositoryLayout.AppPath("Controls", "Server",
+ "ServerHeaderPanel.xaml.cs"),
+ RepositoryLayout.AppPath("Controls", "Server",
+ "ServerModsPanel.xaml.cs"),
+ RepositoryLayout.AppPath("Controls", "Server",
+ "ServerPerformancePanel.xaml.cs"),
+ RepositoryLayout.AppPath("Controls", "Server",
+ "ServerPlayersPanel.xaml.cs"),
+ RepositoryLayout.AppPath("Views", "SettingsPage.xaml.cs"),
+ };
+ var source = string.Join('\n', sourceFiles.Select(File.ReadAllText));
+
+ foreach (var key in forbiddenKeys)
+ Assert.DoesNotContain($"\"{key}\"", source,
+ StringComparison.Ordinal);
+
+ var settingsXaml = File.ReadAllText(
+ RepositoryLayout.AppPath("Views", "SettingsPage.xaml"));
+ Assert.DoesNotContain("PlaceholderText=\"API Key\"", settingsXaml,
+ StringComparison.Ordinal);
+ }
+}
diff --git a/app/JustHostMC.App.ResourceTests/ConverterArchitectureTests.cs b/app/JustHostMC.App.ResourceTests/ConverterArchitectureTests.cs
new file mode 100644
index 0000000..b9c176d
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/ConverterArchitectureTests.cs
@@ -0,0 +1,28 @@
+using System.Xml.Linq;
+using Xunit;
+
+namespace JustHostMC.App.ResourceTests;
+
+public sealed class ConverterArchitectureTests {
+ [Fact]
+ public void AppReferencesCommunityToolkitConverters() {
+ var project =
+ XDocument.Load(RepositoryLayout.AppPath("JustHostMC.App.csproj"));
+
+ var packageNames =
+ project.Descendants("PackageReference")
+ .Select(element => (string?)element.Attribute("Include"));
+
+ Assert.Contains("CommunityToolkit.WinUI.Converters", packageNames);
+ }
+
+ [Fact]
+ public void AppDoesNotRetainCustomBoolToVisibilityConverter() {
+ var converterPath = RepositoryLayout.AppPath(
+ "Converters", "BoolToVisibilityConverter.cs");
+
+ Assert.False(
+ File.Exists(converterPath),
+ $"Replace the custom converter with CommunityToolkit.WinUI.Converters: {converterPath}");
+ }
+}
diff --git a/app/JustHostMC.App.ResourceTests/FeatureFiniteStateTests.cs b/app/JustHostMC.App.ResourceTests/FeatureFiniteStateTests.cs
new file mode 100644
index 0000000..d730cf0
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/FeatureFiniteStateTests.cs
@@ -0,0 +1,105 @@
+using Xunit;
+
+namespace JustHostMC.App.ResourceTests;
+
+public sealed class FeatureFiniteStateTests {
+ [Fact]
+ public void ModsFiniteLabelsUseSemanticStateAndXamlResources() {
+ var viewModel =
+ RepositoryLayout.ReadAppFile("ViewModels", "ModsViewModel.cs");
+ var xaml = RepositoryLayout.ReadAppFile("Controls", "Server",
+ "ServerModsPanel.xaml");
+
+ Assert.Contains("ModsWorkflowStatus", viewModel,
+ StringComparison.Ordinal);
+ Assert.DoesNotContain("KindLabel", viewModel, StringComparison.Ordinal);
+ Assert.DoesNotContain("_localizer.Get(\"Mods_Export", viewModel,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ServerModsTitleConverter\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ModsStatusExported\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ModsStatusExportFailed\"", xaml,
+ StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void SettingsFiniteLabelsUseSemanticStateAndXamlResources() {
+ var viewModel =
+ RepositoryLayout.ReadAppFile("ViewModels", "SettingsViewModel.cs");
+ var xaml = RepositoryLayout.ReadAppFile("Views", "SettingsPage.xaml");
+
+ Assert.Contains("SettingsWorkflowStatus", viewModel,
+ StringComparison.Ordinal);
+ Assert.Contains("ShopKeyConfiguration", viewModel,
+ StringComparison.Ordinal);
+ Assert.Contains("BackendMode", viewModel, StringComparison.Ordinal);
+ Assert.DoesNotContain("ActiveModeText", viewModel,
+ StringComparison.Ordinal);
+ Assert.DoesNotContain("CurseForgeKeyStatus", viewModel,
+ StringComparison.Ordinal);
+
+ foreach (var uid in new[] {
+ "SettingsBackendModeDocker",
+ "SettingsBackendModeOnMachine",
+ "SettingsDockerUnavailable",
+ "SettingsShopKeyNone",
+ "SettingsShopKeyUser",
+ "SettingsShopKeyBuiltin",
+ "SettingsStatusSaved",
+ "SettingsStatusSaveFailed",
+ }) {
+ Assert.Contains($"x:Uid=\"{uid}\"", xaml, StringComparison.Ordinal);
+ }
+ }
+
+ [Fact]
+ public void ShopFiniteLabelsUseSemanticStateAndXamlResources() {
+ var shop =
+ RepositoryLayout.ReadAppFile("ViewModels", "ShopViewModel.cs");
+ var detail = RepositoryLayout.ReadAppFile("ViewModels",
+ "ShopDetailViewModel.cs");
+ var window = RepositoryLayout.ReadAppFile("Views", "ShopWindow.xaml");
+ var detailXaml =
+ RepositoryLayout.ReadAppFile("Views", "ShopDetailPage.xaml");
+
+ Assert.Contains("HasLoadFailure", shop, StringComparison.Ordinal);
+ Assert.DoesNotContain("_localizer.Get(\"Shop_LoadFailed\")", shop,
+ StringComparison.Ordinal);
+ Assert.Contains("ShopDetailStatus", detail, StringComparison.Ordinal);
+ Assert.DoesNotContain("_localizer.Get(\"Shop_InstallDone\")", detail,
+ StringComparison.Ordinal);
+ Assert.DoesNotContain("_localizer.Get(\"Shop_InstallAction\")", detail,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ShopLoadFailedBar\"", window,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ShopInstallActionText\"", detailXaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ShopStatusInstallDone\"", detailXaml,
+ StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void ScriptLogFiniteLabelsAreRenderedByXaml() {
+ var viewModel =
+ RepositoryLayout.ReadAppFile("ViewModels", "ScriptsViewModel.cs");
+ var xaml =
+ RepositoryLayout.ReadAppFile("Views", "ScriptLogsWindow.xaml");
+
+ foreach (var key in new[] {
+ "Scripts_SystemLogName",
+ "Scripts_LogEntryFallbackTitle",
+ "Scripts_CurrentSessionTitle",
+ "Scripts_PreviousSessionTitle",
+ }) {
+ Assert.DoesNotContain($"_localizer.Get(\"{key}\")", viewModel,
+ StringComparison.Ordinal);
+ }
+ Assert.Contains("x:Uid=\"ScriptLogsSystemName\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ScriptLogsCurrentSessionTitle\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ScriptLogsPreviousSessionTitle\"", xaml,
+ StringComparison.Ordinal);
+ }
+}
diff --git a/app/JustHostMC.App.ResourceTests/JustHostMC.App.ResourceTests.csproj b/app/JustHostMC.App.ResourceTests/JustHostMC.App.ResourceTests.csproj
new file mode 100644
index 0000000..78f313c
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/JustHostMC.App.ResourceTests.csproj
@@ -0,0 +1,21 @@
+
+
+
+ net9.0
+ enable
+ enable
+ latest
+ false
+ true
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
diff --git a/app/JustHostMC.App.ResourceTests/MainSurfaceFiniteStateTests.cs b/app/JustHostMC.App.ResourceTests/MainSurfaceFiniteStateTests.cs
new file mode 100644
index 0000000..2de6607
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/MainSurfaceFiniteStateTests.cs
@@ -0,0 +1,80 @@
+using Xunit;
+
+namespace JustHostMC.App.ResourceTests;
+
+public sealed class MainSurfaceFiniteStateTests {
+ [Fact]
+ public void EngineConnectionStateIsSemanticAndLocalizedInHomeXaml() {
+ var viewModel =
+ RepositoryLayout.ReadAppFile("ViewModels", "MainViewModel.cs");
+ var xaml = RepositoryLayout.ReadAppFile("Views", "HomePage.xaml");
+
+ Assert.Contains("EngineConnectionState", viewModel,
+ StringComparison.Ordinal);
+ Assert.DoesNotContain("_localizer.Get(\"EngineStatus_", viewModel,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"EngineStatusConnectingText\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"EngineStatusConnectedText\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"EngineStatusFailedText\"", xaml,
+ StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void InstallErrorsDoNotExposeGrpcDiagnosticDetails() {
+ var viewModel =
+ RepositoryLayout.ReadAppFile("ViewModels", "MainViewModel.cs");
+
+ Assert.DoesNotContain("ex.Status.Detail", viewModel,
+ StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void ServerCardAndHeaderFiniteLabelsAreLocalizedInXaml() {
+ var model = RepositoryLayout.ReadAppFile("Models", "ServerItem.cs");
+ var home = RepositoryLayout.ReadAppFile("Views", "HomePage.xaml");
+ var header = RepositoryLayout.ReadAppFile("Controls", "Server",
+ "ServerHeaderPanel.xaml");
+ var xaml = home + '\n' + header;
+
+ foreach (var property in new[] {
+ "public string StatusText",
+ "public string StateActionText",
+ "public string DeleteActionText",
+ })
+ Assert.DoesNotContain(property, model, StringComparison.Ordinal);
+
+ foreach (var keyPrefix in new[] {
+ "ServerState_",
+ "ServerDelete_Action",
+ "ServerInstallRemove_Action",
+ "ServerType_",
+ })
+ Assert.DoesNotContain($"\"{keyPrefix}", model,
+ StringComparison.Ordinal);
+
+ foreach (var uid in new[] {
+ "ServerStatusRunningText", "ServerStatusStoppedText",
+ "ServerStatusInstallingText", "ServerStatusStartingText",
+ "ServerStatusStoppingText", "ServerStatusCrashedText",
+ "ServerStatusUnknownText", "ServerStateStartText",
+ "ServerStateStopText", "ServerStateStartingText",
+ "ServerStateStoppingText", "ServerStateInstallingText",
+ "ServerTypeVanillaText", "ServerTypePaperText",
+ "ServerTypeSpigotText", "ServerTypeForgeText",
+ "ServerTypeNeoForgeText", "ServerTypeFabricText",
+ "ServerTypeUnknownText",
+ })
+ Assert.Contains($"x:Uid=\"{uid}\"", xaml, StringComparison.Ordinal);
+
+ Assert.Contains("x:Uid=\"HomeCardDeleteMenuItem\"", home,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"HomeCardRemoveIncompleteMenuItem\"", home,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ServerDeleteMenuItem\"", header,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"ServerRemoveIncompleteMenuItem\"", header,
+ StringComparison.Ordinal);
+ }
+}
diff --git a/app/JustHostMC.App.ResourceTests/ModelLocalizationArchitectureTests.cs b/app/JustHostMC.App.ResourceTests/ModelLocalizationArchitectureTests.cs
new file mode 100644
index 0000000..fed1861
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/ModelLocalizationArchitectureTests.cs
@@ -0,0 +1,33 @@
+using Xunit;
+
+namespace JustHostMC.App.ResourceTests;
+
+public sealed class ModelLocalizationArchitectureTests {
+ [Fact]
+ public void BanEntryFiniteLabelsBelongToItsXamlTemplate() {
+ var model = File.ReadAllText(
+ RepositoryLayout.AppPath("Models", "BanEntryItem.cs"));
+ var xaml = File.ReadAllText(
+ RepositoryLayout.AppPath("Views", "BanListDialog.xaml"));
+
+ Assert.DoesNotContain("ILocalizer", model, StringComparison.Ordinal);
+ Assert.DoesNotContain("BanList_Type", model, StringComparison.Ordinal);
+ Assert.DoesNotContain("BanList_NoReason", model,
+ StringComparison.Ordinal);
+ Assert.Contains("BanListEntryIpTypeText", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("BanListEntryPlayerTypeText", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("BanListEntryNoReasonText", xaml,
+ StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void ParserDiagnosticsAreNotFormattedIntoUserFacingModErrors() {
+ var model = File.ReadAllText(
+ RepositoryLayout.AppPath("Models", "ModFileItem.cs"));
+
+ Assert.DoesNotContain("(\"error\", metadata.ParseError)", model,
+ StringComparison.Ordinal);
+ }
+}
diff --git a/app/JustHostMC.App.ResourceTests/RepositoryLayout.cs b/app/JustHostMC.App.ResourceTests/RepositoryLayout.cs
new file mode 100644
index 0000000..9fc88d2
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/RepositoryLayout.cs
@@ -0,0 +1,28 @@
+namespace JustHostMC.App.ResourceTests;
+
+internal static class RepositoryLayout {
+ public static string Root { get; } = FindRoot(AppContext.BaseDirectory);
+
+ public static string AppPath(params string[] segments) => Path.Combine([
+ Root, "app", "JustHostMC.App", ..segments
+ ]);
+
+ public static string RootPath(params string[] segments) => Path.Combine([
+ Root, ..segments
+ ]);
+
+ public static string ReadAppFile(params string[] segments) =>
+ File.ReadAllText(AppPath(segments));
+
+ private static string FindRoot(string startPath) {
+ var directory = new DirectoryInfo(startPath);
+ while (directory is not null) {
+ if (File.Exists(Path.Combine(directory.FullName, "JustHostMC.sln")))
+ return directory.FullName;
+ directory = directory.Parent;
+ }
+
+ throw new DirectoryNotFoundException(
+ $"Could not find the repository root above '{startPath}'.");
+ }
+}
diff --git a/app/JustHostMC.App.ResourceTests/ResourceCatalog.cs b/app/JustHostMC.App.ResourceTests/ResourceCatalog.cs
new file mode 100644
index 0000000..6feefa0
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/ResourceCatalog.cs
@@ -0,0 +1,26 @@
+using System.Xml.Linq;
+
+namespace JustHostMC.App.ResourceTests;
+
+internal sealed record ResourceEntry(string Name, string Value, string Comment);
+
+internal static class ResourceCatalog {
+ public static IReadOnlyList Load(string path) {
+ var document = XDocument.Load(path, LoadOptions.SetLineInfo);
+ return document.Root?.Elements("data")
+ .Select(element => new ResourceEntry(
+ (string?)element.Attribute("name") ?? "",
+ element.Element("value")?.Value ?? "",
+ element.Element("comment")?.Value ?? ""))
+ .ToArray() ??
+ [];
+ }
+
+ public static IReadOnlyList DuplicateNames(
+ IEnumerable entries) =>
+ entries.GroupBy(entry => entry.Name, StringComparer.OrdinalIgnoreCase)
+ .Where(group => group.Count() > 1)
+ .Select(group => group.Key)
+ .Order(StringComparer.OrdinalIgnoreCase)
+ .ToArray();
+}
diff --git a/app/JustHostMC.App.ResourceTests/ResourceCatalogTests.cs b/app/JustHostMC.App.ResourceTests/ResourceCatalogTests.cs
new file mode 100644
index 0000000..88fe9f0
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/ResourceCatalogTests.cs
@@ -0,0 +1,32 @@
+using Xunit;
+
+namespace JustHostMC.App.ResourceTests;
+
+public sealed class ResourceCatalogTests {
+ [Fact]
+ public void LoadRejectsMalformedXml() {
+ var path = WriteTemp("");
+ try {
+ Assert.ThrowsAny(() => ResourceCatalog.Load(path));
+ } finally {
+ File.Delete(path);
+ }
+ }
+
+ [Fact]
+ public void DuplicateNamesAreCaseInsensitive() {
+ var entries = new[] {
+ new ResourceEntry("Example.Text", "One", ""),
+ new ResourceEntry("example.text", "Two", ""),
+ new ResourceEntry("Other.Text", "Three", ""),
+ };
+
+ Assert.Equal(["Example.Text"], ResourceCatalog.DuplicateNames(entries));
+ }
+
+ private static string WriteTemp(string content) {
+ var path = Path.GetTempFileName();
+ File.WriteAllText(path, content);
+ return path;
+ }
+}
diff --git a/app/JustHostMC.App.ResourceTests/ResourceIntegrityTests.cs b/app/JustHostMC.App.ResourceTests/ResourceIntegrityTests.cs
new file mode 100644
index 0000000..1217887
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/ResourceIntegrityTests.cs
@@ -0,0 +1,456 @@
+using System.Text.RegularExpressions;
+using System.Xml.Linq;
+using Xunit;
+
+namespace JustHostMC.App.ResourceTests;
+
+public sealed partial class ResourceIntegrityTests {
+ private static readonly string[] Locales = ["en-US", "zh-TW"];
+
+ [Fact]
+ public void LocaleFilesHaveUniqueNonEmptyEntries() {
+ foreach (var locale in Locales) {
+ var entries = Entries(locale);
+ Assert.Empty(ResourceCatalog.DuplicateNames(entries));
+ Assert.DoesNotContain(
+ entries, entry => string.IsNullOrWhiteSpace(entry.Name) ||
+ string.IsNullOrWhiteSpace(entry.Value));
+ }
+ }
+
+ [Fact]
+ public void LocaleFilesHaveIdenticalIdentifiers() {
+ var english = Entries("en-US")
+ .Select(entry => entry.Name)
+ .ToHashSet(StringComparer.OrdinalIgnoreCase);
+ var chinese = Entries("zh-TW")
+ .Select(entry => entry.Name)
+ .ToHashSet(StringComparer.OrdinalIgnoreCase);
+
+ Assert.True(
+ english.SetEquals(chinese),
+ $"en-US only: {string.Join(", ", english.Except(chinese))}; " +
+ $"zh-TW only: {string.Join(", ", chinese.Except(english))}");
+ }
+
+ [Fact]
+ public void DuplicateVisibleValuesHaveTranslatorContext() {
+ foreach (var locale in Locales) {
+ var undocumented =
+ Entries(locale)
+ .GroupBy(entry => entry.Value, StringComparer.Ordinal)
+ .Where(group => group.Count() > 1)
+ .SelectMany(group => group)
+ .Where(entry => string.IsNullOrWhiteSpace(entry.Comment))
+ .Select(entry => entry.Name)
+ .Order(StringComparer.OrdinalIgnoreCase)
+ .ToArray();
+
+ Assert.True(
+ undocumented.Length == 0,
+ $"{locale} has undocumented duplicate visible values: " +
+ string.Join(", ", undocumented));
+ }
+ }
+
+ [Fact]
+ public void EveryXamlUidHasAResourcePropertyInEveryLocale() {
+ var uids = Directory
+ .EnumerateFiles(RepositoryLayout.AppPath(), "*.xaml",
+ SearchOption.AllDirectories)
+ .Where(path => !IsGenerated(path))
+ .SelectMany(path => XamlUidRegex().Matches(
+ File.ReadAllText(path)))
+ .Select(match => match.Groups[1].Value)
+ .ToHashSet(StringComparer.OrdinalIgnoreCase);
+
+ foreach (var locale in Locales) {
+ var names = Entries(locale).Select(entry => entry.Name).ToArray();
+ var missing =
+ uids.Where(
+ uid => !names.Any(
+ name => name.StartsWith(
+ uid + ".", StringComparison.OrdinalIgnoreCase)))
+ .Order(StringComparer.OrdinalIgnoreCase)
+ .ToArray();
+ Assert.True(
+ missing.Length == 0,
+ $"{locale} has no property resource for x:Uid values: " +
+ string.Join(", ", missing));
+ }
+ }
+
+ [Fact]
+ public void WindowRootsDoNotUseXamlUidLocalization() {
+ var offenders =
+ SourceFiles("*.xaml")
+ .Where(path =>
+ WindowRootUidRegex().IsMatch(File.ReadAllText(path)))
+ .Select(path =>
+ Path.GetRelativePath(RepositoryLayout.Root, path))
+ .Order(StringComparer.OrdinalIgnoreCase)
+ .ToArray();
+
+ Assert.True(
+ offenders.Length == 0,
+ "Window roots cannot use x:Uid because applying Window.Title " +
+ "during XAML loading crashes at runtime: " +
+ string.Join(", ", offenders));
+ }
+
+ [Fact]
+ public void WindowTitlesAreCopiedFromLocalizedTitleBars() {
+ var windows = new[] {
+ (Xaml: RepositoryLayout.AppPath("MainWindow.xaml"),
+ Source: RepositoryLayout.AppPath("MainWindow.xaml.cs"),
+ TitleBar: "SimpleTitleBar", TitleBarUid: "MainTitleBar",
+ WindowUid: "MainWindow"),
+ (Xaml: RepositoryLayout.AppPath("Views", "EngineStdioWindow.xaml"),
+ Source: RepositoryLayout.AppPath("Views",
+ "EngineStdioWindow.xaml.cs"),
+ TitleBar: "MonitorTitleBar", TitleBarUid: "EngineMonitorTitleBar",
+ WindowUid: "EngineMonitorWindow"),
+ (Xaml: RepositoryLayout.AppPath("Views", "ScriptLogsWindow.xaml"),
+ Source: RepositoryLayout.AppPath("Views",
+ "ScriptLogsWindow.xaml.cs"),
+ TitleBar: "LogsTitleBar", TitleBarUid: "ScriptLogsTitleBar",
+ WindowUid: "ScriptLogsWindow"),
+ (Xaml: RepositoryLayout.AppPath("Views", "ShopWindow.xaml"),
+ Source: RepositoryLayout.AppPath("Views", "ShopWindow.xaml.cs"),
+ TitleBar: "ShopTitleBar", TitleBarUid: "ShopTitleBar",
+ WindowUid: "ShopWindow"),
+ };
+
+ XNamespace x = "http://schemas.microsoft.com/winfx/2006/xaml";
+ foreach (var window in windows) {
+ var source = File.ReadAllText(window.Source);
+ var initializeIndex = source.IndexOf("InitializeComponent();",
+ StringComparison.Ordinal);
+ var titleCopy = Regex.Match(
+ source,
+ $@"Title\s*=\s*{Regex.Escape(window.TitleBar)}\.Title;");
+ Assert.True(
+ initializeIndex >= 0 && titleCopy.Success &&
+ titleCopy.Index > initializeIndex,
+ $"{Path.GetFileName(window.Source)} must copy the localized " +
+ "TitleBar title after InitializeComponent");
+
+ var titleBar =
+ XDocument.Load(window.Xaml)
+ .Descendants()
+ .Single(element => element.Name.LocalName == "TitleBar" &&
+ (string?)element.Attribute(x + "Name") ==
+ window.TitleBar);
+ Assert.Equal(window.TitleBarUid,
+ (string?)titleBar.Attribute(x + "Uid"));
+
+ foreach (var locale in Locales) {
+ var names =
+ Entries(locale).Select(entry => entry.Name).ToArray();
+ Assert.Contains(window.TitleBarUid + ".Title", names);
+ Assert.DoesNotContain(window.WindowUid + ".Title", names);
+ }
+ }
+ }
+
+ [Fact]
+ public void BackendResourceIdentifiersUseDotsNotLegacyUnderscores() {
+ foreach (var locale in Locales) {
+ var legacy =
+ Entries(locale)
+ .Select(entry => entry.Name)
+ .Where(name => name.StartsWith("install_progress_",
+ StringComparison.Ordinal) ||
+ name == "install_ready_to_run" ||
+ name.StartsWith("shop_category_",
+ StringComparison.Ordinal) ||
+ name.StartsWith("shop.category.curseforge_",
+ StringComparison.Ordinal) ||
+ name.StartsWith("shop_home_",
+ StringComparison.Ordinal) ||
+ name == "error_server_running")
+ .ToArray();
+ Assert.Empty(legacy);
+ }
+ }
+
+ [Fact]
+ public void ProgrammaticDottedKeysUseSlashLookupPaths() {
+ var source = File.ReadAllText(
+ RepositoryLayout.AppPath("Services", "LocalizationService.cs"));
+ Assert.Contains("key.Replace('.', '/')", source,
+ StringComparison.Ordinal);
+ Assert.DoesNotContain("key.Replace('.', '_')", source,
+ StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void LiteralProgrammaticResourceKeysExistInEveryLocale() {
+ var referenced =
+ SourceFiles("*.cs")
+ .SelectMany(path => LiteralLocalizerKeyRegex().Matches(
+ File.ReadAllText(path)))
+ .Select(match => match.Groups[1].Value)
+ .Distinct(StringComparer.OrdinalIgnoreCase)
+ .Order(StringComparer.OrdinalIgnoreCase)
+ .ToArray();
+
+ foreach (var locale in Locales) {
+ var names = Entries(locale)
+ .Select(entry => entry.Name)
+ .ToHashSet(StringComparer.OrdinalIgnoreCase);
+ var missing =
+ referenced.Where(key => !names.Contains(key)).ToArray();
+ Assert.True(missing.Length == 0,
+ $"{locale} is missing literal C# resource keys: " +
+ string.Join(", ", missing));
+ }
+ }
+
+ [Fact]
+ public void ResourceArchitectureIsDocumentedForFutureChanges() {
+ var guide = RepositoryLayout.RootPath("docs", "resources.md");
+ Assert.True(File.Exists(guide), "docs/resources.md is required");
+ Assert.Contains(
+ "docs/resources.md",
+ File.ReadAllText(RepositoryLayout.RootPath("AGENTS.md")),
+ StringComparison.OrdinalIgnoreCase);
+ }
+
+ [Fact]
+ public void EveryProgrammaticLocalizationSourceIsDocumented() {
+ var guide =
+ File.ReadAllText(RepositoryLayout.RootPath("docs", "resources.md"));
+ var undocumented =
+ SourceFiles("*.cs")
+ .Where(path => ProgrammaticLocalizerCallRegex().IsMatch(
+ File.ReadAllText(path)))
+ .Select(path =>
+ Path.GetRelativePath(RepositoryLayout.Root, path)
+ .Replace('\\', '/'))
+ .Where(path => !guide.Contains($"`{path}`",
+ StringComparison.Ordinal))
+ .Order(StringComparer.OrdinalIgnoreCase)
+ .ToArray();
+
+ Assert.True(
+ undocumented.Length == 0,
+ "Programmatic localization sources missing from the approved " +
+ "exception inventory: " + string.Join(", ", undocumented));
+ }
+
+ [Fact]
+ public void LocalizedDialogsAreDeclaredInXaml() {
+ var offenders = SourceFiles("*.cs")
+ .Where(path => NewContentDialogRegex().IsMatch(
+ File.ReadAllText(path)))
+ .Select(path => Path.GetRelativePath(
+ RepositoryLayout.Root, path))
+ .ToArray();
+ Assert.Empty(offenders);
+ }
+
+ [Fact]
+ public void EveryContentDialogUsesTheStandardXamlStyle() {
+ var offenders = ContentDialogXamlFiles()
+ .Where(path => (string?)XDocument.Load(path).Root?
+ .Attribute("Style") !=
+ "{StaticResource DefaultContentDialogStyle}")
+ .Select(path => Path.GetFileName(path))
+ .Order(StringComparer.OrdinalIgnoreCase)
+ .ToArray();
+
+ Assert.Empty(offenders);
+ }
+
+ [Fact]
+ public void ContentDialogsOwnTheirSizingPolicy() {
+ var wideDialogs = new HashSet(StringComparer.Ordinal) {
+ "BackupsContentDialog",
+ "BanListContentDialog",
+ "PlayerDataContentDialog",
+ "PlayerInventoryContentDialog",
+ };
+ var dialogSources =
+ ContentDialogXamlFiles()
+ .Select(path => Path.ChangeExtension(path, ".xaml.cs"))
+ .ToHashSet(StringComparer.OrdinalIgnoreCase);
+
+ foreach (var sourcePath in dialogSources) {
+ var dialogName = Path.GetFileNameWithoutExtension(
+ Path.GetFileNameWithoutExtension(sourcePath));
+ var expected = wideDialogs.Contains(dialogName)
+ ? "ContentDialogSizing.Apply(this, " +
+ "useWideLayout: true);"
+ : "ContentDialogSizing.Apply(this);";
+ Assert.Contains(expected, File.ReadAllText(sourcePath),
+ StringComparison.Ordinal);
+ }
+
+ var parentOffenders =
+ SourceFiles("*.cs")
+ .Where(path => !dialogSources.Contains(path))
+ .Where(
+ path => File.ReadAllText(path).Contains(
+ "ContentDialogSizing.Apply(", StringComparison.Ordinal))
+ .Select(path =>
+ Path.GetRelativePath(RepositoryLayout.Root, path))
+ .Order(StringComparer.OrdinalIgnoreCase)
+ .ToArray();
+ Assert.Empty(parentOffenders);
+ }
+
+ [Fact]
+ public void EditServerDialogUsesOneReadOnlyProviderTypeField() {
+ var xaml = File.ReadAllText(
+ RepositoryLayout.AppPath("Views", "ServerDialog.xaml"));
+ Assert.Contains("x:Name=\"EditTypeBox\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("x:Uid=\"EditServerType\"", xaml,
+ StringComparison.Ordinal);
+ Assert.Contains("IsReadOnly=\"True\"", xaml, StringComparison.Ordinal);
+ Assert.DoesNotContain("EditVanillaTypeBox", xaml,
+ StringComparison.Ordinal);
+ Assert.DoesNotContain("EditPaperTypeBox", xaml,
+ StringComparison.Ordinal);
+
+ var source = File.ReadAllText(
+ RepositoryLayout.AppPath("Views", "ServerDialog.xaml.cs"));
+ Assert.Contains("? server.ProviderId", source,
+ StringComparison.Ordinal);
+ Assert.Contains(": server.TypeText;", source, StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void LocalizedTooltipsAreNotInjectedFromCode() {
+ var offenders = SourceFiles("*.cs")
+ .Where(path => File.ReadAllText(path).Contains(
+ "ToolTipService.SetToolTip",
+ StringComparison.Ordinal))
+ .Select(path => Path.GetRelativePath(
+ RepositoryLayout.Root, path))
+ .ToArray();
+ Assert.Empty(offenders);
+ }
+
+ [Fact]
+ public void LocalizedXamlElementsAreNotUsedAsStringCarriers() {
+ var offenders = SourceFiles("*.xaml.cs")
+ .Where(path => XamlTextCarrierRegex().IsMatch(
+ File.ReadAllText(path)))
+ .Select(path => Path.GetRelativePath(
+ RepositoryLayout.Root, path))
+ .ToArray();
+ Assert.Empty(offenders);
+ }
+
+ [Fact]
+ public void PermissionLabelsAreRenderedFromSemanticKindsInXaml() {
+ var controlXaml = File.ReadAllText(
+ RepositoryLayout.AppPath("Controls", "PermissionLabel.xaml"));
+ var expectedUids = new[] {
+ "PermissionLabelNetwork", "PermissionLabelInstall",
+ "PermissionLabelFsServer", "PermissionLabelConsoleRead",
+ "PermissionLabelConsoleWrite", "PermissionLabelServerControl",
+ "PermissionLabelSchedule", "PermissionLabelServerQuery",
+ "PermissionLabelPlayerManage", "PermissionLabelUnknown",
+ };
+ foreach (var uid in expectedUids)
+ Assert.Contains($"x:Uid=\"{uid}\"", controlXaml,
+ StringComparison.Ordinal);
+
+ var scriptCard = File.ReadAllText(
+ RepositoryLayout.AppPath("Controls", "ScriptEntryCard.xaml"));
+ Assert.Contains("Item.Granted", scriptCard, StringComparison.Ordinal);
+ Assert.Contains("controls:PermissionLabel", scriptCard,
+ StringComparison.Ordinal);
+
+ var consentDialog = File.ReadAllText(
+ RepositoryLayout.AppPath("Views", "PermissionConsentDialog.xaml"));
+ Assert.Contains("controls:PermissionLabel", consentDialog,
+ StringComparison.Ordinal);
+ Assert.Contains("Kind=\"{x:Bind Kind}\"", consentDialog,
+ StringComparison.Ordinal);
+
+ var sources =
+ SourceFiles("*.cs")
+ .Select(path => (Path: path, Source: File.ReadAllText(path)))
+ .ToArray();
+ Assert.DoesNotContain(
+ sources, item => item.Source.Contains("PermissionLabels.Label(",
+ StringComparison.Ordinal) ||
+ item.Source.Contains("GrantedSummary",
+ StringComparison.Ordinal));
+ Assert.DoesNotContain("public string Label { get; }",
+ File.ReadAllText(RepositoryLayout.AppPath(
+ "Views", "PermissionConsentDialog.xaml.cs")),
+ StringComparison.Ordinal);
+ }
+
+ [Fact]
+ public void RawExceptionDiagnosticsAreNotDisplayedToUsers() {
+ var forbidden = new[] {
+ @"ex\.Status\.Detail\.Length\s*>\s*0",
+ @"\(\""detail\""\s*,\s*ex\.Message\)",
+ @"ex\.GetType\(\)\.Name",
+ };
+ var offenders =
+ SourceFiles("*.cs")
+ .Where(path =>
+ forbidden.Any(pattern => Regex.IsMatch(
+ File.ReadAllText(path), pattern)))
+ .Select(path =>
+ Path.GetRelativePath(RepositoryLayout.Root, path))
+ .ToArray();
+ Assert.Empty(offenders);
+ }
+
+ private static IEnumerable SourceFiles(string pattern) =>
+ Directory
+ .EnumerateFiles(RepositoryLayout.AppPath(), pattern,
+ SearchOption.AllDirectories)
+ .Where(path => !IsGenerated(path));
+
+ private static IEnumerable ContentDialogXamlFiles() =>
+ Directory
+ .EnumerateFiles(RepositoryLayout.AppPath(), "*.xaml",
+ SearchOption.AllDirectories)
+ .Where(path => !IsGenerated(path))
+ .Where(path => XDocument.Load(path).Root?.Name.LocalName ==
+ "ContentDialog");
+
+ private static bool IsGenerated(string path) =>
+ path.Contains(
+ $"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}",
+ StringComparison.OrdinalIgnoreCase) ||
+ path.Contains(
+ $"{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}",
+ StringComparison.OrdinalIgnoreCase);
+
+ private static IReadOnlyList Entries(string locale) =>
+ ResourceCatalog.Load(RepositoryLayout.AppPath("Strings", locale,
+ "Resources.resw"));
+
+ [GeneratedRegex("x:Uid\\s*=\\s*[\"']([^\"']+)[\"']")]
+ private static partial Regex XamlUidRegex();
+
+ [GeneratedRegex("]*\\bx:Uid\\s*=", RegexOptions.Singleline)]
+ private static partial Regex WindowRootUidRegex();
+
+ [GeneratedRegex("new\\s+ContentDialog\\s*\\{")]
+ private static partial Regex NewContentDialogRegex();
+
+ [GeneratedRegex(
+ "(?:\\b\\w*[Ll]ocalizer|new\\s+LocalizationService\\(\\))\\.Get\\(\\s*[\"']([^\"']+)[\"']",
+ RegexOptions.IgnoreCase)]
+ private static partial Regex LiteralLocalizerKeyRegex();
+
+ [GeneratedRegex(
+ "(?:\\b\\w*[Ll]ocalizer|new\\s+LocalizationService\\(\\))\\.Get\\(",
+ RegexOptions.IgnoreCase)]
+ private static partial Regex ProgrammaticLocalizerCallRegex();
+
+ [GeneratedRegex(
+ "(?:=\\s*|string\\.Format\\()\\w+(?:Text|Label|Header)\\.Text\\b")]
+ private static partial Regex XamlTextCarrierRegex();
+}
diff --git a/app/JustHostMC.App.ResourceTests/ShopLocalizationContractTests.cs b/app/JustHostMC.App.ResourceTests/ShopLocalizationContractTests.cs
new file mode 100644
index 0000000..fe2a7d3
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/ShopLocalizationContractTests.cs
@@ -0,0 +1,14 @@
+using Xunit;
+
+namespace JustHostMC.App.ResourceTests;
+
+public sealed class ShopLocalizationContractTests {
+ [Fact]
+ public void HomeSectionDescriptionUsesCatalogKeyConvention() {
+ var source = File.ReadAllText(
+ RepositoryLayout.AppPath("ViewModels", "ShopViewModel.cs"));
+
+ Assert.Contains("var descriptionKey = $\"{titleKey}_description\";",
+ source);
+ }
+}
diff --git a/app/JustHostMC.App.ResourceTests/UpdateDuplicateComments.ps1 b/app/JustHostMC.App.ResourceTests/UpdateDuplicateComments.ps1
new file mode 100644
index 0000000..d84395c
--- /dev/null
+++ b/app/JustHostMC.App.ResourceTests/UpdateDuplicateComments.ps1
@@ -0,0 +1,52 @@
+[CmdletBinding()]
+param(
+ [string]$RepositoryRoot
+)
+
+if ([string]::IsNullOrWhiteSpace($RepositoryRoot)) {
+ $RepositoryRoot = (Resolve-Path (Join-Path $PSScriptRoot "..\..")).Path
+}
+
+$resourceFiles = @(
+ Join-Path $RepositoryRoot "app\JustHostMC.App\Strings\en-US\Resources.resw"
+ Join-Path $RepositoryRoot "app\JustHostMC.App\Strings\zh-TW\Resources.resw"
+)
+
+foreach ($path in $resourceFiles) {
+ $document = [System.Xml.XmlDocument]::new()
+ $document.PreserveWhitespace = $true
+ $document.Load($path)
+
+ $entries = @($document.DocumentElement.SelectNodes("data"))
+ $groups = $entries |
+ Group-Object { $_.SelectSingleNode("value").InnerText } |
+ Where-Object Count -gt 1
+
+ foreach ($group in $groups) {
+ $canonical = $group.Group[0].GetAttribute("name")
+ foreach ($entry in $group.Group) {
+ if ($null -ne $entry.SelectSingleNode("comment")) {
+ continue
+ }
+
+ $name = $entry.GetAttribute("name")
+ $comment = $document.CreateElement("comment")
+ $comment.InnerText = if ($name -eq $canonical) {
+ "Canonical duplicate value in this locale; semantic identifier: $canonical."
+ } else {
+ "Same visible value as $canonical; kept separate for this property or translation context."
+ }
+ $null = $entry.AppendChild($comment)
+ }
+ }
+
+ $settings = [System.Xml.XmlWriterSettings]::new()
+ $settings.Encoding = [System.Text.UTF8Encoding]::new($false)
+ $settings.Indent = $false
+ $writer = [System.Xml.XmlWriter]::Create($path, $settings)
+ try {
+ $document.Save($writer)
+ } finally {
+ $writer.Dispose()
+ }
+}
diff --git a/app/JustHostMC.App/App.xaml b/app/JustHostMC.App/App.xaml
index b161759..e725109 100644
--- a/app/JustHostMC.App/App.xaml
+++ b/app/JustHostMC.App/App.xaml
@@ -3,7 +3,7 @@
x:Class="JustHostMC.App.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:conv="using:JustHostMC.App.Converters">
+ xmlns:conv="using:CommunityToolkit.WinUI.Converters">
@@ -15,6 +15,15 @@
inner element .Resources, so a converter in e.g.
throws "Cannot find a resource with the given key" at load time.-->
+
+
+
560
960
560
diff --git a/app/JustHostMC.App/Controls/AdaptiveFilterLayout.xaml b/app/JustHostMC.App/Controls/AdaptiveFilterLayout.xaml
index 3a1d41d..8b45e6c 100644
--- a/app/JustHostMC.App/Controls/AdaptiveFilterLayout.xaml
+++ b/app/JustHostMC.App/Controls/AdaptiveFilterLayout.xaml
@@ -46,7 +46,7 @@
VerticalAlignment="Center">
-
+
diff --git a/app/JustHostMC.App/Controls/ConfigEntryEditor.xaml b/app/JustHostMC.App/Controls/ConfigEntryEditor.xaml
index b7757fc..2f6cea3 100644
--- a/app/JustHostMC.App/Controls/ConfigEntryEditor.xaml
+++ b/app/JustHostMC.App/Controls/ConfigEntryEditor.xaml
@@ -38,12 +38,28 @@
TextTrimming="CharacterEllipsis" />
-
+
+
+
+
+
+
+ Visibility="{Binding Entry.HasChoices, ElementName=Root, Converter={StaticResource BoolToVis}, ConverterParameter=True}" />
diff --git a/app/JustHostMC.App/Controls/InventoryItemDetails.xaml b/app/JustHostMC.App/Controls/InventoryItemDetails.xaml
new file mode 100644
index 0000000..eb8045e
--- /dev/null
+++ b/app/JustHostMC.App/Controls/InventoryItemDetails.xaml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/JustHostMC.App/Controls/InventoryItemDetails.xaml.cs b/app/JustHostMC.App/Controls/InventoryItemDetails.xaml.cs
new file mode 100644
index 0000000..112f561
--- /dev/null
+++ b/app/JustHostMC.App/Controls/InventoryItemDetails.xaml.cs
@@ -0,0 +1,11 @@
+using JustHostMC.App.Models;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Controls;
+
+public sealed partial class InventoryItemDetails : UserControl {
+ public InventoryItemDetails(PlayerInventoryItemView item) {
+ InitializeComponent();
+ DataContext = item;
+ }
+}
diff --git a/app/JustHostMC.App/Controls/LogViewer.xaml b/app/JustHostMC.App/Controls/LogViewer.xaml
index be7d1f0..5580709 100644
--- a/app/JustHostMC.App/Controls/LogViewer.xaml
+++ b/app/JustHostMC.App/Controls/LogViewer.xaml
@@ -54,6 +54,7 @@
-
+
+
+
+
+
+
+
+
+
@@ -86,7 +119,13 @@
IsEnabled="{x:Bind StateEnabled(Server.Status), Mode=OneWay}">
-
+
+
+
+
+
+
+
@@ -110,7 +149,18 @@
-
+
+
+
+
+
+
@@ -145,10 +195,40 @@
Grid.Row="0"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}" />
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
+
+
+
+
diff --git a/app/JustHostMC.App/Controls/Server/ServerHeaderPanel.xaml.cs b/app/JustHostMC.App/Controls/Server/ServerHeaderPanel.xaml.cs
index 7952a4b..4ff5c67 100644
--- a/app/JustHostMC.App/Controls/Server/ServerHeaderPanel.xaml.cs
+++ b/app/JustHostMC.App/Controls/Server/ServerHeaderPanel.xaml.cs
@@ -133,14 +133,14 @@ private bool StateEnabled(ServerStatus s) =>
s is ServerStatus.Stopped or ServerStatus.Crashed or
ServerStatus.Running;
- private string PortValueText(int port) => port >
- 0? port.ToString()
- : _localizer.Get("Server_PortAutoValue");
-
- private string MemoryText(int memoryMb) => memoryMb >
- 0? _localizer
- .Get("Server_MemoryValue",
- ("memory",
- memoryMb.ToString()))
- : _localizer.Get("Server_ValueUnknown");
+ private Visibility PositiveValueVisibility(int value) =>
+ value > 0? Visibility.Visible : Visibility.Collapsed;
+
+ private Visibility NonPositiveValueVisibility(int value) =>
+ value > 0? Visibility.Collapsed : Visibility.Visible;
+
+ private string ValueText(int value) => value.ToString();
+
+ private string MemoryText(int memoryMb) =>
+ _localizer.Get("Server_MemoryValue", ("memory", memoryMb.ToString()));
}
diff --git a/app/JustHostMC.App/Controls/Server/ServerModsPanel.xaml b/app/JustHostMC.App/Controls/Server/ServerModsPanel.xaml
index d5a6386..525b838 100644
--- a/app/JustHostMC.App/Controls/Server/ServerModsPanel.xaml
+++ b/app/JustHostMC.App/Controls/Server/ServerModsPanel.xaml
@@ -2,6 +2,7 @@
x:Class="JustHostMC.App.Controls.Server.ServerModsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:converters="using:CommunityToolkit.WinUI.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models="using:JustHostMC.App.Models"
@@ -9,6 +10,9 @@
mc:Ignorable="d">
+
+
+
@@ -216,7 +220,7 @@
x:Uid="ModsUnsupportedHint"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap"
- Visibility="{x:Bind Mods.Supported, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=invert}" />
+ Visibility="{x:Bind Mods.Supported, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=True}" />
+ Visibility="{x:Bind Mods.IsInitialLoading, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=True}" />
+
+
diff --git a/app/JustHostMC.App/Controls/Server/ServerModsPanel.xaml.cs b/app/JustHostMC.App/Controls/Server/ServerModsPanel.xaml.cs
index fd565c9..5e62183 100644
--- a/app/JustHostMC.App/Controls/Server/ServerModsPanel.xaml.cs
+++ b/app/JustHostMC.App/Controls/Server/ServerModsPanel.xaml.cs
@@ -1,5 +1,4 @@
using JustHostMC.App.Models;
-using JustHostMC.App.Services;
using JustHostMC.App.ViewModels;
using JustHostMC.App.Views;
using Microsoft.UI.Xaml;
@@ -9,7 +8,6 @@
namespace JustHostMC.App.Controls.Server;
public sealed partial class ServerModsPanel : UserControl {
- private readonly ILocalizer _localizer = new LocalizationService();
public static readonly DependencyProperty ModsProperty =
DependencyProperty.Register(
nameof(Mods), typeof(ModsViewModel), typeof(ServerModsPanel),
@@ -34,10 +32,6 @@ public ServerModsPanel() {
InitializeComponent();
}
- private string ModsDescription(bool canModify) =>
- canModify ? _localizer.Get("ServerSectionModsHint/Text")
- : _localizer.Get("ModsStoppedHint/Text");
-
private static void OnViewModelChanged(
DependencyObject d, DependencyPropertyChangedEventArgs e) {
var panel = (ServerModsPanel)d;
diff --git a/app/JustHostMC.App/Controls/Server/ServerPerformancePanel.xaml b/app/JustHostMC.App/Controls/Server/ServerPerformancePanel.xaml
index 8d2198a..adc7669 100644
--- a/app/JustHostMC.App/Controls/Server/ServerPerformancePanel.xaml
+++ b/app/JustHostMC.App/Controls/Server/ServerPerformancePanel.xaml
@@ -8,10 +8,7 @@
xmlns:server="using:JustHostMC.App.Controls.Server"
mc:Ignorable="d">
-
+
@@ -94,7 +91,7 @@
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}"
TextWrapping="Wrap"
- Visibility="{x:Bind Metrics.NetworkAvailable, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=invert}" />
+ Visibility="{x:Bind Metrics.NetworkAvailable, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=True}" />
diff --git a/app/JustHostMC.App/Controls/Server/ServerPerformancePanel.xaml.cs b/app/JustHostMC.App/Controls/Server/ServerPerformancePanel.xaml.cs
index f92c99e..f473db9 100644
--- a/app/JustHostMC.App/Controls/Server/ServerPerformancePanel.xaml.cs
+++ b/app/JustHostMC.App/Controls/Server/ServerPerformancePanel.xaml.cs
@@ -1,4 +1,3 @@
-using JustHostMC.App.Services;
using JustHostMC.App.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
@@ -6,8 +5,6 @@
namespace JustHostMC.App.Controls.Server;
public sealed partial class ServerPerformancePanel : UserControl {
- private readonly ILocalizer _localizer = new LocalizationService();
-
public static readonly DependencyProperty MetricsProperty =
DependencyProperty.Register(
nameof(Metrics), typeof(MetricsViewModel),
@@ -23,12 +20,6 @@ public ServerPerformancePanel() {
InitializeComponent();
}
- private string PerformanceTitle() =>
- _localizer.Get("ServerSectionPerformance/Text");
-
- private string PerformanceDescription() =>
- _localizer.Get("ServerSectionPerformanceHint/Text");
-
private static void OnMetricsChanged(DependencyObject d,
DependencyPropertyChangedEventArgs e) {
var panel = (ServerPerformancePanel)d;
diff --git a/app/JustHostMC.App/Controls/Server/ServerPlayersPanel.xaml b/app/JustHostMC.App/Controls/Server/ServerPlayersPanel.xaml
index ef35972..6de0a3b 100644
--- a/app/JustHostMC.App/Controls/Server/ServerPlayersPanel.xaml
+++ b/app/JustHostMC.App/Controls/Server/ServerPlayersPanel.xaml
@@ -8,117 +8,128 @@
xmlns:server="using:JustHostMC.App.Controls.Server"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Margin="0,0,8,0"
+ Background="{ThemeResource ControlFillColorDefaultBrush}"
+ CornerRadius="4">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/JustHostMC.App/Controls/Server/ServerPlayersPanel.xaml.cs b/app/JustHostMC.App/Controls/Server/ServerPlayersPanel.xaml.cs
index 92da0a3..ea37c8b 100644
--- a/app/JustHostMC.App/Controls/Server/ServerPlayersPanel.xaml.cs
+++ b/app/JustHostMC.App/Controls/Server/ServerPlayersPanel.xaml.cs
@@ -56,12 +56,8 @@ private string PlayersHeader(int count) =>
_localizer.Get("Players_Header", ("count", count.ToString()));
private string PlayersDescription(int count) =>
- count == 0 ? _localizer.Get("PlayersEmptyHint/Text")
- : _localizer.Get("ServerSectionPlayersHint/Text");
-
- private Visibility HasNoPlayers(int count) => count == 0
- ? Visibility.Visible
- : Visibility.Collapsed;
+ count == 0 ? PlayersEmptyDescriptionText.Text
+ : PlayersActiveDescriptionText.Text;
private void OnPlayerOpClick(object sender, RoutedEventArgs e) =>
SendPlayerCommand(sender, "op {0}");
@@ -81,11 +77,9 @@ private async Task ShowPlayerDataDialogAsync(object sender) {
if (GetPlayer(sender) is not {} player || Server == null)
return;
- var view = new PlayerDataDialog(Server.Id, player);
- var content = new PlayerDialogBase(player, view);
- var dialog = CreatePlayerDialog(
- _localizer.Get("PlayerDataDialog_ActionName"), player, content);
- view.OnHeaderUpdated = content.UpdateHeader;
+ var dialog = new PlayerDataContentDialog(Server.Id, player) {
+ XamlRoot = XamlRoot,
+ };
await dialog.ShowAsync();
}
@@ -93,32 +87,10 @@ private async Task ShowPlayerInventoryDialogAsync(object sender) {
if (GetPlayer(sender) is not {} player || Server == null)
return;
- var view = new PlayerInventoryDialog(Server.Id, player);
- var content = new PlayerDialogBase(player, view);
- var dialog = CreatePlayerDialog(
- _localizer.Get("PlayerInventoryDialog_ActionName"), player,
- content);
- view.OnHeaderUpdated = content.UpdateHeader;
- await dialog.ShowAsync();
- }
-
- private ContentDialog CreatePlayerDialog(string actionName,
- PlayerItem player,
- PlayerDialogBase content) {
- var dialog = new ContentDialog {
+ var dialog = new PlayerInventoryContentDialog(Server.Id, player) {
XamlRoot = XamlRoot,
- Style = Application.Current
- .Resources["DefaultContentDialogStyle"] as Style,
- Title =
- string.Format(_localizer.Get("PlayerDialogBase_TitleFormat"),
- actionName, player.Name),
- Content = content,
- CloseButtonText =
- _localizer.Get("PlayerDialogBase_CloseButtonText"),
- DefaultButton = ContentDialogButton.Close,
};
- ContentDialogSizing.Apply(dialog, useWideLayout: true);
- return dialog;
+ await dialog.ShowAsync();
}
private async void OnManageBansClick(object sender, RoutedEventArgs e) {
@@ -127,18 +99,9 @@ private async void OnManageBansClick(object sender, RoutedEventArgs e) {
var isStopped =
Server.Status is ServerStatus.Stopped or ServerStatus.Crashed;
- var content = new BanListDialog(Server.Id, isStopped);
- var dialog = new ContentDialog {
+ var dialog = new BanListContentDialog(Server.Id, isStopped) {
XamlRoot = XamlRoot,
- Style = Application.Current
- .Resources["DefaultContentDialogStyle"] as Style,
- Title = _localizer.Get("BanListDialog_Title"),
- Content = content,
- CloseButtonText = _localizer.Get("BanListDialog_CloseButtonText"),
- DefaultButton = ContentDialogButton.Close,
};
- dialog.Opened += async (_, _) => await content.LoadAsync();
- ContentDialogSizing.Apply(dialog, useWideLayout: true);
await dialog.ShowAsync();
}
diff --git a/app/JustHostMC.App/Converters/BoolToVisibilityConverter.cs b/app/JustHostMC.App/Converters/BoolToVisibilityConverter.cs
deleted file mode 100644
index 3ff8ee6..0000000
--- a/app/JustHostMC.App/Converters/BoolToVisibilityConverter.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Data;
-
-namespace JustHostMC.App.Converters;
-
-///
-/// Maps a bool to Visibility. Pass ConverterParameter="invert" to flip it.
-///
-public sealed partial class BoolToVisibilityConverter : IValueConverter {
- public object Convert(object value, Type targetType, object parameter,
- string language) {
- var flag = value switch {
- bool b => b,
- int i => i > 0,
- _ => value is not null,
- };
- if (parameter is string s &&
- string.Equals(s, "invert", StringComparison.OrdinalIgnoreCase))
- flag = !flag;
- return flag ? Visibility.Visible : Visibility.Collapsed;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter,
- string language) =>
- throw new NotSupportedException();
-}
diff --git a/app/JustHostMC.App/JustHostMC.App.csproj b/app/JustHostMC.App/JustHostMC.App.csproj
index 550049b..b6a5988 100644
--- a/app/JustHostMC.App/JustHostMC.App.csproj
+++ b/app/JustHostMC.App/JustHostMC.App.csproj
@@ -68,6 +68,7 @@
+
diff --git a/app/JustHostMC.App/MainWindow.xaml b/app/JustHostMC.App/MainWindow.xaml
index a203010..136c6f7 100644
--- a/app/JustHostMC.App/MainWindow.xaml
+++ b/app/JustHostMC.App/MainWindow.xaml
@@ -21,7 +21,7 @@
+ Visibility="{Binding ElementName=Nav, Path=IsPaneOpen, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=True}">
+
+
+
+
+
+
+
+
+
+
diff --git a/app/JustHostMC.App/MainWindow.xaml.cs b/app/JustHostMC.App/MainWindow.xaml.cs
index 3fd7b37..cb0eac7 100644
--- a/app/JustHostMC.App/MainWindow.xaml.cs
+++ b/app/JustHostMC.App/MainWindow.xaml.cs
@@ -97,6 +97,7 @@ public MainWindow() {
_localizer, DispatcherQueue, App.Current.BackgroundTasks));
InitializeComponent();
+ Title = SimpleTitleBar.Title;
_paneFooterVisibilityCallbackToken =
PaneFooterGrid.RegisterPropertyChangedCallback(
UIElement.VisibilityProperty, OnPaneFooterVisibilityChanged);
@@ -104,7 +105,6 @@ public MainWindow() {
ServerStateTip.ActionButtonClick += (_, _) =>
OnServerStateTipActionButtonClick();
PaneFooterGrid.DataContext = Shell.Main.ProgressService;
- Title = _localizer.Get("AppTitle");
ExtendsContentIntoTitleBar = true;
SetTitleBar(SimpleTitleBar);
InstallMinimumWindowSizeHook();
@@ -188,14 +188,8 @@ private async void OnAppWindowClosing(AppWindow sender,
_closePromptOpen = true;
try {
- var dialog = new ContentDialog {
- XamlRoot = Content.XamlRoot,
- Title = _localizer.Get("CloseBusy_Title"),
- Content = _localizer.Get("CloseBusy_Body"),
- PrimaryButtonText = _localizer.Get("CloseBusy_HideToTray"),
- SecondaryButtonText = _localizer.Get("CloseBusy_CloseAnyway"),
- CloseButtonText = _localizer.Get("Common_Cancel"),
- DefaultButton = ContentDialogButton.Primary,
+ var dialog = new CloseBusyDialog {
+ XamlRoot = Content.XamlRoot,
};
var result = await dialog.ShowAsync();
if (result == ContentDialogResult.Primary)
@@ -381,7 +375,7 @@ private void ShowNextServerTip() {
ServerStateTip.Subtitle = TipSubtitle(notification.Kind);
ServerStateTip.ActionButtonContent =
notification.Kind == ServerTipKind.Installed
- ? _localizer.Get("ServerTeachingTip_StartAction")
+ ? ServerTeachingTipStartActionText.Text
: null;
ServerStateTip.IsOpen = true;
return;
@@ -399,14 +393,13 @@ private string TipTitle(ServerTipNotification notification) =>
},
("server", notification.Server.Name));
- private string TipSubtitle(ServerTipKind kind) =>
- _localizer.Get(kind switch {
- ServerTipKind.Installed => "ServerTeachingTip_InstalledMessage",
- ServerTipKind.Started => "ServerTeachingTip_StartedMessage",
- ServerTipKind.Stopped => "ServerTeachingTip_StoppedMessage",
- ServerTipKind.Crashed => "ServerTeachingTip_CrashedMessage",
- _ => "ServerStatus_Unknown",
- });
+ private string TipSubtitle(ServerTipKind kind) => kind switch {
+ ServerTipKind.Installed => ServerTeachingTipInstalledMessageText.Text,
+ ServerTipKind.Started => ServerTeachingTipStartedMessageText.Text,
+ ServerTipKind.Stopped => ServerTeachingTipStoppedMessageText.Text,
+ ServerTipKind.Crashed => ServerTeachingTipCrashedMessageText.Text,
+ _ => UnknownServerStatusText.Text,
+ };
private void OnServerStateTipClosed() {
var closed = _currentServerTip;
@@ -494,28 +487,13 @@ private void OnOpenServerRequested(ServerItem server) {
}
private async System.Threading.Tasks.Task ShowCreateServerDialogAsync() {
- var localizer = new LocalizationService();
- var content = new ServerDialog(Shell.Main, ServerDialogMode.Create);
- var dialog = new ContentDialog {
+ var dialog = new CreateServerDialog(Shell.Main) {
XamlRoot = Content.XamlRoot,
- Style = Application.Current
- .Resources["DefaultContentDialogStyle"] as Style,
- Title = localizer.Get("CreateServerDialog_Title"),
- Content = content,
- PrimaryButtonText =
- localizer.Get("CreateServerDialog_PrimaryButtonText"),
- CloseButtonText =
- localizer.Get("CreateServerDialog_CloseButtonText"),
- DefaultButton = ContentDialogButton.Primary,
- IsPrimaryButtonEnabled = content.CanSubmit,
};
- content.CanSubmitChanged += (_, _) => dialog.IsPrimaryButtonEnabled =
- content.CanSubmit;
- ContentDialogSizing.Apply(dialog);
if (await dialog.ShowAsync() != ContentDialogResult.Primary)
return;
- if (content.BuildCreateRequest() is {} request)
+ if (dialog.BuildCreateRequest() is {} request)
await Shell.Main.InstallServerAsync(request);
}
}
diff --git a/app/JustHostMC.App/Models/BanEntryItem.cs b/app/JustHostMC.App/Models/BanEntryItem.cs
index 4962ae6..67cd83a 100644
--- a/app/JustHostMC.App/Models/BanEntryItem.cs
+++ b/app/JustHostMC.App/Models/BanEntryItem.cs
@@ -1,4 +1,3 @@
-using JustHostMC.App.Services;
using McManager.Grpc;
namespace JustHostMC.App.Models;
@@ -6,27 +5,15 @@ namespace JustHostMC.App.Models;
/// Bindable ban-list row from banned-players.json or
/// banned-ips.json.
public sealed class BanEntryItem {
- public BanEntryItem(BanEntry entry, ILocalizer localizer) {
- Type = entry.Type;
- Target = entry.Target;
- Name = entry.Name;
- Uuid = entry.Uuid;
- Created = entry.Created;
- Source = entry.Source;
- Expires = entry.Expires;
- Reason = entry.Reason;
- TypeText =
- localizer.Get(Type == BanListType.IpBans ? "BanList_TypeIp"
- : "BanList_TypePlayer");
- if (string.IsNullOrWhiteSpace(TypeText))
- TypeText = Type == BanListType.IpBans ? "IP" : "Player";
- ReasonText = string.IsNullOrWhiteSpace(Reason)
- ? localizer.Get("BanList_NoReason")
- : Reason;
- if (string.IsNullOrWhiteSpace(ReasonText))
- ReasonText = string.IsNullOrWhiteSpace(Reason)
- ? "No reason provided"
- : Reason;
+ public BanEntryItem(BanEntry entry) {
+ Type = entry.Type;
+ Target = entry.Target;
+ Name = entry.Name;
+ Uuid = entry.Uuid;
+ Created = entry.Created;
+ Source = entry.Source;
+ Expires = entry.Expires;
+ Reason = entry.Reason;
IdentityText = !string.IsNullOrWhiteSpace(Uuid) ? Uuid : Source;
CreatedText = string.IsNullOrWhiteSpace(Created) ? Expires : Created;
}
@@ -39,8 +26,8 @@ public BanEntryItem(BanEntry entry, ILocalizer localizer) {
public string Source { get; }
public string Expires { get; }
public string Reason { get; }
- public string TypeText { get; }
- public string ReasonText { get; }
+ public bool IsIpBan => Type == BanListType.IpBans;
+ public bool HasReason => !string.IsNullOrWhiteSpace(Reason);
public string IdentityText { get; }
public string CreatedText { get; }
}
diff --git a/app/JustHostMC.App/Models/ConfigEntryItem.cs b/app/JustHostMC.App/Models/ConfigEntryItem.cs
index b5d1a90..c140256 100644
--- a/app/JustHostMC.App/Models/ConfigEntryItem.cs
+++ b/app/JustHostMC.App/Models/ConfigEntryItem.cs
@@ -17,7 +17,6 @@ public ConfigEntryItem(ConfigEntry entry, ILocalizer localizer) {
_originalValue = entry.Value;
Value = entry.Value;
Type = entry.Type;
- TypeText = ResolveTypeText(localizer, entry.Type);
Supported = entry.Supported;
SinceVersion = entry.SinceVersion;
Description = entry.Description;
@@ -27,7 +26,10 @@ public ConfigEntryItem(ConfigEntry entry, ILocalizer localizer) {
public string Key { get; }
public string DisplayName { get; }
public ConfigValueType Type { get; }
- public string TypeText { get; }
+ public bool IsBoolean => Type == ConfigValueType.ConfigBoolean;
+ public bool IsInteger => Type == ConfigValueType.ConfigInteger;
+ public bool IsChoice => Type == ConfigValueType.ConfigEnum;
+ public bool IsText => !IsBoolean && !IsInteger && !IsChoice;
public bool Supported { get; }
public string SinceVersion { get; }
public string Description { get; }
@@ -56,25 +58,6 @@ private static string ResolveDisplayName(ILocalizer localizer, string key) {
: localized;
}
- private static string ResolveTypeText(ILocalizer localizer,
- ConfigValueType type) {
- var key = type switch {
- ConfigValueType.ConfigBoolean => "ConfigType_Boolean",
- ConfigValueType.ConfigInteger => "ConfigType_Integer",
- ConfigValueType.ConfigEnum => "ConfigType_Choice",
- _ => "ConfigType_Text",
- };
- var localized = SafeGet(localizer, key);
- if (!string.IsNullOrWhiteSpace(localized))
- return localized;
- return type switch {
- ConfigValueType.ConfigBoolean => "Boolean",
- ConfigValueType.ConfigInteger => "Integer",
- ConfigValueType.ConfigEnum => "Choice",
- _ => "Text",
- };
- }
-
private static string SafeGet(ILocalizer localizer, string key) {
try {
return localizer.Get(key);
diff --git a/app/JustHostMC.App/Models/ModFileItem.cs b/app/JustHostMC.App/Models/ModFileItem.cs
index 17478c9..8b1acc6 100644
--- a/app/JustHostMC.App/Models/ModFileItem.cs
+++ b/app/JustHostMC.App/Models/ModFileItem.cs
@@ -16,8 +16,7 @@ public ModFileItem(string name, long sizeBytes, ModMetadata? metadata,
SizeBytes = sizeBytes;
_icon = icon;
if (metadata is not null && metadata.ParseError.Length > 0) {
- ParseError = localizer.Get("Mods_ParseFailed",
- ("error", metadata.ParseError));
+ ParseError = localizer.Get("Mods_ParseFailed");
}
if (metadata is { Parsed : true }) {
HasMetadata = true;
diff --git a/app/JustHostMC.App/Models/ParserItem.cs b/app/JustHostMC.App/Models/ParserItem.cs
index 9e83616..ee72471 100644
--- a/app/JustHostMC.App/Models/ParserItem.cs
+++ b/app/JustHostMC.App/Models/ParserItem.cs
@@ -9,7 +9,7 @@ public sealed class ParserItem : ScriptEntryItem {
public ParserItem(ParserInfo info, ILocalizer localizer)
: base(info.Id, info.Name, info.Author, info.Version,
ComposeDescription(info, localizer), info.Permissions,
- info.Granted, localizer) {
+ info.Granted) {
Builtin = info.Builtin;
}
diff --git a/app/JustHostMC.App/Models/PermissionLabels.cs b/app/JustHostMC.App/Models/PermissionLabels.cs
deleted file mode 100644
index 6dcc62d..0000000
--- a/app/JustHostMC.App/Models/PermissionLabels.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using JustHostMC.App.Services;
-using McManager.Grpc;
-
-namespace JustHostMC.App.Models;
-
-/// Maps values to localization keys for
-/// their human-readable labels (shown in the consent dialog and script
-/// cards).
-public static class PermissionLabels {
- public static string LabelKey(PermissionKind kind) => kind switch {
- PermissionKind.PermissionNetwork => "Permission_Network",
- PermissionKind.PermissionInstall => "Permission_Install",
- PermissionKind.PermissionFsServer => "Permission_FsServer",
- PermissionKind.PermissionConsoleRead => "Permission_ConsoleRead",
- PermissionKind.PermissionConsoleWrite => "Permission_ConsoleWrite",
- PermissionKind.PermissionServerControl => "Permission_ServerControl",
- PermissionKind.PermissionSchedule => "Permission_Schedule",
- PermissionKind.PermissionServerQuery => "Permission_ServerQuery",
- PermissionKind.PermissionPlayerManage => "Permission_PlayerManage",
- _ => "Permission_Unknown",
- };
-
- /// Resolves the localized label for a permission kind.
- public static string Label(PermissionKind kind, ILocalizer localizer) =>
- localizer.Get(LabelKey(kind));
-}
diff --git a/app/JustHostMC.App/Models/PlayerInventoryItemView.cs b/app/JustHostMC.App/Models/PlayerInventoryItemView.cs
index ed5dbfd..87fa8d0 100644
--- a/app/JustHostMC.App/Models/PlayerInventoryItemView.cs
+++ b/app/JustHostMC.App/Models/PlayerInventoryItemView.cs
@@ -48,6 +48,11 @@ private PlayerInventoryItemView(PlayerInventoryItem item) {
public string CountText => ShowCount ? Count.ToString() : "";
public string Tooltip =>
HasItem ? $"{StyledName}\n{ItemId}\n{SlotName}" : SlotName;
+ public IReadOnlyList NbtSections => Nbt.Sections;
+ public string FormattedNbt => Nbt.FormattedJson;
+ public bool HasNbtParseFailure => Nbt.ParseError is not null;
+ public bool HasNoNbtDetails =>
+ Nbt.Sections.Count == 0 && !HasNbtParseFailure;
public static PlayerInventoryItemView Empty(int slot, string slotName) =>
new(slot, slotName);
diff --git a/app/JustHostMC.App/Models/ProviderItem.cs b/app/JustHostMC.App/Models/ProviderItem.cs
index 4dfff4a..6939452 100644
--- a/app/JustHostMC.App/Models/ProviderItem.cs
+++ b/app/JustHostMC.App/Models/ProviderItem.cs
@@ -8,7 +8,7 @@ namespace JustHostMC.App.Models;
public sealed class ProviderItem : ScriptEntryItem {
public ProviderItem(ProviderInfo info, ILocalizer localizer)
: base(info.Id, info.Name, info.Author, info.Version, info.Description,
- info.Permissions, info.Granted, localizer) {
+ info.Permissions, info.Granted) {
Builtin = info.Builtin;
}
diff --git a/app/JustHostMC.App/Models/ScriptEntryItem.cs b/app/JustHostMC.App/Models/ScriptEntryItem.cs
index 9dead18..20fef2f 100644
--- a/app/JustHostMC.App/Models/ScriptEntryItem.cs
+++ b/app/JustHostMC.App/Models/ScriptEntryItem.cs
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
-using JustHostMC.App.Services;
using McManager.Grpc;
namespace JustHostMC.App.Models;
@@ -10,18 +9,14 @@ public abstract class ScriptEntryItem {
protected ScriptEntryItem(string id, string name, string author,
string version, string description,
IEnumerable permissions,
- IEnumerable granted,
- ILocalizer localizer) {
- Id = id;
- Name = string.IsNullOrEmpty(name) ? id : name;
- Author = author;
- Version = version;
- Description = description;
- Permissions = permissions.ToList();
- Granted = granted.ToList();
- GrantedSummary = string.Join(
- ", ",
- Granted.Select(kind => PermissionLabels.Label(kind, localizer)));
+ IEnumerable granted) {
+ Id = id;
+ Name = string.IsNullOrEmpty(name) ? id : name;
+ Author = author;
+ Version = version;
+ Description = description;
+ Permissions = permissions.ToList();
+ Granted = granted.ToList();
}
public string Id { get; }
@@ -31,7 +26,6 @@ protected ScriptEntryItem(string id, string name, string author,
public string Description { get; }
public IReadOnlyList Permissions { get; }
public IReadOnlyList Granted { get; }
- public string GrantedSummary { get; }
public virtual bool IsBuiltIn => false;
public virtual bool CanRemove => true;
diff --git a/app/JustHostMC.App/Models/ScriptItem.cs b/app/JustHostMC.App/Models/ScriptItem.cs
index 960098e..313a3dc 100644
--- a/app/JustHostMC.App/Models/ScriptItem.cs
+++ b/app/JustHostMC.App/Models/ScriptItem.cs
@@ -8,7 +8,7 @@ namespace JustHostMC.App.Models;
public sealed class ScriptItem : ScriptEntryItem {
public ScriptItem(ScriptInfo info, ILocalizer localizer)
: base(info.Id, info.Name, info.Author, info.Version, info.Description,
- info.Permissions, info.Granted, localizer) {
+ info.Permissions, info.Granted) {
Enabled = info.Enabled;
}
diff --git a/app/JustHostMC.App/Models/ServerItem.cs b/app/JustHostMC.App/Models/ServerItem.cs
index 8eab55b..3d3d7aa 100644
--- a/app/JustHostMC.App/Models/ServerItem.cs
+++ b/app/JustHostMC.App/Models/ServerItem.cs
@@ -29,30 +29,43 @@ public partial string McVersion {
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(TypeText))]
+ [NotifyPropertyChangedFor(nameof(HasTypeText))]
+ [NotifyPropertyChangedFor(nameof(IsVanillaProvider))]
+ [NotifyPropertyChangedFor(nameof(IsPaperProvider))]
+ [NotifyPropertyChangedFor(nameof(IsSpigotProvider))]
+ [NotifyPropertyChangedFor(nameof(IsForgeProvider))]
+ [NotifyPropertyChangedFor(nameof(IsNeoForgeProvider))]
+ [NotifyPropertyChangedFor(nameof(IsFabricProvider))]
+ [NotifyPropertyChangedFor(nameof(IsTypeUnknown))]
public partial string ProviderId {
get; private set;
} = "";
[ObservableProperty]
- [NotifyPropertyChangedFor(nameof(StatusText))]
[NotifyPropertyChangedFor(nameof(CanStart))]
[NotifyPropertyChangedFor(nameof(CanStop))]
[NotifyPropertyChangedFor(nameof(CanToggleState))]
[NotifyPropertyChangedFor(nameof(IsTransitional))]
[NotifyPropertyChangedFor(nameof(IsRunning))]
+ [NotifyPropertyChangedFor(nameof(IsStopped))]
+ [NotifyPropertyChangedFor(nameof(IsInstalling))]
+ [NotifyPropertyChangedFor(nameof(IsStarting))]
+ [NotifyPropertyChangedFor(nameof(IsStopping))]
+ [NotifyPropertyChangedFor(nameof(IsCrashed))]
+ [NotifyPropertyChangedFor(nameof(IsStatusUnknown))]
+ [NotifyPropertyChangedFor(nameof(ShowStartAction))]
[NotifyPropertyChangedFor(nameof(CanEditLaunchSettings))]
- [NotifyPropertyChangedFor(nameof(StateActionText))]
[NotifyPropertyChangedFor(nameof(StateActionGlyph))]
[NotifyPropertyChangedFor(nameof(NavigationAutomationName))]
[NotifyPropertyChangedFor(nameof(NavigationStatusBrush))]
[NotifyPropertyChangedFor(nameof(IsIncompleteInstallation))]
- [NotifyPropertyChangedFor(nameof(DeleteActionText))]
public partial ServerStatus Status {
get; private set;
}
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(EndpointText))]
+ [NotifyPropertyChangedFor(nameof(HasEndpoint))]
public partial int Port {
get; private set;
}
@@ -103,7 +116,10 @@ private void OnProvidersLoaded() {
if (_providers is not null)
_providers.Loaded -= OnProvidersLoaded;
- void Refresh() => OnPropertyChanged(nameof(TypeText));
+ void Refresh() {
+ OnPropertyChanged(nameof(TypeText));
+ OnPropertyChanged(nameof(HasTypeText));
+ }
if (_dispatcher is not null)
_dispatcher.TryEnqueue(Refresh);
else
@@ -113,7 +129,7 @@ private void OnProvidersLoaded() {
public string Id { get; }
public ServerProgressTracker ProgressTracker { get; set; } = null!;
- public string StatusText => _localizer.Get(Status switch {
+ private string LocalizedStatusText => _localizer.Get(Status switch {
ServerStatus.Running => "ServerStatus_Running",
ServerStatus.Stopped => "ServerStatus_Stopped",
ServerStatus.Installing => "ServerStatus_Installing",
@@ -138,53 +154,58 @@ ServerStatus.Starting or ServerStatus.Stopping or
public string NavigationAutomationName => _localizer.Get(
HasUnreadStateChange ? "ServerNav_StateChangedAutomationName"
: "ServerNav_AutomationName",
- ("name", Name), ("status", StatusText));
+ ("name", Name), ("status", LocalizedStatusText));
- // Prefer the live provider list's friendly name; fall back to the built-in
- // id→localized-name map, then to the raw id.
+ // Custom provider names are runtime script data. Built-in and unknown
+ // provider labels are rendered by x:Uid-backed branches in each view.
public string TypeText {
get {
+ if (IsBuiltInProvider)
+ return "";
if (_providers?.NameFor(ProviderId) is { Length : > 0 } name)
return name;
- return ProviderId switch {
- "vanilla" => _localizer.Get("ServerType_Vanilla"),
- "paper" => _localizer.Get("ServerType_Paper"),
- "spigot" => _localizer.Get("ServerType_Spigot"),
- "forge" => _localizer.Get("ServerType_Forge"),
- "neoforge" => _localizer.Get("ServerType_NeoForge"),
- "fabric" => _localizer.Get("ServerType_Fabric"),
- "" => _localizer.Get("ServerType_Unknown"),
- _ => ProviderId,
- };
+ return ProviderId;
}
}
+ public bool HasTypeText => !string.IsNullOrWhiteSpace(TypeText);
+ public bool IsVanillaProvider => ProviderId == "vanilla";
+ public bool IsPaperProvider => ProviderId == "paper";
+ public bool IsSpigotProvider => ProviderId == "spigot";
+ public bool IsForgeProvider => ProviderId == "forge";
+ public bool IsNeoForgeProvider => ProviderId == "neoforge";
+ public bool IsFabricProvider => ProviderId == "fabric";
+ public bool IsTypeUnknown => string.IsNullOrWhiteSpace(ProviderId);
+ private bool IsBuiltInProvider => IsVanillaProvider || IsPaperProvider ||
+ IsSpigotProvider || IsForgeProvider ||
+ IsNeoForgeProvider || IsFabricProvider;
public bool CanStart =>
Status is ServerStatus.Stopped or ServerStatus.Crashed;
public bool CanStop =>
Status is ServerStatus.Running or ServerStatus.Starting;
- public bool CanToggleState => CanStart || CanStop;
- public bool IsRunning => Status is ServerStatus.Running;
+ public bool CanToggleState => CanStart || CanStop;
+ public bool IsRunning => Status is ServerStatus.Running;
+ public bool IsStopped => Status is ServerStatus.Stopped;
+ public bool IsInstalling => Status is ServerStatus.Installing;
+ public bool IsStarting => Status is ServerStatus.Starting;
+ public bool IsStopping => Status is ServerStatus.Stopping;
+ public bool IsCrashed => Status is ServerStatus.Crashed;
+ public bool IsStatusUnknown => Status is not(
+ ServerStatus.Running or ServerStatus.Stopped or
+ ServerStatus.Installing or ServerStatus.Starting or
+ ServerStatus.Stopping or ServerStatus.Crashed);
+ public bool ShowStartAction => Status is not(
+ ServerStatus.Running or ServerStatus.Installing or
+ ServerStatus.Starting or ServerStatus.Stopping);
public bool IsIncompleteInstallation => Status is ServerStatus.Installing;
- public string DeleteActionText =>
- _localizer.Get(IsIncompleteInstallation ? "ServerInstallRemove_Action"
- : "ServerDelete_Action");
public bool CanEditLaunchSettings =>
Status is ServerStatus.Stopped or ServerStatus.Crashed;
- public string EndpointText => Port > 0? ConnectHost.Value
- is { Length : > 0 } host
- ? $"{host}:{Port}"
- : _localizer
- .Get("Server_PortLabel",
- ("port", Port.ToString()))
- : _localizer.Get("Server_PortAutoValue");
- public string StateActionText => _localizer.Get(Status switch {
- ServerStatus.Running => "ServerState_Stop",
- ServerStatus.Starting => "ServerState_Starting",
- ServerStatus.Stopping => "ServerState_Stopping",
- ServerStatus.Installing => "ServerState_Installing",
- _ => "ServerState_Start",
- });
+ public bool HasEndpoint => Port > 0;
+ public string EndpointText =>
+ Port <= 0 ? ""
+ : ConnectHost.Value is { Length : > 0 } host
+ ? $"{host}:{Port}"
+ : _localizer.Get("Server_PortLabel", ("port", Port.ToString()));
public string StateActionGlyph => Status switch {
ServerStatus.Running => "\uE71A",
ServerStatus.Starting or ServerStatus.Stopping or
diff --git a/app/JustHostMC.App/Services/ILocalizer.cs b/app/JustHostMC.App/Services/ILocalizer.cs
index a05a363..420a12a 100644
--- a/app/JustHostMC.App/Services/ILocalizer.cs
+++ b/app/JustHostMC.App/Services/ILocalizer.cs
@@ -1,12 +1,13 @@
namespace JustHostMC.App.Services;
///
-/// Resolves localization keys to user-language strings. Backend keys
-/// ("namespace.method.type") and resource keys both resolve here, keeping all
-/// user-visible text in resource files (PROMPT §14).
+/// Resolves runtime-only localization keys to user-language strings. Static UI
+/// text belongs in XAML via x:Uid; this interface is reserved for backend keys,
+/// translator-controlled formats, error mappings, and non-XAML OS surfaces.
///
public interface ILocalizer {
- /// Resolves a key to the current language's string.
+ /// Resolves a dotted key to the current language's
+ /// string.
string Get(string key);
/// Resolves a key and substitutes {name}
diff --git a/app/JustHostMC.App/Services/LocalizationService.cs b/app/JustHostMC.App/Services/LocalizationService.cs
index c9c68a8..713cf74 100644
--- a/app/JustHostMC.App/Services/LocalizationService.cs
+++ b/app/JustHostMC.App/Services/LocalizationService.cs
@@ -1,3 +1,4 @@
+using System.Diagnostics;
using Microsoft.Windows.ApplicationModel.Resources;
namespace JustHostMC.App.Services;
@@ -12,8 +13,14 @@ public sealed class LocalizationService : ILocalizer {
public string Get(string key) {
try {
- return _loader.GetString(NormalizeKey(key));
- } catch {
+ var value = _loader.GetString(NormalizeKey(key));
+ if (!string.IsNullOrEmpty(value))
+ return value;
+ Debug.WriteLine($"Missing localization resource: {key}");
+ return key;
+ } catch (Exception ex) {
+ Debug.WriteLine(
+ $"Failed to load localization resource '{key}': {ex}");
return key;
}
}
@@ -22,7 +29,9 @@ public string Get(string key, params(string Name, string Value)[] args) {
string format;
try {
format = _loader.GetString(NormalizeKey(key));
- } catch {
+ } catch (Exception ex) {
+ Debug.WriteLine(
+ $"Failed to load localization resource '{key}': {ex}");
format = key;
}
foreach (var (name, value) in args)
@@ -30,8 +39,8 @@ public string Get(string key, params(string Name, string Value)[] args) {
return format;
}
- // Backend keys use '.' separators ("install.progress.downloading_server").
- // Resource names are flat (underscored) to avoid the resw/PRI treating dots
- // as the x:Uid "Uid.Property" convention, so map '.' -> '_'.
- private static string NormalizeKey(string key) => key.Replace('.', '_');
+ // MRT Core exposes segmented resource identifiers as slash-separated paths.
+ // x:Uid property identifiers are resolved by XAML and never pass through
+ // this programmatic lookup path.
+ internal static string NormalizeKey(string key) => key.Replace('.', '/');
}
diff --git a/app/JustHostMC.App/Services/MinecraftItemNbtParser.cs b/app/JustHostMC.App/Services/MinecraftItemNbtParser.cs
index 0f18081..54da577 100644
--- a/app/JustHostMC.App/Services/MinecraftItemNbtParser.cs
+++ b/app/JustHostMC.App/Services/MinecraftItemNbtParser.cs
@@ -6,7 +6,7 @@
namespace JustHostMC.App.Services;
-internal enum NbtDetailKind {
+public enum NbtDetailKind {
Default,
Lore,
Enchantment,
@@ -15,10 +15,10 @@ internal enum NbtDetailKind {
Code,
}
-internal sealed record NbtDetailEntry(
- string Label, string Value, NbtDetailKind Kind = NbtDetailKind.Default);
-internal sealed record NbtDetailSection(string Title,
- IReadOnlyList Entries);
+public sealed record NbtDetailEntry(string Label, string Value,
+ NbtDetailKind Kind = NbtDetailKind.Default);
+public sealed record NbtDetailSection(string Title,
+ IReadOnlyList Entries);
internal sealed record MinecraftItemNbtPresentation(
string? DisplayName, IReadOnlyList Sections,
diff --git a/app/JustHostMC.App/Strings/en-US/Resources.resw b/app/JustHostMC.App/Strings/en-US/Resources.resw
index 8f176cf..12b898d 100644
--- a/app/JustHostMC.App/Strings/en-US/Resources.resw
+++ b/app/JustHostMC.App/Strings/en-US/Resources.resw
@@ -60,88 +60,73 @@
- JustHostMC
- JustHostMC — Minecraft Server Manager
+ JustHostMCCanonical duplicate value in this locale; semantic identifier: AppDisplayName.
+ JustHostMC — Minecraft Server ManagerCanonical duplicate value in this locale; semantic identifier: AppDescription.
Muisnow Devs
- JustHostMC
- JustHostMC ??Minecraft Server Manager
- Refresh
- Create server
- No servers yet. Select ?reate server??to add one.
- Filters
+ JustHostMCSame visible value as AppDisplayName; kept separate for this property or translation context.
+ JustHostMC — Minecraft Server ManagerSame visible value as AppDescription; kept separate for this property or translation context.
+ Refresh
+ Create serverCanonical duplicate value in this locale; semantic identifier: CreateServerButtonLabel.Text.
+ No servers yet. Select “Create server” to add one.
+ FiltersCanonical duplicate value in this locale; semantic identifier: AdaptiveFilterLayoutFilterButtonLabel.Text.
Servers run on this PC
Without Docker, servers run directly on your computer (not in a container). A per-server memory limit still applies.
-
- Connecting to the engine
- Engine connected.
- Could not reach the engine.
-
- Start
- Stop
- Delete
- Running
- Stopped
- Installing
- Starting
- Stopping
- Crashed
- Unknown
+ StartCanonical duplicate value in this locale; semantic identifier: ServerStartButton.Content.
+ StopCanonical duplicate value in this locale; semantic identifier: ServerStopButton.Content.
+ DeleteCanonical duplicate value in this locale; semantic identifier: ServerDeleteButton.Content.
+ RunningCanonical duplicate value in this locale; semantic identifier: ServerStatus_Running.
+ StoppedCanonical duplicate value in this locale; semantic identifier: ServerStatus_Stopped.
+ InstallingCanonical duplicate value in this locale; semantic identifier: ServerStatus_Installing.
+ StartingCanonical duplicate value in this locale; semantic identifier: ServerStatus_Starting.
+ StoppingCanonical duplicate value in this locale; semantic identifier: ServerStatus_Stopping.
+ CrashedCanonical duplicate value in this locale; semantic identifier: ServerStatus_Crashed.
+ UnknownCanonical duplicate value in this locale; semantic identifier: ServerStatus_Unknown.
{name}, {status}
{name}, state changed to {status}
- Vanilla
- Paper
- Spigot
- Forge
- NeoForge
- Fabric
- Unknown
- Console
- Console
- Close
+ ConsoleCanonical duplicate value in this locale; semantic identifier: ServerConsoleButton.Content.
+ ConsoleSame visible value as ServerConsoleButton.Content; kept separate for this property or translation context.
+ CloseCanonical duplicate value in this locale; semantic identifier: ConsoleDialog.CloseButtonText.
Type a command and press Enter
- Send
+ SendCanonical duplicate value in this locale; semantic identifier: ConsoleSendButton.Content.
Console output
- Send
+ SendSame visible value as ConsoleSendButton.Content; kept separate for this property or translation context.
Send command
- Create server
- Create
- Cancel
- Name
- My server
- My Server
- Type
- Vanilla
+ NameCanonical duplicate value in this locale; semantic identifier: CreateServerName.Header.
+ My serverCanonical duplicate value in this locale; semantic identifier: CreateServerName.PlaceholderText.
+ My ServerSame visible value as CreateServerName.PlaceholderText; kept separate for this property or translation context.
+ TypeCanonical duplicate value in this locale; semantic identifier: CreateServerType.Header.
+ VanillaSame visible value as ServerTypeVanillaText.Text; kept separate for this property or translation context.
Versions are fetched from the internet.
- Version
+ VersionCanonical duplicate value in this locale; semantic identifier: CreateServerVersion.Header.
Could not load versions
Check your internet connection and try selecting the server type again.
Advanced settings
Memory (MB)
Maximum heap memory for the Java process. 2048 MB is recommended for most servers.
- Port
+ PortCanonical duplicate value in this locale; semantic identifier: CreateServerPort.Header.
Leave at 0 to auto-assign a free port. Use 25565 for the Minecraft default.
Creating server
- Dismiss
- Preparing
- Resolving version
- Downloading server
- Downloading Java runtime
- Extracting Java runtime
- Downloading installer
- Running installer
- Done.
+ DismissCanonical duplicate value in this locale; semantic identifier: InstallDismissButton.Content.
+ Preparing
+ Resolving version
+ Downloading server
+ Downloading Java runtime
+ Extracting Java runtime
+ Downloading installer
+ Running installer
+ Done.
That version could not be found.
@@ -150,33 +135,26 @@
Installation failed. See the log for details.
The backup operation failed. See the log for details.
That backup could not be found.
- Stop the server before restoring a backup.
+ Stop the server before restoring a backup.Canonical duplicate value in this locale; semantic identifier: error.server_running.
- Backups
- Close
- Create backup
- Create backup
- Safe online (pause saves)
- Safe online (pause saves)
+ BackupsCanonical duplicate value in this locale; semantic identifier: ServerBackupsButton.Content.
+ Create backupCanonical duplicate value in this locale; semantic identifier: BackupCreateButton.Content.
+ Create backupSame visible value as BackupCreateButton.Content; kept separate for this property or translation context.
+ Safe online (pause saves)Canonical duplicate value in this locale; semantic identifier: BackupSafeOnline.Content.
+ Safe online (pause saves)Same visible value as BackupSafeOnline.Content; kept separate for this property or translation context.
No backups yet. Select Create backup to make one.
- Restore
+ RestoreCanonical duplicate value in this locale; semantic identifier: BackupRestoreButton.Content.
Restore this backup? It replaces the server's current world and files. The server must be stopped.
- Restore
- Delete
+ RestoreSame visible value as BackupRestoreButton.Content; kept separate for this property or translation context.
+ DeleteSame visible value as ServerDeleteButton.Content; kept separate for this property or translation context.
Delete this backup permanently?
- Delete
- Creating backup
- Backup created.
- Restoring backup
- Backup restored.
- Deleting backup
- Backup deleted.
+ DeleteSame visible value as ServerDeleteButton.Content; kept separate for this property or translation context.
- Settings
- Settings
- Close
+ SettingsCanonical duplicate value in this locale; semantic identifier: SettingsButton.Content.
+ SettingsSame visible value as SettingsButton.Content; kept separate for this property or translation context.
+ CloseSame visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
Engine & Servers
Integrations
Application
@@ -184,37 +162,27 @@
Install and console logs are pruned automatically. Use 0 for no limit.
Keep logs for (days)
Total size cap (MB)
- Save
+ SaveCanonical duplicate value in this locale; semantic identifier: SettingsSaveButton.Content.
Purge now
Engine diagnostics
Inspect the engine process's live standard output, error output, and input-watchdog lifecycle.
Open engine monitor
- Settings saved.
- Could not save settings.
- Could not load settings.
Purged {count} file(s), freed {size}.
- Could not purge logs.
- Remove all data
+ Remove all dataCanonical duplicate value in this locale; semantic identifier: SettingsDataHeader.Text.
Stops all servers and permanently deletes every server, backup, log, and the downloaded Java runtime. This cannot be undone.
- Remove all data
+ Remove all dataSame visible value as SettingsDataHeader.Text; kept separate for this property or translation context.
Delete all servers, backups, logs, and the Java runtime? This cannot be undone.
Remove everything
- Removing all data
- All data removed.
Incomplete server installations
{count} incomplete installation(s) can be removed.
Remove incomplete installations
- Removing incomplete server installations…
Removed {count} incomplete installation(s).
- Failed to remove incomplete server installations.
-Could not remove all data.
-Stop
-Filters
+StopSame visible value as ServerStopButton.Content; kept separate for this property or translation context.
+FiltersSame visible value as AdaptiveFilterLayoutFilterButtonLabel.Text; kept separate for this property or translation context.
Streams
Levels
-Engine debug monitor
Clear engine output
Clear
Copy visible engine output
@@ -230,69 +198,45 @@
Where servers run
Use Docker when available
- Takes effect after restarting the app. JustHostMC never installs Docker, WSL, or Hyper-V ??you choose to enable this.
- Servers run directly on this PC (isolated with Windows Job Objects).
- Servers run in Docker containers on this PC.
+ Takes effect after restarting the app. JustHostMC never installs Docker, WSL, or Hyper-V — you choose to enable this.
Docker detected (version {version}).
- Docker was not detected. Start Docker Desktop to enable this option.
- Saved. Restart the app to apply the backend change.
- Home
+ HomeCanonical duplicate value in this locale; semantic identifier: NavHome.Content.
Add server
- Settings
- Home
- Settings
+ SettingsSame visible value as SettingsButton.Content; kept separate for this property or translation context.
+ HomeSame visible value as NavHome.Content; kept separate for this property or translation context.
+ SettingsSame visible value as SettingsButton.Content; kept separate for this property or translation context.
Add a server
- Console
+ ConsoleSame visible value as ServerConsoleButton.Content; kept separate for this property or translation context.
Players
- Performance
+ PerformanceCanonical duplicate value in this locale; semantic identifier: ServerSectionPerformance.Text.
Plugins / Mods
- Configuration
- Manage server launch settings and advanced options
- Monitor server resource usage and network metrics
- Manage online players, operators, and ban lists
- Manage server extensions and modifications
- Backups
- Delete server
+ ConfigurationCanonical duplicate value in this locale; semantic identifier: ServerSectionConfig.Text.
+ BackupsSame visible value as ServerBackupsButton.Content; kept separate for this property or translation context.
+ Delete serverCanonical duplicate value in this locale; semantic identifier: ServerDeleteMenuItem.Text.
More options
- Type
- Version
- Port
- Memory
- Name
+ TypeSame visible value as CreateServerType.Header; kept separate for this property or translation context.
+ VersionSame visible value as CreateServerVersion.Header; kept separate for this property or translation context.
+ PortSame visible value as CreateServerPort.Header; kept separate for this property or translation context.
+ MemoryCanonical duplicate value in this locale; semantic identifier: ServerMetaMemoryLabel.Text.
+ NameSame visible value as CreateServerName.Header; kept separate for this property or translation context.
Custom Java arguments
Port {port}
- Auto
+ AutoCanonical duplicate value in this locale; semantic identifier: Server_PortAutoValue.
{memory} MB
- Unknown
- Start
- Stop
- Starting
- Stopping
- Installing
- Delete server?
- This permanently deletes the server and its world. This cannot be undone.
- Delete
- Delete server
- Remove incomplete installation?
- This cancels the installation and removes all files downloaded for this server.
- Remove
- Remove incomplete installation
- Current task is running
- Closing now interrupts the current task. You can keep JustHostMC running in the system tray or close it anyway.
- Hide to system tray
- Close anyway
+ StartSame visible value as ServerStartButton.Content; kept separate for this property or translation context.
+ StopSame visible value as ServerStopButton.Content; kept separate for this property or translation context.
+ StartingSame visible value as ServerStatus_Starting; kept separate for this property or translation context.
+ StoppingSame visible value as ServerStatus_Stopping; kept separate for this property or translation context.
+ InstallingSame visible value as ServerStatus_Installing; kept separate for this property or translation context.
Open JustHostMC
Exit
- Cancel
Players ({count})
- No players online.
- Manage bans
- Manage bans
+ Manage bansCanonical duplicate value in this locale; semantic identifier: ManageBansButtonLabel.Text.
+ Manage bansSame visible value as ManageBansButtonLabel.Text; kept separate for this property or translation context.
- Stop the server to save server.properties, gamerules, or ban-list file changes safely.
server.properties
Available properties and editors are filtered for this server's Minecraft version.
Save properties
@@ -302,13 +246,10 @@
Discard
Save changes
Save gamerules
- Could not load server configuration.
- Could not save server configuration.
- Configuration saved.
- Boolean
- Integer
- Choice
- Text
+ Boolean
+ Integer
+ Choice
+ Text
Server port
Query port
Message of the day
@@ -342,16 +283,12 @@
Players sleeping percentage
Immediate respawn
- Ban list
- Close
Stop server to edit
The ban files are safest to change while the server is stopped. Console ban commands still work while running.
- Stop server to edit
- The ban files are safest to change while the server is stopped. Console ban commands still work while running.
Add ban
Add a player name, UUID, or IP address to the vanilla ban-list files.
- Type
- Player
+ TypeSame visible value as CreateServerType.Header; kept separate for this property or translation context.
+ PlayerCanonical duplicate value in this locale; semantic identifier: BanListTypePlayerItem.Content.
IP address
Target
Player name, UUID, or IP
@@ -360,54 +297,36 @@
Add
No bans yet.
Remove ban
- Player
- IP
- No reason provided
- Could not load ban list.
- Could not add ban.
- Could not remove ban.
- Enter a player, UUID, or IP address.
- Stop the server to edit ban-list files.
-Close
- Raw data
- Inventory
- {0} for {1}
+ PlayerSame visible value as BanListTypePlayerItem.Content; kept separate for this TextBlock property.
+ IP
+ No reason provided
Raw player NBT
- Equipment
- Inventory
+ EquipmentCanonical duplicate value in this locale; semantic identifier: PlayerInventoryEquipmentHeader.Text.
+ InventoryCanonical duplicate value in this locale; semantic identifier: PlayerInventoryMainHeader.Text.
Hotbar
Ender Chest
CPU
- Memory
+ MemorySame visible value as ServerMetaMemoryLabel.Text; kept separate for this property or translation context.
Network
Per-process network usage isn't available on the on-machine backend. Run servers in Docker to see network metrics.
Upload
- Remove
+ RemoveCanonical duplicate value in this locale; semantic identifier: ModsRemoveButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
Remove this file?
- Remove
- Stop the server to add or remove files.
+ RemoveSame visible value as ModsRemoveButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
This server type has no plugins or mods folder.
- Plugins
- Mods
Stop the server before changing plugins or mods.
- The operation failed. Please try again.
+ The operation failed. Please try again.Canonical duplicate value in this locale; semantic identifier: Mods_OperationFailed.
{summary} ({code}) {detail}
Built for {loader}; this mod/plugin does not match the server type.
Requires Minecraft {version}; this mod/plugin does not match the server version.
Built for {loader} and Minecraft {version}; neither matches this server.
- Could not read this JAR's metadata: {error}
+ Could not read this JAR's metadata.
Open instance folder
-
- Instance folder not found
-
-
- The instance folder has not been created yet, or the daemon is using a data location that is not exposed by this app version.
-
OP
@@ -425,13 +344,13 @@
Inventory
-
+ Same visible value as PlayerInventoryMainHeader.Text; kept separate for this property or translation context.
Player actions
Actions
-
+ Canonical duplicate value in this locale; semantic identifier: PlayerActionsButtonLabel.Text.
Make operator
@@ -450,83 +369,60 @@
Show inventory
-
+
Open backup folder
Export
-
+ Canonical duplicate value in this locale; semantic identifier: BackupExportButton.Content.
Backup actions
Actions
-
+ Same visible value as PlayerActionsButtonLabel.Text; kept separate for this property or translation context.
Export
-
+ Same visible value as BackupExportButton.Content; kept separate for this property or translation context.
Restore
-
+ Same visible value as BackupRestoreButton.Content; kept separate for this property or translation context.
Delete
-
-
- Backup file was not found in the local data folders. Open the backup folder to export it manually.
-
-
- Could not export the backup.
-
-
- Exported to {path}
-
-
- Backup folder was not found yet.
-
+ Same visible value as ServerDeleteButton.Content; kept separate for this property or translation context.
Custom Java arguments (optional)
Example: -Dexample=true -XX:MaxGCPauseMillis=150
- Save
Total servers
- Running
+ RunningSame visible value as ServerStatus_Running; kept separate for this property or translation context.
Ready
Changing state
- Type
- Version
+ TypeSame visible value as CreateServerType.Header; kept separate for this property or translation context.
+ VersionSame visible value as CreateServerVersion.Header; kept separate for this property or translation context.
Address
- Copy address
- Rename server
- Server actions
- Move server up
- Move server down
- Edit server
- Edit server
+ Copy addressCanonical duplicate value in this locale; semantic identifier: HomeCardCopyAddressButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ Rename serverCanonical duplicate value in this locale; semantic identifier: HomeCardRenameButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ Server actionsCanonical duplicate value in this locale; semantic identifier: HomeCardMoreButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ Move server upCanonical duplicate value in this locale; semantic identifier: HomeCardMoveUpButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ Move server downCanonical duplicate value in this locale; semantic identifier: HomeCardMoveDownButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ Edit serverCanonical duplicate value in this locale; semantic identifier: HomeCardEditButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ Edit serverSame visible value as HomeCardEditButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
Open server
- Delete server
- Edit server
- Rename server
- Rename server
- Edit server
- Save
- Cancel
- Name
- Name
- Type
- Version
- Port
+ Delete serverSame visible value as ServerDeleteMenuItem.Text; kept separate for this property or translation context.
+ Edit serverSame visible value as HomeCardEditButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ Rename serverSame visible value as HomeCardRenameButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ NameSame visible value as CreateServerName.Header; kept separate for this property or translation context.
+ TypeSame visible value as CreateServerType.Header; kept separate for this property or translation context.
+ VersionSame visible value as CreateServerVersion.Header; kept separate for this property or translation context.
+ PortSame visible value as CreateServerPort.Header; kept separate for this property or translation context.
Stop the server to change launch settings
Name changes can be saved while running. Stop the server to change version, memory, custom Java arguments, or port.
{server} installed successfully
- The server is ready to run.
{server} started
- The server is now running.
{server} stopped
- The server stopped successfully.
{server} crashed
- The server stopped unexpectedly.
- Start server
- Ready to run.
- Scripts
- Scripts
+ Ready to run.
+ ScriptsCanonical duplicate value in this locale; semantic identifier: NavScripts.Content.
+ ScriptsSame visible value as NavScripts.Content; kept separate for this property or translation context.
Import your own Lua provider and automation scripts, review the permissions they request, and manage what is installed.
Providers
Mod Metadata Parsers
@@ -535,83 +431,68 @@
Website
Show scripts in folder
Show in Folder
- Add scripts
- Add Scripts
+ Add scriptsCanonical duplicate value in this locale; semantic identifier: ScriptSectionAddScriptsButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ Add ScriptsSame visible value as ScriptSectionAddScriptsButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
No providers installed yet.
Automation scripts
No automation scripts installed yet.
- Built in
- Built in
+ Built inCanonical duplicate value in this locale; semantic identifier: ScriptsBuiltinBadge.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ Built inSame visible value as ScriptsBuiltinBadge.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
Enable or disable this script
- Remove
+ RemoveSame visible value as ModsRemoveButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
Open all automation logs in a new window
All Logs
Logs
No output from this script yet.
- All Automation Logs
+ All Automation LogsCanonical script-log window title; copied to Window.Title after XAML initialization.
No automation output yet.
Select a log entry to view its details.
Script
- Name
+ NameSame visible value as CreateServerName.Header; kept separate for this property or translation context.
ID
Log detail
- System
- Log entry
- Could not open the scripts folder.
- Review permissions
- Allow selected
- Cancel
This script requests the following permissions. Allow only what you trust it to do.
This script does not request any permissions.
- Network access
- Install files
- Access the server folder
- Read the server console
- Write to the server console
- Start and stop servers
- Run on a schedule
- List and inspect your servers
- View and manage players (kick/ban)
- Unknown permission
- Could not read the selected file.
+ Network access
+ Install files
+ Access the server folder
+ Read the server console
+ Write to the server console
+ Start and stop servers
+ Run on a schedule
+ List and inspect your servers
+ View and manage players (kick/ban)
+ Unknown permission
The script could not be imported because it is invalid.
A script with that id is already installed.
Built-in scripts cannot be modified.
The automation engine is not available yet.
- The operation failed. Please try again.
+ The operation failed. Please try again.Same visible value as Mods_OperationFailed; kept separate for this property or translation context.
Remove script
Remove “{name}”? This cannot be undone.
- Remove
- Cancel
- Review permissions — {name}
+ CancelCanonical duplicate value in this locale; semantic identifier: Scripts_RemoveConfirmCancel.
by {author}
Visit website
- Previous
- Previous
- Next
- Next
- Copy address
- Rename server
- Server actions
- Move server up
- Move server down
- Edit server
-
-Current session
-
-
-Session
-
+ PreviousCanonical duplicate value in this locale; semantic identifier: InstallProgressPreviousButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ PreviousSame visible value as InstallProgressPreviousButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ NextCanonical duplicate value in this locale; semantic identifier: InstallProgressNextButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ NextSame visible value as InstallProgressNextButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ Copy addressSame visible value as HomeCardCopyAddressButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ Rename serverSame visible value as HomeCardRenameButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ Server actionsSame visible value as HomeCardMoreButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ Move server upSame visible value as HomeCardMoveUpButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ Move server downSame visible value as HomeCardMoveDownButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ Edit serverSame visible value as HomeCardEditButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
About
GitHub Repository
Report an Issue
- Mod Shop
+Mod ShopCanonical Mod Shop window title; copied to Window.Title after XAML initialization.
Find something brilliant for your server
Explore community projects selected for this server. Compatibility filters are on by default, so what you see is ready to fit.
- Dismiss
+ DismissSame visible value as InstallDismissButton.Content; kept separate for this property or translation context.
Search results
- Filters
- Filters
+ FiltersSame visible value as AdaptiveFilterLayoutFilterButtonLabel.Text; kept separate for this property or translation context.
+ FiltersSame visible value as AdaptiveFilterLayoutFilterButtonLabel.Text; kept separate for this property or translation context.
Reset
Compatibility
Only show projects that support this server.
@@ -620,106 +501,242 @@
Turn off a compatibility filter to broaden the results.
Categories
Select one or more categories. Results may match any selection.
- Adventure
- Decoration
- Equipment
- Game mechanics
- Library
- Magic
- Management
- Mobs
- Optimization
- Storage
- Technology
- Transportation
- Utility
- World generation
+ Adventure
+ Decoration
+ EquipmentSame visible value as PlayerInventoryEquipmentHeader.Text; kept separate for this property or translation context.
+ Game mechanicsCanonical duplicate value in this locale; semantic identifier: shop.category.game-mechanics.
+ Library
+ MagicCanonical duplicate value in this locale; semantic identifier: shop.category.magic.
+ Management
+ MobsCanonical duplicate value in this locale; semantic identifier: shop.category.mobs.
+ OptimizationCanonical duplicate value in this locale; semantic identifier: shop.category.optimization.
+ StorageCanonical duplicate value in this locale; semantic identifier: shop.category.storage.
+ TechnologyCanonical duplicate value in this locale; semantic identifier: shop.category.technology.
+ Transportation
+ Utility
+ World generationCanonical duplicate value in this locale; semantic identifier: shop.category.worldgen.
Search mods…
- Back
+ Back
This source needs an API key. Add one in Settings to enable it.
- Needs an API key (see Settings)
- Could not load results from this source.
+Needs an API key (see Settings)
{0} results for “{1}”
Sort by
Relevance
Downloads
Popularity
Newest
- Recently updated
+ Recently updatedCanonical duplicate value in this locale; semantic identifier: ShopSortUpdated.Content.
No results. Try different keywords or relax the version/loader filters.
Details
Versions
Open website
- Install
Get on {source}
- Adventure and RPG
- API and Library
- Armor, Weapons, and Tools
- Cosmetic
- Education
- Food
- Game Mechanics
- Magic
- Map and Information
- Minecraft Miscellaneous
- Mobs
- Optimization
- Redstone
- Server Utility
- Storage
- Technology
- Transport
- World Generation
- Admin Tools
- Anti-Griefing Tools
- Chat Related
- Developer Tools
- Economy
- Fixes
- Fun
- General
- Informational
- Mechanics
- Miscellaneous
- Role Playing
- Teleportation
- World Editing and Management
- World Generators
- Install
+ Adventure and RPG
+ API and Library
+ Armor, Weapons, and Tools
+ Cosmetic
+ Education
+ Food
+ Game MechanicsSame visible value as shop.category.game-mechanics; kept separate for this property or translation context.
+ MagicSame visible value as shop.category.magic; kept separate for this property or translation context.
+ Map and Information
+ Minecraft Miscellaneous
+ MobsSame visible value as shop.category.mobs; kept separate for this property or translation context.
+ OptimizationSame visible value as shop.category.optimization; kept separate for this property or translation context.
+ Redstone
+ Server Utility
+ StorageSame visible value as shop.category.storage; kept separate for this property or translation context.
+ TechnologySame visible value as shop.category.technology; kept separate for this property or translation context.
+ Transport
+ World GenerationSame visible value as shop.category.worldgen; kept separate for this property or translation context.
+ Admin Tools
+ Anti-Griefing Tools
+ Chat Related
+ Developer Tools
+ Economy
+ Fixes
+ Fun
+ General
+ Informational
+ Mechanics
+ Miscellaneous
+ Role Playing
+ Teleportation
+ World Editing and Management
+ World Generators
+ InstallCanonical duplicate value in this locale; semantic identifier: ShopInstallButton.Content.
Install latest release
No compatible versions for this server. Relax the filters to see more.
- Required dependencies
- This version needs the following mods. They will be installed together (uncheck any you already have).
- Install all
- Installed. The server's mod list has been updated.
- Install failed.
The source no longer lists this project or version.
The author disallows third-party downloads for this file. Use “Open website” instead.
This source needs an API key. Add one in Settings.
Stop the server before installing mods.
- Most downloaded
- Community favorites with a proven track record.
- Trending
- Projects gaining attention across the community.
- Recommended for this server
- Popular community picks compatible with this server's version and loader.
- Recently updated
- Fresh releases and actively maintained projects.
- Projects currently featured by this source.
- Featured
+ Most downloaded
+ Community favorites with a proven track record.
+ Trending
+ Projects gaining attention across the community.
+ Recommended for this server
+ Popular community picks compatible with this server's version and loader.
+ Recently updatedSame visible value as ShopSortUpdated.Content; kept separate for this property or translation context.
+ Fresh releases and actively maintained projects.
+ Projects currently featured by this source.
+ Featured
Download all
Browse
Add custom jars
- Exported the mods archive.
- Could not export the mods archive.
- Mod shop
+ Mod shopSame visible value as ShopWindow.Title; kept separate for this property or translation context.
CurseForge requires a personal API key from console.curseforge.com. Modrinth needs no key.
CurseForge API key
Save key
- No CurseForge key is configured — the CurseForge tab stays disabled.
- A personal CurseForge key is configured. Save an empty key to remove it.
- Using this build's bundled CurseForge key. A personal key overrides it.
-
- Jump to latest log
-
+
+ Current task is running
+ Hide to system tray
+ Close anyway
+ CancelSame visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ Closing now interrupts the current task. You can keep JustHostMC running in the system tray or close it anyway.
+ Create serverSame visible value as CreateServerButtonLabel.Text; kept separate for this property or translation context.
+ Create
+ CancelSame visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ Edit serverSame visible value as HomeCardEditButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ SaveSame visible value as SettingsSaveButton.Content; kept separate for this property or translation context.
+ CancelSame visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ Rename serverSame visible value as HomeCardRenameButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ SaveSame visible value as SettingsSaveButton.Content; kept separate for this property or translation context.
+ CancelSame visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ NameSame visible value as CreateServerName.Header; kept separate for this property or translation context.
+ Delete server?
+ DeleteSame visible value as ServerDeleteButton.Content; kept separate for this property or translation context.
+ CancelSame visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ This permanently deletes the server and its world. This cannot be undone.
+ Remove incomplete installation?
+ RemoveSame visible value as ModsRemoveButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ CancelSame visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ This cancels the installation and removes all files downloaded for this server.
+ CloseSame visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
+ Instance folder not found
+ OK
+ The instance folder has not been created yet, or the daemon is using a data location that is not exposed by this app version.
+ Raw data for {0}
+ CloseSame visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
+ Inventory for {0}
+ CloseSame visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
+ Ban list
+ CloseSame visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
+ Review permissions — {name}
+ Allow selected
+ CancelSame visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ Required dependencies
+ Install all
+ CancelSame visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ This version needs the following mods. They will be installed together (uncheck any you already have).
+
+ Jump to latest log
+ RemoveSame visible value as ModsRemoveButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ ConfigurationSame visible value as ServerSectionConfig.Text; kept separate for this property or translation context.
+ Manage server launch settings and advanced options
+ Stop the server to save server.properties, gamerules, or ban-list file changes safely.
+ AutoSame visible value as Server_PortAutoValue; kept separate for this property or translation context.
+ UnknownSame visible value as ServerStatus_Unknown; kept separate for this property or translation context.
+ Manage server extensions and modifications
+ Stop the server to add or remove files.
+ PerformanceSame visible value as ServerSectionPerformance.Text; kept separate for this property or translation context.
+ Monitor server resource usage and network metrics
+ No players online.
+ Manage online players, operators, and ban lists
+ API Key
+ JustHostMCSame visible value as AppDisplayName; kept separate for this property or translation context.
+ Start server
+ The server is ready to run.
+ The server is now running.
+ The server stopped successfully.
+ The server stopped unexpectedly.
+ UnknownSame visible value as ServerStatus_Unknown; kept separate for this property or translation context.
+ Engine debug monitorCanonical engine-monitor window title; copied to Window.Title after XAML initialization.
+ Could not load ban list.
+ Enter a player, UUID, or IP address.
+ Could not add ban.
+ Stop the server to edit ban-list files.
+ Could not remove ban.
+ Player data could not be loaded. The player may need to join once and the server may need to save.
+ Player inventory could not be loaded. The player may need to join once and the server may need to save.
+ Inventory {0}
+ Hotbar {0}
+ Ender chest {0}
+ Helmet
+ Chestplate
+ Leggings
+ Boots
+ Offhand
+ Slot {0}
+ This item has no custom NBT metadata.
+ NBT could not be parsed.
+ Raw NBT
+ Could not read the selected file.
+ Could not open the scripts folder.
+ Connecting to the engine
+ Engine connected.
+ Could not reach the engine.
+ RunningSame visible value as ServerStatus_Running; kept separate for this property or translation context.
+ StoppedSame visible value as ServerStatus_Stopped; kept separate for this property or translation context.
+ InstallingSame visible value as ServerStatus_Installing; kept separate for this property or translation context.
+ StartingSame visible value as ServerStatus_Starting; kept separate for this property or translation context.
+ StoppingSame visible value as ServerStatus_Stopping; kept separate for this property or translation context.
+ CrashedSame visible value as ServerStatus_Crashed; kept separate for this property or translation context.
+ UnknownSame visible value as ServerStatus_Unknown; kept separate for this property or translation context.
+ StartSame visible value as ServerStartButton.Content; kept separate for this property or translation context.
+ StopSame visible value as ServerStopButton.Content; kept separate for this property or translation context.
+ StartingSame visible value as ServerStatus_Starting; kept separate for this property or translation context.
+ StoppingSame visible value as ServerStatus_Stopping; kept separate for this property or translation context.
+ InstallingSame visible value as ServerStatus_Installing; kept separate for this property or translation context.
+ UnknownSame visible value as ServerStatus_Unknown; kept separate for this property or translation context.
+ Remove incomplete installationCanonical duplicate value in this locale; semantic identifier: HomeCardRemoveIncompleteMenuItem.Text.
+ Remove incomplete installationSame visible value as HomeCardRemoveIncompleteMenuItem.Text; kept separate for this property or translation context.
+ Creating backup
+ Backup created.
+ Restoring backup
+ Backup restored.
+ Deleting backup
+ Backup deleted.
+ Backup file was not found in the local data folders. Open the backup folder to export it manually.
+ Exported to:
+ Could not export the backup.
+ Stop the server before restoring a backup.Same visible value as error.server_running; kept separate for this property or translation context.
+ Backup folder was not found yet.
+ Configuration saved.
+ Could not load server configuration.
+ Could not save server configuration.
+ VanillaSame visible value as ServerTypeVanillaItem.Content; kept separate for this property or translation context.
+ Paper
+ Spigot
+ Forge
+ NeoForge
+ Fabric
+ Mods
+ Plugins
+ Exported the mods archive.
+ Could not export the mods archive.
+ System
+ Current session
+ Session
+ Servers run in Docker containers on this PC.
+ Servers run directly on this PC (isolated with Windows Job Objects).
+ Docker was not detected. Start Docker Desktop to enable this option.
+ No CurseForge key is configured — the CurseForge tab stays disabled.
+ A personal CurseForge key is configured. Save an empty key to remove it.
+ Using this build's bundled CurseForge key. A personal key overrides it.
+ Could not load settings.
+ Settings saved.
+ Could not save settings.
+ Saved. Restart the app to apply the backend change.
+ Could not purge logs.
+ Removing all data
+ All data removed.
+ Could not remove all data.
+ Removing incomplete server installations…
+ Failed to remove incomplete server installations.
+ Could not load results from this source.Canonical duplicate value in this locale; semantic identifier: ShopLoadFailedBar.Message.
+ Could not load results from this source.Same visible value as ShopLoadFailedBar.Message; kept separate for this property or translation context.
+ InstallSame visible value as ShopInstallButton.Content; kept separate for this property or translation context.
+ Installed. The server's mod list has been updated.
+ Install failed.
diff --git a/app/JustHostMC.App/Strings/zh-TW/Resources.resw b/app/JustHostMC.App/Strings/zh-TW/Resources.resw
index 7bf0459..77fad35 100644
--- a/app/JustHostMC.App/Strings/zh-TW/Resources.resw
+++ b/app/JustHostMC.App/Strings/zh-TW/Resources.resw
@@ -60,88 +60,73 @@
- JustHostMC
+ JustHostMCCanonical duplicate value in this locale; semantic identifier: AppDisplayName.
JustHostMC — Minecraft 伺服器管理工具
Muisnow Devs
- JustHostMC
+ JustHostMCSame visible value as AppDisplayName; kept separate for this property or translation context.
JustHostMC - Minecraft 伺服器管理工具
- 重新整理
- 建立伺服器
+ 重新整理
+ 建立伺服器Canonical duplicate value in this locale; semantic identifier: CreateServerButtonLabel.Text.
還沒有伺服器。選取「建立伺服器」來新增一個。
- 篩選
+ 篩選Canonical duplicate value in this locale; semantic identifier: AdaptiveFilterLayoutFilterButtonLabel.Text.
伺服器會在這台電腦上執行
未使用 Docker 時,伺服器會直接在你的電腦上執行(不在容器中)。每個伺服器的記憶體限制仍會套用。
-
- 正在連線到引擎
- 引擎已連線。
- 無法連線到引擎。
-
- 啟動
- 停止
- 刪除
- 執行中
- 已停止
- 安裝中
- 啟動中
- 停止中
- 已當機
- 不明
+ 啟動Canonical duplicate value in this locale; semantic identifier: ServerStartButton.Content.
+ 停止Canonical duplicate value in this locale; semantic identifier: ServerStopButton.Content.
+ 刪除Canonical duplicate value in this locale; semantic identifier: ServerDeleteButton.Content.
+ 執行中Canonical duplicate value in this locale; semantic identifier: ServerStatus_Running.
+ 已停止Canonical duplicate value in this locale; semantic identifier: ServerStatus_Stopped.
+ 安裝中Canonical duplicate value in this locale; semantic identifier: ServerStatus_Installing.
+ 啟動中Canonical duplicate value in this locale; semantic identifier: ServerStatus_Starting.
+ 停止中Canonical duplicate value in this locale; semantic identifier: ServerStatus_Stopping.
+ 已當機Canonical duplicate value in this locale; semantic identifier: ServerStatus_Crashed.
+ 不明Canonical duplicate value in this locale; semantic identifier: ServerStatus_Unknown.
{name},{status}
{name},狀態已變更為{status}
- 原版
- Paper
- Spigot
- Forge
- NeoForge
- Fabric
- 不明
- 控制台
- 控制台
- 關閉
+ 控制台Canonical duplicate value in this locale; semantic identifier: ServerConsoleButton.Content.
+ 控制台Same visible value as ServerConsoleButton.Content; kept separate for this property or translation context.
+ 關閉Canonical duplicate value in this locale; semantic identifier: ConsoleDialog.CloseButtonText.
輸入指令後按 Enter
- 送出
+ 送出Canonical duplicate value in this locale; semantic identifier: ConsoleSendButton.Content.
控制台輸出
- 送出
+ 送出Same visible value as ConsoleSendButton.Content; kept separate for this property or translation context.
送出指令
- 建立伺服器
- 建立
- 取消
- 名稱
- 我的伺服器
- 我的伺服器
- 類型
- 原版
+ 名稱Canonical duplicate value in this locale; semantic identifier: CreateServerName.Header.
+ 我的伺服器Canonical duplicate value in this locale; semantic identifier: CreateServerName.PlaceholderText.
+ 我的伺服器Same visible value as CreateServerName.PlaceholderText; kept separate for this property or translation context.
+ 類型Canonical duplicate value in this locale; semantic identifier: CreateServerType.Header.
+ 原版Same visible value as ServerTypeVanillaText.Text; kept separate for this property or translation context.
版本會從網路取得。
- 版本
+ 版本Canonical duplicate value in this locale; semantic identifier: CreateServerVersion.Header.
無法載入版本
請檢查網路連線,然後重新選取伺服器類型。
進階設定
記憶體 (MB)
Java 行程的最大堆積記憶體。多數伺服器建議使用 2048 MB。
- 連接埠
+ 連接埠Canonical duplicate value in this locale; semantic identifier: CreateServerPort.Header.
保留為 0 可自動指派可用連接埠。Minecraft 預設值為 25565。
建立伺服器中
- 關閉
- 準備中
- 解析版本中
- 下載伺服器中
- 下載 Java 執行階段中
- 解壓縮 Java 執行階段中
- 下載安裝程式中
- 執行安裝程式中
- 完成。
+ 關閉Same visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
+ 準備中
+ 解析版本中
+ 下載伺服器中
+ 下載 Java 執行階段中
+ 解壓縮 Java 執行階段中
+ 下載安裝程式中
+ 執行安裝程式中
+ 完成。
找不到該版本。
@@ -150,30 +135,24 @@
安裝失敗。請查看記錄以了解詳細資訊。
備份作業失敗。請查看記錄以了解詳細資訊。
找不到該備份。
- 還原備份前,請先停止伺服器。
+ 還原備份前,請先停止伺服器。Canonical duplicate value in this locale; semantic identifier: error.server_running.
- 備份
- 關閉
- 建立備份
- 線上安全備份(暫停儲存)
+ 備份Canonical duplicate value in this locale; semantic identifier: ServerBackupsButton.Content.
+ 建立備份Canonical duplicate value in this locale; semantic identifier: BackupCreateButton.Content.
+ 線上安全備份(暫停儲存)Canonical duplicate value in this locale; semantic identifier: BackupSafeOnline.Content.
還沒有備份。選取「建立備份」來建立一份。
- 還原
+ 還原Canonical duplicate value in this locale; semantic identifier: BackupRestoreButton.Content.
要還原這份備份嗎?這會取代伺服器目前的世界與檔案。伺服器必須先停止。
- 還原
- 刪除
+ 還原Same visible value as BackupRestoreButton.Content; kept separate for this property or translation context.
+ 刪除Same visible value as ServerDeleteButton.Content; kept separate for this property or translation context.
要永久刪除這份備份嗎?
- 刪除
- 建立備份中
- 備份已建立。
- 還原備份中
- 備份已還原。
- 備份已刪除。
+ 刪除Same visible value as ServerDeleteButton.Content; kept separate for this property or translation context.
- 設定
- 設定
- 關閉
+ 設定Canonical duplicate value in this locale; semantic identifier: SettingsButton.Content.
+ 設定Same visible value as SettingsButton.Content; kept separate for this property or translation context.
+ 關閉Same visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
引擎與伺服器
整合
應用程式
@@ -181,37 +160,27 @@
安裝與控制台記錄會自動清理。使用 0 表示不限制。
記錄保留天數
總大小上限 (MB)
- 儲存
+ 儲存Canonical duplicate value in this locale; semantic identifier: SettingsSaveButton.Content.
立即清理
引擎診斷
檢視引擎行程的即時標準輸出、錯誤輸出與輸入監看生命週期。
開啟引擎監視器
- 設定已儲存。
- 無法儲存設定。
- 無法載入設定。
已清理 {count} 個檔案,釋放 {size}。
- 無法清理記錄。
- 移除所有資料
+ 移除所有資料Canonical duplicate value in this locale; semantic identifier: SettingsDataHeader.Text.
停止所有伺服器,並永久刪除所有伺服器、備份、記錄,以及已下載的 Java 執行階段。此動作無法復原。
- 移除所有資料
+ 移除所有資料Same visible value as SettingsDataHeader.Text; kept separate for this property or translation context.
要刪除所有伺服器、備份、記錄和 Java 執行階段嗎?此動作無法復原。
全部移除
- 正在移除所有資料
- 所有資料已移除。
未完成的伺服器安裝
可移除 {count} 個未完成的安裝。
- 移除未完成的安裝
- 正在移除未完成的伺服器安裝…
+ 移除未完成的安裝Canonical duplicate value in this locale; semantic identifier: SettingsRemoveIncompleteInstallationsButton.Content.
已移除 {count} 個未完成的安裝。
- 移除未完成的伺服器安裝失敗。
-無法移除所有資料。
-停止
-篩選條件
+停止Same visible value as ServerStopButton.Content; kept separate for this property or translation context.
+篩選條件Canonical duplicate value in this locale; semantic identifier: EngineMonitorFiltersLabel.Text.
訊息來源
記錄層級
-引擎監視器
清除引擎輸出
清除
複製顯示中的引擎輸出
@@ -228,69 +197,45 @@
伺服器執行位置
可用時使用 Docker
重新啟動應用程式後生效。JustHostMC 不會安裝 Docker、WSL 或 Hyper-V;是否啟用由你決定。
- 伺服器會直接在這台電腦上執行(使用 Windows Job Objects 隔離)。
- 伺服器會在這台電腦上的 Docker 容器中執行。
偵測到 Docker(版本 {version})。
- 未偵測到 Docker。啟動 Docker Desktop 以啟用此選項。
- 已儲存。重新啟動應用程式以套用後端變更。
- 首頁
- 新增伺服器
- 設定
- 首頁
- 設定
- 新增伺服器
+ 首頁Canonical duplicate value in this locale; semantic identifier: NavHome.Content.
+ 新增伺服器Canonical duplicate value in this locale; semantic identifier: NavAddServer.Content.
+ 設定Same visible value as SettingsButton.Content; kept separate for this property or translation context.
+ 首頁Same visible value as NavHome.Content; kept separate for this property or translation context.
+ 設定Same visible value as SettingsButton.Content; kept separate for this property or translation context.
+ 新增伺服器Same visible value as NavAddServer.Content; kept separate for this property or translation context.
- 控制台
- 玩家
- 效能
+ 控制台Same visible value as ServerConsoleButton.Content; kept separate for this property or translation context.
+ 玩家Canonical duplicate value in this locale; semantic identifier: ServerSectionPlayers.Text.
+ 效能Canonical duplicate value in this locale; semantic identifier: ServerSectionPerformance.Text.
插件 / 模組
- 設定
- 管理伺服器啟動設定與進階選項
- 監控伺服器資源使用與網路指標
- 管理線上玩家、管理員與封鎖名單
- 管理伺服器擴充功能與模組
- 編輯伺服器
- 備份
- 刪除伺服器
+ 設定Same visible value as SettingsButton.Content; kept separate for this property or translation context.
+ 編輯伺服器Canonical duplicate value in this locale; semantic identifier: ServerEditMenuItem.Text.
+ 備份Same visible value as ServerBackupsButton.Content; kept separate for this property or translation context.
+ 刪除伺服器Canonical duplicate value in this locale; semantic identifier: ServerDeleteMenuItem.Text.
更多選項
- 類型
- 版本
- 連接埠
- 記憶體
- 名稱
+ 類型Same visible value as CreateServerType.Header; kept separate for this property or translation context.
+ 版本Same visible value as CreateServerVersion.Header; kept separate for this property or translation context.
+ 連接埠Same visible value as CreateServerPort.Header; kept separate for this property or translation context.
+ 記憶體Canonical duplicate value in this locale; semantic identifier: ServerMetaMemoryLabel.Text.
+ 名稱Same visible value as CreateServerName.Header; kept separate for this property or translation context.
自訂 Java 參數
連接埠 {port}
- 自動
+ 自動Canonical duplicate value in this locale; semantic identifier: Server_PortAutoValue.
{memory} MB
- 未知
- 啟動
- 停止
- 啟動中
- 停止中
- 安裝中
- 要刪除伺服器嗎?
- 這會永久刪除伺服器及其世界。此動作無法復原。
- 刪除
- 刪除伺服器
- 要移除未完成的安裝嗎?
- 這會取消安裝,並移除此伺服器已下載的所有檔案。
- 移除
- 移除未完成的安裝
- 目前工作仍在執行
- 現在關閉會中斷目前的工作。您可以讓 JustHostMC 繼續在系統匣執行,或仍然關閉。
- 隱藏到系統匣
- 仍然關閉
+ 啟動Same visible value as ServerStartButton.Content; kept separate for this property or translation context.
+ 停止Same visible value as ServerStopButton.Content; kept separate for this property or translation context.
+ 啟動中Same visible value as ServerStatus_Starting; kept separate for this property or translation context.
+ 停止中Same visible value as ServerStatus_Stopping; kept separate for this property or translation context.
+ 安裝中Same visible value as ServerStatus_Installing; kept separate for this property or translation context.
開啟 JustHostMC
結束
- 取消
玩家({count})
- 目前沒有玩家在線上。
管理封鎖
管理封鎖名單
- 請先停止伺服器,再安全地儲存 server.properties、遊戲規則或封鎖名單變更。
server.properties
可用屬性與編輯器會依此伺服器的 Minecraft 版本篩選。
儲存屬性
@@ -300,13 +245,10 @@
放棄
儲存變更
儲存遊戲規則
- 無法載入伺服器設定。
- 無法儲存伺服器設定。
- 設定已儲存。
- 布林值
- 整數
- 選項
- 文字
+ 布林值
+ 整數
+ 選項
+ 文字
伺服器連接埠
查詢連接埠
伺服器訊息
@@ -340,16 +282,12 @@
睡覺玩家百分比
立即重生
- 封鎖名單
- 關閉
停止伺服器後再編輯
封鎖名單檔案最適合在伺服器停止時修改;伺服器執行中仍可使用主控台封鎖指令。
- 停止伺服器後再編輯
- 封鎖名單檔案最適合在伺服器停止時修改;伺服器執行中仍可使用主控台封鎖指令。
新增封鎖
將玩家名稱、UUID 或 IP 位址加入原版封鎖名單檔案。
- 類型
- 玩家
+ 類型Same visible value as CreateServerType.Header; kept separate for this property or translation context.
+ 玩家Same visible value as ServerSectionPlayers.Text; kept separate for this property or translation context.
IP 位址
目標
玩家名稱、UUID 或 IP
@@ -358,53 +296,35 @@
新增
目前沒有封鎖項目。
移除封鎖
- 玩家
- IP
- 未提供原因
- 無法載入封鎖名單。
- 無法新增封鎖。
- 無法移除封鎖。
- 請輸入玩家、UUID 或 IP 位址。
- 請先停止伺服器再編輯封鎖名單檔案。
- 關閉
+ 玩家Same visible value as ServerSectionPlayers.Text; kept separate for this TextBlock property.
+ IP
+ 未提供原因
原始玩家 NBT
- 原始資料
- 物品欄
- {1} 的{0}
- 裝備
- 物品欄
+ 裝備Canonical duplicate value in this locale; semantic identifier: PlayerInventoryEquipmentHeader.Text.
+ 物品欄Canonical duplicate value in this locale; semantic identifier: PlayerInventoryMainHeader.Text.
快捷列
終界箱
CPU
- 記憶體
+ 記憶體Same visible value as ServerMetaMemoryLabel.Text; kept separate for this property or translation context.
網路
在本機執行後端無法取得個別行程的網路使用量。使用 Docker 執行伺服器即可查看網路指標。
上傳
- 移除
+ 移除Canonical duplicate value in this locale; semantic identifier: ModsRemoveButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
要移除此檔案嗎?
- 移除
- 請停止伺服器後再新增或移除檔案。
+ 移除Same visible value as ModsRemoveButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
此伺服器類型沒有插件或模組資料夾。
- 插件
- 模組
變更插件或模組前,請先停止伺服器。
作業失敗。請再試一次。
{summary}({code}){detail}
此項目適用於 {loader},與伺服器類型不符。
此項目需要 Minecraft {version},與伺服器版本不符。
此項目適用於 {loader} 與 Minecraft {version},類型及版本皆與伺服器不符。
- 無法讀取此 JAR 的中繼資料:{error}
+ 無法讀取此 JAR 的中繼資料。
開啟執行個體資料夾
-
- 找不到執行個體資料夾
-
-
- 執行個體資料夾尚未建立,或背景服務正在使用此應用程式版本尚未公開的資料位置。
-
OP
@@ -422,13 +342,13 @@
物品欄
-
+ Same visible value as PlayerInventoryMainHeader.Text; kept separate for this property or translation context.
玩家動作
動作
-
+ Canonical duplicate value in this locale; semantic identifier: PlayerActionsButtonLabel.Text.
設為 OP
@@ -447,54 +367,34 @@
顯示物品欄
-
+
開啟備份資料夾
匯出
-
-
- 在本機資料夾中找不到備份檔。請開啟備份資料夾手動匯出。
-
-
- 已匯出至 {path}
-
-
- 尚未找到備份資料夾。
-
+ Canonical duplicate value in this locale; semantic identifier: BackupExportButton.Content.
自訂 Java 參數(選填)
範例:-Dexample=true -XX:MaxGCPauseMillis=150
- 建立備份
- 線上安全備份(暫停儲存)
+ 建立備份Same visible value as BackupCreateButton.Content; kept separate for this property or translation context.
+ 線上安全備份(暫停儲存)Same visible value as BackupSafeOnline.Content; kept separate for this property or translation context.
備份動作
- 動作
- 匯出
- 還原
- 刪除
- 刪除備份中
- 無法匯出備份。
- 編輯伺服器
- 儲存
- 取消
- 名稱
- 名稱
- 類型
- 版本
- 連接埠
+ 動作Same visible value as PlayerActionsButtonLabel.Text; kept separate for this property or translation context.
+ 匯出Same visible value as BackupExportButton.Content; kept separate for this property or translation context.
+ 還原Same visible value as BackupRestoreButton.Content; kept separate for this property or translation context.
+ 刪除Same visible value as ServerDeleteButton.Content; kept separate for this property or translation context.
+ 名稱Same visible value as CreateServerName.Header; kept separate for this property or translation context.
+ 類型Same visible value as CreateServerType.Header; kept separate for this property or translation context.
+ 版本Same visible value as CreateServerVersion.Header; kept separate for this property or translation context.
+ 連接埠Same visible value as CreateServerPort.Header; kept separate for this property or translation context.
停止伺服器才能變更啟動設定
伺服器執行時仍可儲存名稱變更。若要變更版本、記憶體、自訂 Java 參數或連接埠,請先停止伺服器。
{server} 已成功安裝
- 伺服器已準備好執行。
{server} 已啟動
- 伺服器目前正在執行。
{server} 已停止
- 伺服器已順利停止。
{server} 已當機
- 伺服器意外停止。
- 啟動伺服器
- 已準備就緒。
- 腳本
- 腳本
+ 已準備就緒。
+ 腳本Canonical duplicate value in this locale; semantic identifier: NavScripts.Content.
+ 腳本Same visible value as NavScripts.Content; kept separate for this property or translation context.
匯入您自己的 Lua 提供者與自動化腳本,檢視它們要求的權限,並管理已安裝的項目。
提供者
模組資訊解析器
@@ -503,45 +403,38 @@
網站
在資料夾中顯示腳本
在資料夾中顯示
- 新增腳本
- 新增腳本
+ 新增腳本Canonical duplicate value in this locale; semantic identifier: ScriptSectionAddScriptsButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ 新增腳本Same visible value as ScriptSectionAddScriptsButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
尚未安裝任何提供者。
自動化腳本
尚未安裝任何自動化腳本。
- 內建
- 內建
+ 內建Canonical duplicate value in this locale; semantic identifier: ScriptsBuiltinBadge.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ 內建Same visible value as ScriptsBuiltinBadge.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
啟用或停用此腳本
- 移除
+ 移除Same visible value as ModsRemoveButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
在新視窗中開啟所有自動化日誌
所有日誌
日誌
此腳本尚無輸出。
- 所有自動化日誌
+ 所有自動化日誌自動化日誌視窗的標準標題;XAML 初始化後複製到 Window.Title。
尚無自動化輸出。
選取日誌項目以檢視詳細資料。
- 腳本
- 名稱
+ 腳本Same visible value as NavScripts.Content; kept separate for this property or translation context.
+ 名稱Same visible value as CreateServerName.Header; kept separate for this property or translation context.
識別碼
日誌詳細資料
- 系統
- 日誌項目
- 無法開啟腳本資料夾。
- 檢視權限
- 允許所選
- 取消
此腳本要求以下權限。請僅允許您信任的項目。
此腳本未要求任何權限。
- 網路存取
- 安裝檔案
- 存取伺服器資料夾
- 讀取伺服器主控台
- 寫入伺服器主控台
- 啟動與停止伺服器
- 依排程執行
- 列出並檢視您的伺服器
- 檢視與管理玩家(踢出/封鎖)
- 未知權限
- 無法讀取所選的檔案。
+ 網路存取
+ 安裝檔案
+ 存取伺服器資料夾
+ 讀取伺服器主控台
+ 寫入伺服器主控台
+ 啟動與停止伺服器
+ 依排程執行
+ 列出並檢視您的伺服器
+ 檢視與管理玩家(踢出/封鎖)
+ 未知權限
腳本無效,無法匯入。
已安裝相同識別碼的腳本。
內建腳本無法修改。
@@ -549,56 +442,46 @@
操作失敗,請再試一次。
移除腳本
要移除「{name}」嗎?此操作無法復原。
- 移除
- 取消
- 檢視權限 — {name}
+ 取消Canonical duplicate value in this locale; semantic identifier: Scripts_RemoveConfirmCancel.
作者:{author}
造訪網站
總伺服器
- 執行中
+ 執行中Same visible value as ServerStatus_Running; kept separate for this property or translation context.
就緒
變更狀態中
- 類型
- 版本
+ 類型Same visible value as CreateServerType.Header; kept separate for this property or translation context.
+ 版本Same visible value as CreateServerVersion.Header; kept separate for this property or translation context.
位址
- 複製位址
- 複製位址
- 重新命名伺服器
- 重新命名伺服器
- 伺服器動作
- 伺服器動作
- 上移伺服器
- 上移伺服器
- 下移伺服器
- 下移伺服器
- 編輯伺服器
- 編輯伺服器
- 編輯伺服器
+ 複製位址Canonical duplicate value in this locale; semantic identifier: HomeCardCopyAddressButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ 複製位址Same visible value as HomeCardCopyAddressButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ 重新命名伺服器Canonical duplicate value in this locale; semantic identifier: HomeCardRenameButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ 重新命名伺服器Same visible value as HomeCardRenameButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ 伺服器動作Canonical duplicate value in this locale; semantic identifier: HomeCardMoreButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ 伺服器動作Same visible value as HomeCardMoreButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ 上移伺服器Canonical duplicate value in this locale; semantic identifier: HomeCardMoveUpButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ 上移伺服器Same visible value as HomeCardMoveUpButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ 下移伺服器Canonical duplicate value in this locale; semantic identifier: HomeCardMoveDownButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ 下移伺服器Same visible value as HomeCardMoveDownButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ 編輯伺服器Same visible value as ServerEditMenuItem.Text; kept separate for this property or translation context.
+ 編輯伺服器Same visible value as ServerEditMenuItem.Text; kept separate for this property or translation context.
+ 編輯伺服器Same visible value as ServerEditMenuItem.Text; kept separate for this property or translation context.
開啟伺服器
- 刪除伺服器
- 重新命名伺服器
- 重新命名伺服器
- 名稱
- 上一步
- 上一步
- 下一步
- 下一步
-
-目前工作階段
-
-
-工作階段
-
+ 刪除伺服器Same visible value as ServerDeleteMenuItem.Text; kept separate for this property or translation context.
+ 重新命名伺服器Same visible value as HomeCardRenameButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ 上一步Canonical duplicate value in this locale; semantic identifier: InstallProgressPreviousButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ 上一步Same visible value as InstallProgressPreviousButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ 下一步Canonical duplicate value in this locale; semantic identifier: InstallProgressNextButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name.
+ 下一步Same visible value as InstallProgressNextButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
關於
GitHub 儲存庫
回報問題
- 模組商店
+模組商店模組商店視窗的標準標題;XAML 初始化後複製到 Window.Title。
為你的伺服器找到精彩內容
探索社群製作的專案。相容性篩選預設開啟,顯示的內容都更適合目前的伺服器。
- 關閉
+ 關閉Same visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
搜尋結果
- 篩選
- 篩選條件
+ 篩選Same visible value as AdaptiveFilterLayoutFilterButtonLabel.Text; kept separate for this property or translation context.
+ 篩選條件Same visible value as EngineMonitorFiltersLabel.Text; kept separate for this property or translation context.
重設
相容性
只顯示支援此伺服器的專案。
@@ -607,106 +490,242 @@
關閉相容性篩選可查看更多結果。
分類
可選取多個分類,結果符合其中任一分類即可。
- 冒險
- 裝飾
- 裝備
- 遊戲機制
- 函式庫
- 魔法
- 管理
- 生物
- 最佳化
- 儲存
- 科技
- 交通
- 工具
- 世界生成
+ 冒險
+ 裝飾
+ 裝備Same visible value as PlayerInventoryEquipmentHeader.Text; kept separate for this property or translation context.
+ 遊戲機制Canonical duplicate value in this locale; semantic identifier: shop.category.game-mechanics.
+ 函式庫
+ 魔法Canonical duplicate value in this locale; semantic identifier: shop.category.magic.
+ 管理
+ 生物Canonical duplicate value in this locale; semantic identifier: shop.category.mobs.
+ 最佳化
+ 儲存Same visible value as SettingsSaveButton.Content; kept separate for this property or translation context.
+ 科技Canonical duplicate value in this locale; semantic identifier: shop.category.technology.
+ 交通
+ 工具
+ 世界生成Canonical duplicate value in this locale; semantic identifier: shop.category.worldgen.
搜尋模組…
- 返回
+ 返回
此來源需要 API 金鑰,請先到「設定」新增金鑰。
- 需要 API 金鑰(請見「設定」)
- 無法從此來源載入結果。
+需要 API 金鑰(請見「設定」)
「{1}」共 {0} 筆結果
排序方式
關聯性
下載次數
熱門程度
最新發布
- 最近更新
+ 最近更新Canonical duplicate value in this locale; semantic identifier: ShopSortUpdated.Content.
沒有結果。請換個關鍵字,或放寬版本/載入器篩選。
詳細資料
- 版本
+ 版本Same visible value as CreateServerVersion.Header; kept separate for this property or translation context.
開啟網站
- 安裝
前往 {source} 取得
- 冒險與角色扮演
- API 與函式庫
- 護甲、武器與工具
- 外觀
- 教育
- 食物
- 遊戲機制
- 魔法
- 地圖與資訊
- Minecraft 雜項
- 生物
- 效能最佳化
- 紅石
- 伺服器工具
- 儲存
- 科技
- 運輸
- 世界生成
- 管理工具
- 防破壞工具
- 聊天
- 開發工具
- 經濟
- 修正
- 娛樂
- 一般
- 資訊
- 機制
- 雜項
- 角色扮演
- 傳送
- 世界編輯與管理
- 世界生成器
- 安裝
+ 冒險與角色扮演
+ API 與函式庫
+ 護甲、武器與工具
+ 外觀
+ 教育
+ 食物
+ 遊戲機制Same visible value as shop.category.game-mechanics; kept separate for this property or translation context.
+ 魔法Same visible value as shop.category.magic; kept separate for this property or translation context.
+ 地圖與資訊
+ Minecraft 雜項
+ 生物Same visible value as shop.category.mobs; kept separate for this property or translation context.
+ 效能最佳化
+ 紅石
+ 伺服器工具
+ 儲存Same visible value as SettingsSaveButton.Content; kept separate for this property or translation context.
+ 科技Same visible value as shop.category.technology; kept separate for this property or translation context.
+ 運輸
+ 世界生成Same visible value as shop.category.worldgen; kept separate for this property or translation context.
+ 管理工具
+ 防破壞工具
+ 聊天
+ 開發工具
+ 經濟
+ 修正
+ 娛樂
+ 一般
+ 資訊
+ 機制
+ 雜項
+ 角色扮演
+ 傳送
+ 世界編輯與管理
+ 世界生成器
+ 安裝Canonical duplicate value in this locale; semantic identifier: ShopInstallButton.Content.
安裝最新正式版
沒有與此伺服器相容的版本,放寬篩選即可看到更多。
- 必要相依模組
- 此版本需要下列模組,將一併安裝(已擁有的可取消勾選)。
- 全部安裝
- 安裝完成,伺服器的模組清單已更新。
- 安裝失敗。
來源已不再提供此專案或版本。
作者不允許第三方下載此檔案,請改用「開啟網站」。
此來源需要 API 金鑰,請到「設定」新增。
請先停止伺服器再安裝模組。
- 下載最多
- 經過社群長期使用與肯定的熱門專案。
- 熱門趨勢
- 近期受到社群關注的專案。
- 推薦給此伺服器
- 符合此伺服器版本與載入器的熱門社群精選。
- 最近更新
- 近期發布新版本並持續維護的專案。
- 目前由此來源精選推薦的專案。
- 精選
+ 下載最多
+ 經過社群長期使用與肯定的熱門專案。
+ 熱門趨勢
+ 近期受到社群關注的專案。
+ 推薦給此伺服器
+ 符合此伺服器版本與載入器的熱門社群精選。
+ 最近更新Same visible value as ShopSortUpdated.Content; kept separate for this property or translation context.
+ 近期發布新版本並持續維護的專案。
+ 目前由此來源精選推薦的專案。
+ 精選
全部下載
瀏覽
加入自訂 Jar
- 已匯出模組壓縮檔。
- 無法匯出模組壓縮檔。
- 模組商店
+ 模組商店Same visible value as ShopWindow.Title; kept separate for this property or translation context.
CurseForge 需要個人 API 金鑰(console.curseforge.com);Modrinth 不需要金鑰。
CurseForge API 金鑰
儲存金鑰
- 尚未設定 CurseForge 金鑰,CurseForge 分頁將維持停用。
- 已設定個人 CurseForge 金鑰。儲存空白金鑰即可移除。
- 正在使用此版本內建的 CurseForge 金鑰,個人金鑰可覆蓋它。
-
- 跳至最新記錄
-
+
+ 目前工作仍在執行
+ 隱藏到系統匣
+ 仍然關閉
+ 取消Same visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ 現在關閉會中斷目前的工作。您可以讓 JustHostMC 繼續在系統匣執行,或仍然關閉。
+ 建立伺服器Same visible value as CreateServerButtonLabel.Text; kept separate for this property or translation context.
+ 建立
+ 取消Same visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ 編輯伺服器Same visible value as ServerEditMenuItem.Text; kept separate for this property or translation context.
+ 儲存Same visible value as SettingsSaveButton.Content; kept separate for this property or translation context.
+ 取消Same visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ 重新命名伺服器Same visible value as HomeCardRenameButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ 儲存Same visible value as SettingsSaveButton.Content; kept separate for this property or translation context.
+ 取消Same visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ 名稱Same visible value as CreateServerName.Header; kept separate for this property or translation context.
+ 要刪除伺服器嗎?
+ 刪除Same visible value as ServerDeleteButton.Content; kept separate for this property or translation context.
+ 取消Same visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ 這會永久刪除伺服器及其世界。此動作無法復原。
+ 要移除未完成的安裝嗎?
+ 移除Same visible value as ModsRemoveButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ 取消Same visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ 這會取消安裝,並移除此伺服器已下載的所有檔案。
+ 關閉Same visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
+ 找不到執行個體資料夾
+ 確定
+ 執行個體資料夾尚未建立,或背景服務正在使用此應用程式版本尚未公開的資料位置。
+ {0} 的原始資料
+ 關閉Same visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
+ {0} 的物品欄
+ 關閉Same visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
+ 封鎖名單
+ 關閉Same visible value as ConsoleDialog.CloseButtonText; kept separate for this property or translation context.
+ 檢視權限 — {name}
+ 允許所選
+ 取消Same visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ 必要相依模組
+ 全部安裝
+ 取消Same visible value as Scripts_RemoveConfirmCancel; kept separate for this property or translation context.
+ 此版本需要下列模組,將一併安裝(已擁有的可取消勾選)。
+
+ 跳至最新記錄
+ 移除Same visible value as ModsRemoveButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name; kept separate for this property or translation context.
+ 設定Same visible value as SettingsButton.Content; kept separate for this property or translation context.
+ 管理伺服器啟動設定與進階選項
+ 請先停止伺服器,再安全地儲存 server.properties、遊戲規則或封鎖名單變更。
+ 自動Same visible value as Server_PortAutoValue; kept separate for this property or translation context.
+ 未知
+ 管理伺服器擴充功能與模組
+ 請停止伺服器後再新增或移除檔案。
+ 效能Same visible value as ServerSectionPerformance.Text; kept separate for this property or translation context.
+ 監控伺服器資源使用與網路指標
+ 目前沒有玩家在線上。
+ 管理線上玩家、管理員與封鎖名單
+ API 金鑰
+ JustHostMCSame visible value as AppDisplayName; kept separate for this property or translation context.
+ 啟動伺服器
+ 伺服器已準備好執行。
+ 伺服器目前正在執行。
+ 伺服器已順利停止。
+ 伺服器意外停止。
+ 不明Same visible value as ServerStatus_Unknown; kept separate for this property or translation context.
+ 引擎監視器引擎監視器視窗的標準標題;XAML 初始化後複製到 Window.Title。
+ 無法載入封鎖名單。
+ 請輸入玩家、UUID 或 IP 位址。
+ 無法新增封鎖。
+ 請先停止伺服器再編輯封鎖名單檔案。
+ 無法移除封鎖。
+ 無法載入玩家資料。玩家可能需要先加入一次,伺服器也可能需要先儲存資料。
+ 無法載入玩家物品欄。玩家可能需要先加入一次,伺服器也可能需要先儲存資料。
+ 物品欄 {0}
+ 快捷欄 {0}
+ 終界箱 {0}
+ 頭盔
+ 胸甲
+ 護腿
+ 靴子
+ 副手
+ 欄位 {0}
+ 此物品沒有自訂 NBT 中繼資料。
+ 無法解析 NBT。
+ 原始 NBT
+ 無法讀取所選的檔案。
+ 無法開啟腳本資料夾。
+ 正在連線到引擎
+ 引擎已連線。
+ 無法連線到引擎。
+ 執行中Same visible value as ServerStatus_Running; kept separate for this property or translation context.
+ 已停止Same visible value as ServerStatus_Stopped; kept separate for this property or translation context.
+ 安裝中Same visible value as ServerStatus_Installing; kept separate for this property or translation context.
+ 啟動中Same visible value as ServerStatus_Starting; kept separate for this property or translation context.
+ 停止中Same visible value as ServerStatus_Stopping; kept separate for this property or translation context.
+ 已當機Same visible value as ServerStatus_Crashed; kept separate for this property or translation context.
+ 不明Same visible value as ServerStatus_Unknown; kept separate for this property or translation context.
+ 啟動Same visible value as ServerStartButton.Content; kept separate for this property or translation context.
+ 停止Same visible value as ServerStopButton.Content; kept separate for this property or translation context.
+ 啟動中Same visible value as ServerStatus_Starting; kept separate for this property or translation context.
+ 停止中Same visible value as ServerStatus_Stopping; kept separate for this property or translation context.
+ 安裝中Same visible value as ServerStatus_Installing; kept separate for this property or translation context.
+ 不明Same visible value as ServerStatus_Unknown; kept separate for this property or translation context.
+ 移除未完成的安裝Same visible value as SettingsRemoveIncompleteInstallationsButton.Content; kept separate for this property or translation context.
+ 移除未完成的安裝Same visible value as SettingsRemoveIncompleteInstallationsButton.Content; kept separate for this property or translation context.
+ 建立備份中
+ 備份已建立。
+ 還原備份中
+ 備份已還原。
+ 刪除備份中
+ 備份已刪除。
+ 在本機資料夾中找不到備份檔。請開啟備份資料夾手動匯出。
+ 已匯出至:
+ 無法匯出備份。
+ 還原備份前,請先停止伺服器。Same visible value as error.server_running; kept separate for this property or translation context.
+ 尚未找到備份資料夾。
+ 設定已儲存。Canonical duplicate value in this locale; semantic identifier: ConfigStatusSaved.Text.
+ 無法載入伺服器設定。
+ 無法儲存伺服器設定。
+ 原版Same visible value as ServerTypeVanillaItem.Content; kept separate for this property or translation context.
+ Paper
+ Spigot
+ Forge
+ NeoForge
+ Fabric
+ 模組
+ 插件
+ 已匯出模組壓縮檔。
+ 無法匯出模組壓縮檔。
+ 系統
+ 目前工作階段
+ 工作階段
+ 伺服器會在這台電腦上的 Docker 容器中執行。
+ 伺服器會直接在這台電腦上執行(使用 Windows Job Objects 隔離)。
+ 未偵測到 Docker。啟動 Docker Desktop 以啟用此選項。
+ 尚未設定 CurseForge 金鑰,CurseForge 分頁將維持停用。
+ 已設定個人 CurseForge 金鑰。儲存空白金鑰即可移除。
+ 正在使用此版本內建的 CurseForge 金鑰,個人金鑰可覆蓋它。
+ 無法載入設定。
+ 設定已儲存。Same visible value as ConfigStatusSaved.Text; kept separate for this property or translation context.
+ 無法儲存設定。
+ 已儲存。重新啟動應用程式以套用後端變更。
+ 無法清理記錄。
+ 正在移除所有資料
+ 所有資料已移除。
+ 無法移除所有資料。
+ 正在移除未完成的伺服器安裝…
+ 移除未完成的伺服器安裝失敗。
+ 無法從此來源載入結果。Canonical duplicate value in this locale; semantic identifier: ShopLoadFailedBar.Message.
+ 無法從此來源載入結果。Same visible value as ShopLoadFailedBar.Message; kept separate for this property or translation context.
+ 安裝Same visible value as ShopInstallButton.Content; kept separate for this property or translation context.
+ 安裝完成,伺服器的模組清單已更新。
+ 安裝失敗。
diff --git a/app/JustHostMC.App/ViewModels/BackupsViewModel.cs b/app/JustHostMC.App/ViewModels/BackupsViewModel.cs
index 83121cf..b1152b7 100644
--- a/app/JustHostMC.App/ViewModels/BackupsViewModel.cs
+++ b/app/JustHostMC.App/ViewModels/BackupsViewModel.cs
@@ -9,6 +9,22 @@
namespace JustHostMC.App.ViewModels;
+public enum BackupStatus {
+ None,
+ Creating,
+ Created,
+ Restoring,
+ Restored,
+ Deleting,
+ Deleted,
+ ExportSourceMissing,
+ Exported,
+ ExportFailed,
+ RestoreBlocked,
+ FolderMissing,
+ Error,
+}
+
/// Manages the backups of a single server: list, create, restore,
/// delete.
public sealed partial class BackupsViewModel : ObservableObject {
@@ -27,8 +43,30 @@ public partial bool SafeOnline {
}
[ObservableProperty]
- public partial string StatusMessage {
- get; set;
+ [NotifyPropertyChangedFor(nameof(IsCreatingStatus))]
+ [NotifyPropertyChangedFor(nameof(IsCreatedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsRestoringStatus))]
+ [NotifyPropertyChangedFor(nameof(IsRestoredStatus))]
+ [NotifyPropertyChangedFor(nameof(IsDeletingStatus))]
+ [NotifyPropertyChangedFor(nameof(IsDeletedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsExportSourceMissingStatus))]
+ [NotifyPropertyChangedFor(nameof(IsExportedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsExportFailedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsRestoreBlockedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsFolderMissingStatus))]
+ [NotifyPropertyChangedFor(nameof(IsErrorStatus))]
+ public partial BackupStatus Status {
+ get; private set;
+ }
+
+ [ObservableProperty]
+ public partial string ErrorMessage {
+ get; private set;
+ } = "";
+
+ [ObservableProperty]
+ public partial string ExportPath {
+ get; private set;
} = "";
public BackupsViewModel(string serverId, bool serverRunning,
@@ -51,6 +89,35 @@ public BackupsViewModel(string serverId, bool serverRunning,
public bool CanRestore => !ServerRunning && !IsBusy;
+ public bool IsCreatingStatus => Status == BackupStatus.Creating;
+ public bool IsCreatedStatus => Status == BackupStatus.Created;
+ public bool IsRestoringStatus => Status == BackupStatus.Restoring;
+ public bool IsRestoredStatus => Status == BackupStatus.Restored;
+ public bool IsDeletingStatus => Status == BackupStatus.Deleting;
+ public bool IsDeletedStatus => Status == BackupStatus.Deleted;
+ public bool IsExportSourceMissingStatus =>
+ Status == BackupStatus.ExportSourceMissing;
+ public bool IsExportedStatus => Status == BackupStatus.Exported;
+ public bool IsExportFailedStatus => Status == BackupStatus.ExportFailed;
+ public bool IsRestoreBlockedStatus => Status == BackupStatus.RestoreBlocked;
+ public bool IsFolderMissingStatus => Status == BackupStatus.FolderMissing;
+ public bool IsErrorStatus => Status == BackupStatus.Error;
+
+ public void ReportExportSourceMissing() =>
+ SetStatus(BackupStatus.ExportSourceMissing);
+
+ public void ReportExported(string path) {
+ ExportPath = path;
+ SetStatus(BackupStatus.Exported);
+ }
+
+ public void ReportExportFailed() => SetStatus(BackupStatus.ExportFailed);
+
+ public void ReportRestoreBlocked() =>
+ SetStatus(BackupStatus.RestoreBlocked);
+
+ public void ReportFolderMissing() => SetStatus(BackupStatus.FolderMissing);
+
/// Loads (or reloads) the server's backups, newest
/// first.
public async Task LoadAsync() {
@@ -64,15 +131,15 @@ public async Task LoadAsync() {
foreach (var b in list.Backups) Backups.Add(new BackupItem(b));
});
} catch (RpcException ex) {
- RunOnUI(() => StatusMessage = _localizer.Get(MapBackupError(ex)));
+ RunOnUI(() => SetError(ex));
}
}
[RelayCommand]
private async Task CreateBackup() {
RunOnUI(() => {
- IsBusy = true;
- StatusMessage = _localizer.Get("Backups_Creating");
+ IsBusy = true;
+ SetStatus(BackupStatus.Creating);
});
try {
var daemon = await App.Current.DaemonReady;
@@ -81,9 +148,9 @@ await daemon.Backups.CreateAsync(
SafeOnline = SafeOnline },
deadline: DateTime.UtcNow.AddMinutes(10));
await LoadAsync();
- RunOnUI(() => StatusMessage = _localizer.Get("Backups_Created"));
+ RunOnUI(() => SetStatus(BackupStatus.Created));
} catch (RpcException ex) {
- RunOnUI(() => StatusMessage = _localizer.Get(MapBackupError(ex)));
+ RunOnUI(() => SetError(ex));
} finally {
RunOnUI(() => IsBusy = false);
}
@@ -94,8 +161,8 @@ private async Task Restore(BackupItem? item) {
if (item is null)
return;
RunOnUI(() => {
- IsBusy = true;
- StatusMessage = _localizer.Get("Backups_Restoring");
+ IsBusy = true;
+ SetStatus(BackupStatus.Restoring);
});
try {
var daemon = await App.Current.DaemonReady;
@@ -103,9 +170,9 @@ await daemon.Backups.RestoreAsync(
new RestoreBackupRequest { ServerId = _serverId,
BackupId = item.Id },
deadline: DateTime.UtcNow.AddMinutes(10));
- RunOnUI(() => StatusMessage = _localizer.Get("Backups_Restored"));
+ RunOnUI(() => SetStatus(BackupStatus.Restored));
} catch (RpcException ex) {
- RunOnUI(() => StatusMessage = _localizer.Get(MapBackupError(ex)));
+ RunOnUI(() => SetError(ex));
} finally {
RunOnUI(() => IsBusy = false);
}
@@ -116,17 +183,17 @@ private async Task Delete(BackupItem? item) {
if (item is null)
return;
RunOnUI(() => {
- IsBusy = true;
- StatusMessage = _localizer.Get("Backups_Deleting");
+ IsBusy = true;
+ SetStatus(BackupStatus.Deleting);
});
try {
var daemon = await App.Current.DaemonReady;
await daemon.Backups.DeleteAsync(
item.ToProto(), deadline: DateTime.UtcNow.AddSeconds(30));
await LoadAsync();
- RunOnUI(() => StatusMessage = _localizer.Get("Backups_Deleted"));
+ RunOnUI(() => SetStatus(BackupStatus.Deleted));
} catch (RpcException ex) {
- RunOnUI(() => StatusMessage = _localizer.Get(MapBackupError(ex)));
+ RunOnUI(() => SetError(ex));
} finally {
RunOnUI(() => IsBusy = false);
}
@@ -139,6 +206,18 @@ private static string MapBackupError(RpcException ex) =>
_ => "error.backup_failed",
};
+ private void SetStatus(BackupStatus status) {
+ ErrorMessage = "";
+ if (status != BackupStatus.Exported)
+ ExportPath = "";
+ Status = status;
+ }
+
+ private void SetError(RpcException ex) {
+ ErrorMessage = _localizer.Get(MapBackupError(ex));
+ Status = BackupStatus.Error;
+ }
+
private void RunOnUI(Action action) {
if (_dispatcher.HasThreadAccess)
action();
diff --git a/app/JustHostMC.App/ViewModels/MainViewModel.cs b/app/JustHostMC.App/ViewModels/MainViewModel.cs
index 9319343..2fbad62 100644
--- a/app/JustHostMC.App/ViewModels/MainViewModel.cs
+++ b/app/JustHostMC.App/ViewModels/MainViewModel.cs
@@ -11,6 +11,12 @@
namespace JustHostMC.App.ViewModels;
+public enum EngineConnectionStatus {
+ Connecting,
+ Connected,
+ Failed,
+}
+
///
/// Backs the main window: connects to the engine, lists/creates/starts/stops
/// servers, and surfaces install progress. All user-visible text is localized
@@ -60,12 +66,22 @@ public BoundedObservableCollection InstallLog {
Servers.Count(s => s.Status is ServerStatus.Installing or
ServerStatus.Starting or ServerStatus.Stopping);
[ObservableProperty]
- public partial string EngineStatus { get; private set; }
+ [NotifyPropertyChangedFor(nameof(IsEngineConnecting))]
+ [NotifyPropertyChangedFor(nameof(IsEngineConnected))]
+ [NotifyPropertyChangedFor(nameof(IsEngineConnectionFailed))]
+ public partial EngineConnectionStatus EngineConnectionState {
+ get; private set;
+ } = EngineConnectionStatus.Connecting;
+
+ public bool IsEngineConnecting =>
+ EngineConnectionState == EngineConnectionStatus.Connecting;
+ public bool IsEngineConnected =>
+ EngineConnectionState == EngineConnectionStatus.Connected;
+ public bool IsEngineConnectionFailed =>
+ EngineConnectionState == EngineConnectionStatus.Failed;
[ObservableProperty]
- public partial bool IsInstalling {
- get; private set;
- }
+ public partial bool IsInstalling { get; private set; }
[ObservableProperty]
public partial bool InstallFailed {
@@ -94,19 +110,19 @@ public MainViewModel(ILocalizer localizer, DispatcherQueue dispatcher,
_backgroundTasks = backgroundTasks;
ProgressService = new ServerProgressService(_dispatcher);
ProviderCatalog = new ProviderCatalog(FetchProvidersAsync);
- EngineStatus = _localizer.Get("EngineStatus_Connecting");
}
/// Waits for the engine, probes Health, and starts the server
/// change stream.
public async Task ConnectAsync() {
- RunOnUI(() => EngineStatus = _localizer.Get("EngineStatus_Connecting"));
+ RunOnUI(() => EngineConnectionState =
+ EngineConnectionStatus.Connecting);
try {
var daemon = await App.Current.DaemonReady;
await daemon.Engine.HealthAsync(
new Empty(), deadline: DateTime.UtcNow.AddSeconds(10));
- RunOnUI(() => EngineStatus =
- _localizer.Get("EngineStatus_Connected"));
+ RunOnUI(() => EngineConnectionState =
+ EngineConnectionStatus.Connected);
// Warm the provider catalog so server-type names + capabilities
// resolve (non-fatal: ServerItem falls back to its id-based name
// until loaded).
@@ -116,7 +132,8 @@ await daemon.Engine.HealthAsync(
_serverChangesSession ??= CreateServerChangeSession(daemon);
await _serverChangesSession.StartAsync();
} catch (Exception) {
- RunOnUI(() => EngineStatus = _localizer.Get("EngineStatus_Failed"));
+ RunOnUI(() => EngineConnectionState =
+ EngineConnectionStatus.Failed);
}
}
@@ -179,14 +196,14 @@ public async Task InstallServerAsync(CreateServerRequest request) {
tracker.IsReadyToRun = false;
tracker.IsIndeterminate = true;
tracker.ProgressFraction = 0;
- tracker.CurrentStep = _localizer.Get("install_progress_preparing");
+ tracker.CurrentStep = _localizer.Get("install.progress.preparing");
InstallLog.Clear();
InstallFailed = false;
IsInstalling = true;
InstallIsIndeterminate = true;
InstallFraction = 0;
- InstallStep = _localizer.Get("install_progress_preparing");
+ InstallStep = _localizer.Get("install.progress.preparing");
});
var progressBuffer = new InstallProgressBuffer(
@@ -206,21 +223,18 @@ public async Task InstallServerAsync(CreateServerRequest request) {
tracker.IsInstalling = false;
tracker.IsActive = false;
tracker.IsReadyToRun = true;
- tracker.CurrentStep = _localizer.Get("install_progress_done") +
+ tracker.CurrentStep = _localizer.Get("install.progress.done") +
" " +
- _localizer.Get("install_ready_to_run");
+ _localizer.Get("install.ready_to_run");
});
} catch (RpcException ex) {
await progressBuffer.FlushAsync();
- var key = MapErrorKey(ex);
- var detail = ex.Status.Detail;
+ var key = MapErrorKey(ex);
RunOnUI(() => {
IsInstalling = false;
InstallFailed = true;
InstallIsIndeterminate = false;
- InstallStep = string.IsNullOrEmpty(detail)
- ? _localizer.Get(key)
- : $"{_localizer.Get(key)}: {detail}";
+ InstallStep = _localizer.Get(key);
tracker.HasFailed = true;
tracker.IsInstalling = false;
diff --git a/app/JustHostMC.App/ViewModels/ModsViewModel.cs b/app/JustHostMC.App/ViewModels/ModsViewModel.cs
index 4b0c5b1..ee22b23 100644
--- a/app/JustHostMC.App/ViewModels/ModsViewModel.cs
+++ b/app/JustHostMC.App/ViewModels/ModsViewModel.cs
@@ -13,6 +13,12 @@
namespace JustHostMC.App.ViewModels;
+public enum ModsWorkflowStatus {
+ None,
+ Exported,
+ ExportFailed,
+}
+
/// Lists, uploads, and removes plugin/mod jars for a server via
/// ModService. Uploads and removals are only allowed while the server is
/// stopped.
@@ -79,13 +85,10 @@ public partial bool HasMoreFiles {
get; private set;
}
- [ObservableProperty]
- public partial string KindLabel {
- get; private set;
- } = "";
-
public bool AcceptsLiteMod { get; private set; }
+ public bool IsModKind => Kind == ModKind.Mod;
+
/// The folder kind reported by the engine (plugins vs mods),
/// used as the shop's project-type pre-filter.
public ModKind Kind { get; private set; } = ModKind.Mod;
@@ -101,6 +104,18 @@ public IReadOnlyCollection InstalledFileNames() =>
[ObservableProperty]
public partial string StatusMessage { get; private set; } = "";
+ [ObservableProperty]
+ [NotifyPropertyChangedFor(nameof(IsExportedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsExportFailedStatus))]
+ public partial ModsWorkflowStatus WorkflowStatus {
+ get; private set;
+ }
+
+ public bool IsExportedStatus =>
+ WorkflowStatus == ModsWorkflowStatus.Exported;
+ public bool IsExportFailedStatus =>
+ WorkflowStatus == ModsWorkflowStatus.ExportFailed;
+
partial void OnSupportedChanged(bool value) => RecomputeCanModify();
partial void OnIsBusyChanged(bool value) {
@@ -156,6 +171,7 @@ await RunOnUIAsync(() => {
IsInitialLoading = isInitialLoad;
IsRefreshing = !isInitialLoad;
StatusMessage = "";
+ WorkflowStatus = ModsWorkflowStatus.None;
});
try {
@@ -175,9 +191,7 @@ await RunOnUIAsync(() => {
Supported = list.Supported;
Kind = list.Kind;
AcceptsLiteMod = list.Kind == ModKind.Mod;
- KindLabel = _localizer.Get(list.Kind == ModKind.Mod
- ? "Mods_KindMods"
- : "Mods_KindPlugins");
+ OnPropertyChanged(nameof(IsModKind));
ApplyFileDiff(files);
_nextOffset = list.NextOffset;
HasMoreFiles = list.HasMore;
@@ -296,8 +310,9 @@ public async Task UploadAsync(StorageFile file) {
using var backgroundTask =
App.Current.BackgroundTasks.Begin("mod-upload");
RunOnUI(() => {
- IsBusy = true;
- StatusMessage = "";
+ IsBusy = true;
+ StatusMessage = "";
+ WorkflowStatus = ModsWorkflowStatus.None;
});
try {
var daemon = await App.Current.DaemonReady;
@@ -383,8 +398,9 @@ public async Task ExportAllAsync(string destPath) {
using var backgroundTask =
App.Current.BackgroundTasks.Begin("mod-export");
RunOnUI(() => {
- IsBusy = true;
- StatusMessage = "";
+ IsBusy = true;
+ StatusMessage = "";
+ WorkflowStatus = ModsWorkflowStatus.None;
});
try {
var daemon = await App.Current.DaemonReady;
@@ -394,9 +410,9 @@ await daemon.Mods.ExportAllAsync(
DestPath = destPath,
},
deadline: DateTime.UtcNow.AddMinutes(2));
- RunOnUI(() => StatusMessage = _localizer.Get("Mods_ExportDone"));
+ RunOnUI(() => WorkflowStatus = ModsWorkflowStatus.Exported);
} catch (RpcException) {
- RunOnUI(() => StatusMessage = _localizer.Get("Mods_ExportFailed"));
+ RunOnUI(() => WorkflowStatus = ModsWorkflowStatus.ExportFailed);
} finally {
RunOnUI(() => IsBusy = false);
}
@@ -407,17 +423,11 @@ await daemon.Mods.ExportAllAsync(
_ => "Mods_OperationFailed",
};
- private string FormatRpcError(RpcException ex) => _localizer.Get(
- "Mods_OperationFailedDetail",
- ("summary", _localizer.Get(MapErrorKey(ex))),
- ("code", ex.StatusCode.ToString()),
- ("detail", string.IsNullOrWhiteSpace(
- ex.Status.Detail)? ex.Message: ex.Status.Detail));
+ private string FormatRpcError(RpcException ex) =>
+ _localizer.Get(MapErrorKey(ex));
private string FormatUnexpectedError(Exception ex) =>
- _localizer.Get("Mods_OperationFailedDetail",
- ("summary", _localizer.Get("Mods_OperationFailed")),
- ("code", ex.GetType().Name), ("detail", ex.Message));
+ _localizer.Get("Mods_OperationFailed");
private void RunOnUI(Action action) {
if (_dispatcher.HasThreadAccess)
diff --git a/app/JustHostMC.App/ViewModels/ScriptsViewModel.cs b/app/JustHostMC.App/ViewModels/ScriptsViewModel.cs
index f483c1f..e8cc7eb 100644
--- a/app/JustHostMC.App/ViewModels/ScriptsViewModel.cs
+++ b/app/JustHostMC.App/ViewModels/ScriptsViewModel.cs
@@ -318,17 +318,14 @@ private void AppendLogLine(string scriptId, string line,
var scriptName =
Scripts.FirstOrDefault(item => item.Id == scriptId)?.Name;
if (string.IsNullOrEmpty(scriptName)) {
- scriptName = string.IsNullOrEmpty(scriptId)
- ? _localizer.Get("Scripts_SystemLogName")
- : scriptId;
+ // Empty is a semantic system-entry marker rendered by XAML.
+ scriptName = string.IsNullOrEmpty(scriptId) ? "" : scriptId;
}
var displayId = string.IsNullOrEmpty(scriptId) ? "—" : scriptId;
var session = GetOrCreateLogSession(sessionId, sessionStartedAt,
isCurrentSession);
session.Entries.Insert(
- 0, new ScriptLogEntry(
- displayId, scriptName, line, timestamp,
- _localizer.Get("Scripts_LogEntryFallbackTitle")));
+ 0, new ScriptLogEntry(displayId, scriptName, line, timestamp, ""));
while (session.Entries.Count > MaxLogLinesPerSession)
session.Entries.RemoveAt(session.Entries.Count - 1);
@@ -361,10 +358,11 @@ private ScriptLogSession GetOrCreateLogSession(string sessionId,
if (_logSessionsById.TryGetValue(sessionId, out var existing))
return existing;
- var session = new ScriptLogSession(
- sessionId, startedAt,
- _localizer.Get(isCurrentSession ? "Scripts_CurrentSessionTitle"
- : "Scripts_PreviousSessionTitle"));
+ // Title is intentionally a semantic marker: empty means current,
+ // non-empty means historical. ScriptLogsWindow owns the localized
+ // presentation for both branches.
+ var session = new ScriptLogSession(sessionId, startedAt,
+ isCurrentSession ? "" : "previous");
_logSessionsById[sessionId] = session;
var index = 0;
diff --git a/app/JustHostMC.App/ViewModels/ServerConfigViewModel.cs b/app/JustHostMC.App/ViewModels/ServerConfigViewModel.cs
index ec0432a..7b33018 100644
--- a/app/JustHostMC.App/ViewModels/ServerConfigViewModel.cs
+++ b/app/JustHostMC.App/ViewModels/ServerConfigViewModel.cs
@@ -9,6 +9,13 @@
namespace JustHostMC.App.ViewModels;
+public enum ConfigStatus {
+ None,
+ Saved,
+ LoadFailed,
+ SaveFailed,
+}
+
/// Loads and saves server.properties plus world gamerules.
public sealed partial class ServerConfigViewModel : ObservableObject {
private readonly string _serverId;
@@ -61,13 +68,18 @@ public partial bool GameRulesWorldExists {
public bool IsInitialLoading => IsBusy && !_loaded;
[ObservableProperty]
- public partial string StatusMessage { get; private set; } = "";
+ [NotifyPropertyChangedFor(nameof(IsSavedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsLoadFailedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsSaveFailedStatus))]
+ public partial ConfigStatus Status { get; private set; }
+
+ public bool IsSavedStatus => Status == ConfigStatus.Saved;
+ public bool IsLoadFailedStatus => Status == ConfigStatus.LoadFailed;
+ public bool IsSaveFailedStatus => Status == ConfigStatus.SaveFailed;
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(HasGameRulesMessage))]
- public partial string GameRulesMessage {
- get; private set;
- } = "";
+ public partial string GameRulesMessage { get; private set; } = "";
public bool HasGameRulesMessage =>
!string.IsNullOrWhiteSpace(GameRulesMessage);
@@ -82,8 +94,8 @@ public void PrepareInitialLoad() {
return;
RunOnUI(() => {
- IsBusy = true;
- StatusMessage = "";
+ IsBusy = true;
+ Status = ConfigStatus.None;
});
}
@@ -106,8 +118,8 @@ public async Task EnsureLoadedAsync() {
private async Task RefreshCoreAsync() {
RunOnUI(() => {
- IsBusy = true;
- StatusMessage = "";
+ IsBusy = true;
+ Status = ConfigStatus.None;
});
await Task.Yield();
@@ -130,7 +142,7 @@ private async Task RefreshCoreAsync() {
OnPropertyChanged(nameof(IsInitialLoading));
});
} catch (RpcException) {
- RunOnUI(() => StatusMessage = _localizer.Get("Config_LoadFailed"));
+ RunOnUI(() => Status = ConfigStatus.LoadFailed);
} finally {
RunOnUI(() => IsBusy = false);
}
@@ -141,8 +153,8 @@ public async Task SavePropertiesAsync() {
return;
RunOnUI(() => {
- IsBusy = true;
- StatusMessage = "";
+ IsBusy = true;
+ Status = ConfigStatus.None;
});
try {
var daemon = await App.Current.DaemonReady;
@@ -152,13 +164,10 @@ public async Task SavePropertiesAsync() {
var saved = await daemon.Config.UpdateServerPropertiesAsync(req);
RunOnUI(() => {
Replace(Properties, saved.Entries, _localizer);
- StatusMessage = _localizer.Get("Config_Saved");
+ Status = ConfigStatus.Saved;
});
- } catch (RpcException ex) {
- RunOnUI(() => StatusMessage =
- ex.Status.Detail.Length > 0
- ? ex.Status.Detail
- : _localizer.Get("Config_SaveFailed"));
+ } catch (RpcException) {
+ RunOnUI(() => Status = ConfigStatus.SaveFailed);
} finally {
RunOnUI(() => IsBusy = false);
}
@@ -169,8 +178,8 @@ public async Task SaveGameRulesAsync() {
return;
RunOnUI(() => {
- IsBusy = true;
- StatusMessage = "";
+ IsBusy = true;
+ Status = ConfigStatus.None;
});
try {
var daemon = await App.Current.DaemonReady;
@@ -181,13 +190,10 @@ public async Task SaveGameRulesAsync() {
Replace(GameRules, saved.Entries, _localizer);
GameRulesWorldExists = saved.WorldExists;
GameRulesMessage = saved.Message;
- StatusMessage = _localizer.Get("Config_Saved");
+ Status = ConfigStatus.Saved;
});
- } catch (RpcException ex) {
- RunOnUI(() => StatusMessage =
- ex.Status.Detail.Length > 0
- ? ex.Status.Detail
- : _localizer.Get("Config_SaveFailed"));
+ } catch (RpcException) {
+ RunOnUI(() => Status = ConfigStatus.SaveFailed);
} finally {
RunOnUI(() => IsBusy = false);
}
@@ -208,7 +214,7 @@ public void DiscardChanges() {
item.DiscardChanges();
foreach (var item in GameRules.Where(item => item.IsModified))
item.DiscardChanges();
- StatusMessage = "";
+ Status = ConfigStatus.None;
}
private void Replace(
diff --git a/app/JustHostMC.App/ViewModels/SettingsViewModel.cs b/app/JustHostMC.App/ViewModels/SettingsViewModel.cs
index b28bb54..3a6f176 100644
--- a/app/JustHostMC.App/ViewModels/SettingsViewModel.cs
+++ b/app/JustHostMC.App/ViewModels/SettingsViewModel.cs
@@ -7,6 +7,33 @@
namespace JustHostMC.App.ViewModels;
+public enum SettingsWorkflowStatus {
+ None,
+ LoadFailed,
+ Saved,
+ SaveFailed,
+ DockerPreferenceSaved,
+ PurgeFailed,
+ RemovingData,
+ DataRemoved,
+ RemoveDataFailed,
+ RemovingIncompleteInstallations,
+ RemoveIncompleteInstallationsFailed,
+}
+
+public enum ShopKeyConfiguration {
+ Unknown,
+ None,
+ User,
+ Builtin,
+}
+
+public enum BackendMode {
+ Unknown,
+ OnMachine,
+ Docker,
+}
+
/// Reads and updates the log retention policy and runs an on-demand
/// purge.
public sealed partial class SettingsViewModel : ObservableObject {
@@ -26,15 +53,50 @@ public partial double MaxTotalMb {
}
[ObservableProperty]
- public partial string StatusMessage {
+ public partial string DynamicStatusMessage {
get; private set;
} = "";
[ObservableProperty]
- public partial bool IsBusy {
+ [NotifyPropertyChangedFor(nameof(IsLoadFailedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsSavedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsSaveFailedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsDockerPreferenceSavedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsPurgeFailedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsRemovingDataStatus))]
+ [NotifyPropertyChangedFor(nameof(IsDataRemovedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsRemoveDataFailedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsRemovingIncompleteStatus))]
+ [NotifyPropertyChangedFor(nameof(IsRemoveIncompleteFailedStatus))]
+ public partial SettingsWorkflowStatus WorkflowStatus {
get; private set;
}
+ public bool IsLoadFailedStatus =>
+ WorkflowStatus == SettingsWorkflowStatus.LoadFailed;
+ public bool IsSavedStatus => WorkflowStatus == SettingsWorkflowStatus.Saved;
+ public bool IsSaveFailedStatus =>
+ WorkflowStatus == SettingsWorkflowStatus.SaveFailed;
+ public bool IsDockerPreferenceSavedStatus =>
+ WorkflowStatus == SettingsWorkflowStatus.DockerPreferenceSaved;
+ public bool IsPurgeFailedStatus =>
+ WorkflowStatus == SettingsWorkflowStatus.PurgeFailed;
+ public bool IsRemovingDataStatus =>
+ WorkflowStatus == SettingsWorkflowStatus.RemovingData;
+ public bool IsDataRemovedStatus =>
+ WorkflowStatus == SettingsWorkflowStatus.DataRemoved;
+ public bool IsRemoveDataFailedStatus =>
+ WorkflowStatus == SettingsWorkflowStatus.RemoveDataFailed;
+ public bool IsRemovingIncompleteStatus =>
+ WorkflowStatus ==
+ SettingsWorkflowStatus.RemovingIncompleteInstallations;
+ public bool IsRemoveIncompleteFailedStatus =>
+ WorkflowStatus ==
+ SettingsWorkflowStatus.RemoveIncompleteInstallationsFailed;
+
+ [ObservableProperty]
+ public partial bool IsBusy { get; private set; }
+
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(HasIncompleteInstallations))]
[NotifyPropertyChangedFor(nameof(IncompleteInstallationDescription))]
@@ -47,16 +109,26 @@ public partial int IncompleteInstallationCount {
_localizer.Get("Settings_IncompleteInstallationsDescription",
("count", IncompleteInstallationCount.ToString()));
- /// Localized description of the isolation backend currently in
- /// use.
[ObservableProperty]
- public partial string ActiveModeText { get; private set; } = "";
+ [NotifyPropertyChangedFor(nameof(IsDockerMode))]
+ [NotifyPropertyChangedFor(nameof(IsOnMachineMode))]
+ [NotifyPropertyChangedFor(nameof(IsDockerUnavailable))]
+ public partial BackendMode ActiveBackendMode { get; private set; }
+
+ public bool IsDockerMode => ActiveBackendMode == BackendMode.Docker;
+ public bool IsOnMachineMode => ActiveBackendMode == BackendMode.OnMachine;
- /// Localized Docker availability line.
[ObservableProperty]
- public partial string DockerStatusText {
- get; private set;
- } = "";
+ [NotifyPropertyChangedFor(nameof(IsDockerUnavailable))]
+ public partial bool IsDockerAvailable { get; private set; }
+
+ public bool IsDockerUnavailable =>
+ ActiveBackendMode != BackendMode.Unknown && !IsDockerAvailable;
+
+ /// Translator-controlled version format for the available case.
+ /// The unavailable finite label is owned by XAML.
+ [ObservableProperty]
+ public partial string DockerAvailableText { get; private set; } = "";
/// The user's Docker opt-in. Changing it persists immediately
/// (effective next launch).
@@ -78,12 +150,20 @@ public partial string AppVersionText {
[ObservableProperty]
public partial string CurseForgeKey { get; set; } = "";
- /// Localized line describing whether a CurseForge key is
- /// configured.
[ObservableProperty]
- public partial string CurseForgeKeyStatus {
+ [NotifyPropertyChangedFor(nameof(HasNoShopKey))]
+ [NotifyPropertyChangedFor(nameof(HasUserShopKey))]
+ [NotifyPropertyChangedFor(nameof(HasBuiltinShopKey))]
+ public partial ShopKeyConfiguration CurseForgeKeyConfiguration {
get; private set;
- } = "";
+ }
+
+ public bool HasNoShopKey =>
+ CurseForgeKeyConfiguration == ShopKeyConfiguration.None;
+ public bool HasUserShopKey =>
+ CurseForgeKeyConfiguration == ShopKeyConfiguration.User;
+ public bool HasBuiltinShopKey =>
+ CurseForgeKeyConfiguration == ShopKeyConfiguration.Builtin;
private bool _loadingBackend;
private bool _isLoadingLogs;
@@ -114,8 +194,7 @@ public async Task LoadAsync() {
_isLoadingLogs = false;
});
} catch (RpcException) {
- RunOnUI(() => StatusMessage =
- _localizer.Get("Settings_LoadFailed"));
+ RunOnUI(() => SetWorkflowStatus(SettingsWorkflowStatus.LoadFailed));
}
await LoadBackendAsync();
@@ -141,15 +220,15 @@ private async Task LoadShopKeysAsync() {
var daemon = await App.Current.DaemonReady;
var keys = await daemon.Settings.GetShopKeysAsync(
new Empty(), deadline: DateTime.UtcNow.AddSeconds(30));
- var status = "Settings_ShopKeyNone";
+ var status = ShopKeyConfiguration.None;
foreach (var key in keys.Keys) {
if (key.ShopId != "curseforge")
continue;
- status = key.HasUserKey ? "Settings_ShopKeyUser"
- : key.HasBuiltinKey ? "Settings_ShopKeyBuiltin"
- : "Settings_ShopKeyNone";
+ status = key.HasUserKey ? ShopKeyConfiguration.User
+ : key.HasBuiltinKey ? ShopKeyConfiguration.Builtin
+ : ShopKeyConfiguration.None;
}
- RunOnUI(() => CurseForgeKeyStatus = _localizer.Get(status));
+ RunOnUI(() => CurseForgeKeyConfiguration = status);
} catch (RpcException) {
// The shop key line stays empty; the rest of the page still works.
}
@@ -167,12 +246,11 @@ await daemon.Settings.SetShopKeyAsync(
deadline: DateTime.UtcNow.AddSeconds(30));
RunOnUI(() => {
CurseForgeKey = "";
- StatusMessage = _localizer.Get("Settings_Saved");
+ SetWorkflowStatus(SettingsWorkflowStatus.Saved);
});
await LoadShopKeysAsync();
} catch (RpcException) {
- RunOnUI(() => StatusMessage =
- _localizer.Get("Settings_SaveFailed"));
+ RunOnUI(() => SetWorkflowStatus(SettingsWorkflowStatus.SaveFailed));
}
}
@@ -182,14 +260,15 @@ private async Task LoadBackendAsync() {
var info = await daemon.Settings.GetBackendInfoAsync(
new Empty(), deadline: DateTime.UtcNow.AddSeconds(30));
RunOnUI(() => {
- ActiveModeText = _localizer.Get(info.ActiveMode == "docker"
- ? "Backend_Mode_Docker"
- : "Backend_Mode_OnMachine");
- DockerStatusText =
+ ActiveBackendMode = info.ActiveMode == "docker"
+ ? BackendMode.Docker
+ : BackendMode.OnMachine;
+ IsDockerAvailable = info.DockerAvailable;
+ DockerAvailableText =
info.DockerAvailable
? _localizer.Get("Backend_DockerAvailable",
("version", info.DockerVersion))
- : _localizer.Get("Backend_DockerUnavailable");
+ : "";
_loadingBackend = true;
UseDocker = info.UseDocker;
_loadingBackend = false;
@@ -205,11 +284,10 @@ private async Task ApplyUseDockerAsync(bool enabled) {
await daemon.Settings.SetUseDockerAsync(
new UseDocker { Enabled = enabled },
deadline: DateTime.UtcNow.AddSeconds(30));
- RunOnUI(() => StatusMessage =
- _localizer.Get("Backend_DockerPrefSaved"));
+ RunOnUI(() => SetWorkflowStatus(
+ SettingsWorkflowStatus.DockerPreferenceSaved));
} catch (RpcException) {
- RunOnUI(() => StatusMessage =
- _localizer.Get("Settings_SaveFailed"));
+ RunOnUI(() => SetWorkflowStatus(SettingsWorkflowStatus.SaveFailed));
}
}
@@ -249,13 +327,13 @@ private async Task PurgeNow() {
await Save();
var result = await daemon.Settings.PurgeLogsAsync(
new Empty(), deadline: DateTime.UtcNow.AddMinutes(2));
- RunOnUI(() => StatusMessage = _localizer.Get(
+ RunOnUI(() => SetDynamicStatus(_localizer.Get(
"Settings_PurgeResult",
("count", result.RemovedFiles.ToString()),
- ("size", FormatSize(result.FreedBytes))));
+ ("size", FormatSize(result.FreedBytes)))));
} catch (RpcException) {
- RunOnUI(() => StatusMessage =
- _localizer.Get("Settings_PurgeFailed"));
+ RunOnUI(() =>
+ SetWorkflowStatus(SettingsWorkflowStatus.PurgeFailed));
} finally {
RunOnUI(() => IsBusy = false);
}
@@ -264,18 +342,18 @@ private async Task PurgeNow() {
[RelayCommand]
private async Task RemoveAllData() {
RunOnUI(() => {
- IsBusy = true;
- StatusMessage = _localizer.Get("Settings_RemovingData");
+ IsBusy = true;
+ SetWorkflowStatus(SettingsWorkflowStatus.RemovingData);
});
try {
var daemon = await App.Current.DaemonReady;
await daemon.Servers.RemoveAllDataAsync(
new Empty(), deadline: DateTime.UtcNow.AddMinutes(2));
- RunOnUI(() => StatusMessage =
- _localizer.Get("Settings_DataRemoved"));
+ RunOnUI(() =>
+ SetWorkflowStatus(SettingsWorkflowStatus.DataRemoved));
} catch (RpcException) {
- RunOnUI(() => StatusMessage =
- _localizer.Get("Settings_RemoveDataFailed"));
+ RunOnUI(() => SetWorkflowStatus(
+ SettingsWorkflowStatus.RemoveDataFailed));
} finally {
RunOnUI(() => IsBusy = false);
}
@@ -285,8 +363,8 @@ await daemon.Servers.RemoveAllDataAsync(
private async Task RemoveIncompleteInstallations() {
RunOnUI(() => {
IsBusy = true;
- StatusMessage =
- _localizer.Get("Settings_RemovingIncompleteInstallations");
+ SetWorkflowStatus(
+ SettingsWorkflowStatus.RemovingIncompleteInstallations);
});
try {
var daemon = await App.Current.DaemonReady;
@@ -301,12 +379,13 @@ await daemon.Servers.DeleteAsync(
new ServerId { Id = server.Id },
deadline: DateTime.UtcNow.AddMinutes(2));
}
- RunOnUI(() => StatusMessage = _localizer.Get(
+ RunOnUI(() => SetDynamicStatus(_localizer.Get(
"Settings_IncompleteInstallationsRemoved",
- ("count", incomplete.Length.ToString())));
+ ("count", incomplete.Length.ToString()))));
} catch (RpcException) {
- RunOnUI(() => StatusMessage = _localizer.Get(
- "Settings_RemoveIncompleteInstallationsFailed"));
+ RunOnUI(() => SetWorkflowStatus(
+ SettingsWorkflowStatus
+ .RemoveIncompleteInstallationsFailed));
} finally {
await RefreshIncompleteInstallationsAsync();
RunOnUI(() => IsBusy = false);
@@ -324,6 +403,16 @@ private static string FormatSize(long bytes) {
return $"{value:0.#} {units[unit]}";
}
+ private void SetWorkflowStatus(SettingsWorkflowStatus status) {
+ DynamicStatusMessage = "";
+ WorkflowStatus = status;
+ }
+
+ private void SetDynamicStatus(string message) {
+ WorkflowStatus = SettingsWorkflowStatus.None;
+ DynamicStatusMessage = message;
+ }
+
private void RunOnUI(Action action) {
if (_dispatcher.HasThreadAccess)
action();
diff --git a/app/JustHostMC.App/ViewModels/ShopDetailViewModel.cs b/app/JustHostMC.App/ViewModels/ShopDetailViewModel.cs
index 07de61d..18bb831 100644
--- a/app/JustHostMC.App/ViewModels/ShopDetailViewModel.cs
+++ b/app/JustHostMC.App/ViewModels/ShopDetailViewModel.cs
@@ -9,6 +9,13 @@
namespace JustHostMC.App.ViewModels;
+public enum ShopDetailStatus {
+ None,
+ LoadFailed,
+ InstallDone,
+ InstallFailed,
+}
+
/// One project's detail page: header card, gallery, rendered body,
/// compatible versions, and the install flow (dependency prompt + streamed
/// progress).
@@ -55,10 +62,10 @@ public partial ShopVersionItem? LatestRelease {
public bool IsWebsiteAction =>
PrimaryAction.Kind == ShopPrimaryActionKind.Website;
- public string PrimaryActionLabel =>
+ public string WebsiteActionLabel =>
IsWebsiteAction
? _localizer.Get("Shop_GetOnSource", ("source", SourceName))
- : _localizer.Get("Shop_InstallAction");
+ : "";
public bool CanInstallLatest =>
LatestRelease is not null && PrimaryAction.IsEnabled && !IsInstalling;
@@ -87,15 +94,32 @@ public partial double InstallProgress {
}
[ObservableProperty]
+ [NotifyPropertyChangedFor(nameof(HasStatus))]
public partial string StatusMessage {
get; private set;
} = "";
[ObservableProperty]
- public partial bool InstallSucceeded {
+ [NotifyPropertyChangedFor(nameof(HasStatus))]
+ [NotifyPropertyChangedFor(nameof(IsLoadFailedStatus))]
+ [NotifyPropertyChangedFor(nameof(IsInstallDoneStatus))]
+ [NotifyPropertyChangedFor(nameof(IsInstallFailedStatus))]
+ public partial ShopDetailStatus DetailStatus {
get; private set;
}
+ public bool HasStatus => DetailStatus != ShopDetailStatus.None ||
+ !string.IsNullOrWhiteSpace(StatusMessage);
+ public bool IsLoadFailedStatus =>
+ DetailStatus == ShopDetailStatus.LoadFailed;
+ public bool IsInstallDoneStatus =>
+ DetailStatus == ShopDetailStatus.InstallDone;
+ public bool IsInstallFailedStatus =>
+ DetailStatus == ShopDetailStatus.InstallFailed;
+
+ [ObservableProperty]
+ public partial bool InstallSucceeded { get; private set; }
+
[ObservableProperty]
public partial string WebsiteUrl {
get; private set;
@@ -134,8 +158,8 @@ await RunOnUIAsync(() => {
RefreshPrimaryAction();
});
} catch {
- await RunOnUIAsync(() => StatusMessage =
- _localizer.Get("Shop_LoadFailed"));
+ await RunOnUIAsync(() => DetailStatus =
+ ShopDetailStatus.LoadFailed);
} finally {
await RunOnUIAsync(() => IsLoading = false);
}
@@ -167,8 +191,8 @@ await RunOnUIAsync(() => {
RefreshPrimaryAction();
});
} catch {
- await RunOnUIAsync(() => StatusMessage =
- _localizer.Get("Shop_LoadFailed"));
+ await RunOnUIAsync(() => DetailStatus =
+ ShopDetailStatus.LoadFailed);
} finally {
await RunOnUIAsync(() => IsVersionsLoading = false);
}
@@ -206,6 +230,7 @@ await RunOnUIAsync(() => {
InstallSucceeded = false;
InstallProgress = 0;
StatusMessage = "";
+ DetailStatus = ShopDetailStatus.None;
});
try {
var daemon = await App.Current.DaemonReady;
@@ -228,15 +253,18 @@ await RunOnUIAsync(() => {
}
await RunOnUIAsync(() => {
InstallSucceeded = true;
- StatusMessage = _localizer.Get("Shop_InstallDone");
+ DetailStatus = ShopDetailStatus.InstallDone;
});
_shop.Context.OnInstalled();
} catch (RpcException ex) {
var key = ErrorKey(ex);
- await RunOnUIAsync(() => StatusMessage = _localizer.Get(key));
+ await RunOnUIAsync(() => {
+ DetailStatus = ShopDetailStatus.None;
+ StatusMessage = _localizer.Get(key);
+ });
} catch {
- await RunOnUIAsync(() => StatusMessage =
- _localizer.Get("Shop_InstallFailed"));
+ await RunOnUIAsync(() => DetailStatus =
+ ShopDetailStatus.InstallFailed);
} finally {
await RunOnUIAsync(() => { IsInstalling = false; });
}
@@ -247,9 +275,9 @@ await RunOnUIAsync(() => StatusMessage =
private void RefreshPrimaryAction() {
OnPropertyChanged(nameof(PrimaryAction));
OnPropertyChanged(nameof(IsWebsiteAction));
- OnPropertyChanged(nameof(PrimaryActionLabel));
+ OnPropertyChanged(nameof(WebsiteActionLabel));
OnPropertyChanged(nameof(CanInstallLatest));
- var label = PrimaryActionLabel;
+ var label = WebsiteActionLabel;
var enabled = PrimaryAction.IsEnabled && !IsInstalling;
foreach (var version in Versions) {
version.ActionLabel = label;
diff --git a/app/JustHostMC.App/ViewModels/ShopViewModel.cs b/app/JustHostMC.App/ViewModels/ShopViewModel.cs
index 22408e1..8678aa5 100644
--- a/app/JustHostMC.App/ViewModels/ShopViewModel.cs
+++ b/app/JustHostMC.App/ViewModels/ShopViewModel.cs
@@ -68,9 +68,9 @@ public partial bool IsSearchLoading {
}
[ObservableProperty]
- public partial string StatusMessage {
+ public partial bool HasLoadFailure {
get; private set;
- } = "";
+ }
[ObservableProperty]
public partial string Query {
@@ -97,8 +97,8 @@ partial void OnSelectedShopChanged(ShopInfo? value) {
// source.
Interlocked.Increment(ref _homeGeneration);
HomeSections.Clear();
- IsHomeLoading = false;
- StatusMessage = "";
+ IsHomeLoading = false;
+ HasLoadFailure = false;
OnPropertyChanged(nameof(SelectedShopName));
var categoryGeneration = Interlocked.Increment(ref _categoryGeneration);
@@ -181,8 +181,7 @@ await RunOnUIAsync(() => {
list.Shops.FirstOrDefault();
});
} catch {
- await RunOnUIAsync(() => StatusMessage =
- _localizer.Get("Shop_LoadFailed"));
+ await RunOnUIAsync(() => HasLoadFailure = true);
}
}
@@ -196,8 +195,8 @@ public async Task LoadHomeAsync() {
}
var generation = Interlocked.Increment(ref _homeGeneration);
await RunOnUIAsync(() => {
- IsHomeLoading = true;
- StatusMessage = "";
+ IsHomeLoading = true;
+ HasLoadFailure = false;
});
try {
var daemon = await App.Current.DaemonReady;
@@ -228,7 +227,7 @@ await RunOnUIAsync(() => {
} catch {
await RunOnUIAsync(() => {
if (generation == _homeGeneration)
- StatusMessage = _localizer.Get("Shop_LoadFailed");
+ HasLoadFailure = true;
});
} finally {
await RunOnUIAsync(() => {
@@ -239,7 +238,7 @@ await RunOnUIAsync(() => {
}
private string GetSectionDescription(string titleKey) {
- var descriptionKey = $"{titleKey}.description";
+ var descriptionKey = $"{titleKey}_description";
var description = _localizer.Get(descriptionKey);
return description == descriptionKey ? "" : description;
}
@@ -247,8 +246,8 @@ private string GetSectionDescription(string titleKey) {
/// Starts a fresh search for the current query/filters.
public async Task StartSearchAsync() {
await RunOnUIAsync(() => {
- StatusMessage = "";
- TotalResults = 0;
+ HasLoadFailure = false;
+ TotalResults = 0;
SearchResults.Reset();
});
// The ListView pulls the first page through ISupportIncrementalLoading,
@@ -283,8 +282,7 @@ private async Task> LoadSearchPageAsync(
await RunOnUIAsync(() => TotalResults = page.Total);
return page.Projects.Select(p => new ShopProjectItem(p)).ToArray();
} catch {
- await RunOnUIAsync(() => StatusMessage =
- _localizer.Get("Shop_LoadFailed"));
+ await RunOnUIAsync(() => HasLoadFailure = true);
return Array.Empty();
} finally {
await RunOnUIAsync(() => IsSearchLoading = false);
diff --git a/app/JustHostMC.App/Views/BackupsContentDialog.xaml b/app/JustHostMC.App/Views/BackupsContentDialog.xaml
new file mode 100644
index 0000000..0066890
--- /dev/null
+++ b/app/JustHostMC.App/Views/BackupsContentDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/BackupsContentDialog.xaml.cs b/app/JustHostMC.App/Views/BackupsContentDialog.xaml.cs
new file mode 100644
index 0000000..3782b08
--- /dev/null
+++ b/app/JustHostMC.App/Views/BackupsContentDialog.xaml.cs
@@ -0,0 +1,22 @@
+using JustHostMC.App.Controls;
+using Microsoft.UI.Dispatching;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class BackupsContentDialog : ContentDialog {
+ private readonly BackupsDialog _content;
+
+ public BackupsContentDialog(string serverId, string serverName,
+ bool serverRunning,
+ DispatcherQueue dispatcher) {
+ InitializeComponent();
+ ContentDialogSizing.Apply(this, useWideLayout: true);
+ Title = serverName;
+
+ _content =
+ new BackupsDialog(serverId, serverName, serverRunning, dispatcher);
+ DialogBody.Content = _content;
+ Opened += async (_, _) => await _content.LoadAsync();
+ }
+}
diff --git a/app/JustHostMC.App/Views/BackupsDialog.xaml b/app/JustHostMC.App/Views/BackupsDialog.xaml
index a4c798c..07d040d 100644
--- a/app/JustHostMC.App/Views/BackupsDialog.xaml
+++ b/app/JustHostMC.App/Views/BackupsDialog.xaml
@@ -87,7 +87,7 @@
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextAlignment="Center"
TextWrapping="WrapWholeWords"
- Visibility="{x:Bind ViewModel.Backups.Count, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=invert}" />
+ Visibility="{x:Bind ShowWhenEmpty(ViewModel.Backups.Count), Mode=OneWay}" />
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/BackupsDialog.xaml.cs b/app/JustHostMC.App/Views/BackupsDialog.xaml.cs
index 47fbaf4..18d1819 100644
--- a/app/JustHostMC.App/Views/BackupsDialog.xaml.cs
+++ b/app/JustHostMC.App/Views/BackupsDialog.xaml.cs
@@ -14,7 +14,6 @@ namespace JustHostMC.App.Views;
public sealed partial class BackupsDialog : UserControl {
private readonly string _serverId;
private readonly string _serverName;
- private readonly ILocalizer _localizer = new LocalizationService();
public BackupsViewModel ViewModel { get; }
@@ -23,7 +22,7 @@ public BackupsDialog(string serverId, string serverName, bool serverRunning,
_serverId = serverId;
_serverName = serverName;
ViewModel = new BackupsViewModel(serverId, serverRunning, dispatcher,
- _localizer);
+ new LocalizationService());
InitializeComponent();
}
@@ -33,6 +32,10 @@ public BackupsDialog(string serverId, string serverName, bool serverRunning,
/// busy.
public bool Not(bool value) => !value;
+ public Visibility ShowWhenEmpty(int count) => count == 0
+ ? Visibility.Visible
+ : Visibility.Collapsed;
+
private async void OnExportBackupClick(object sender, RoutedEventArgs e) {
if (ViewModel.IsBusy)
return;
@@ -42,8 +45,7 @@ private async void OnExportBackupClick(object sender, RoutedEventArgs e) {
var source = FindBackupFile(item);
if (source is null) {
- ViewModel.StatusMessage =
- _localizer.Get("Backups_ExportSourceMissing");
+ ViewModel.ReportExportSourceMissing();
return;
}
@@ -62,11 +64,10 @@ private async void OnExportBackupClick(object sender, RoutedEventArgs e) {
try {
File.Copy(source, file.Path, overwrite: true);
- ViewModel.StatusMessage =
- _localizer.Get("Backups_Exported", ("path", file.Path));
+ ViewModel.ReportExported(file.Path);
} catch (Exception ex)
when (ex is IOException or UnauthorizedAccessException) {
- ViewModel.StatusMessage = _localizer.Get("Backups_ExportFailed");
+ ViewModel.ReportExportFailed();
}
}
@@ -78,7 +79,7 @@ private void OnRestoreBackupConfirmClick(object sender, RoutedEventArgs e) {
return;
if (!ViewModel.CanRestore) {
- ViewModel.StatusMessage = _localizer.Get("error.server_running");
+ ViewModel.ReportRestoreBlocked();
return;
}
@@ -102,7 +103,7 @@ sender is FrameworkElement element
private void OnOpenBackupFolderClick(object sender, RoutedEventArgs e) {
var folder = BackupRoots().FirstOrDefault(Directory.Exists);
if (folder is null) {
- ViewModel.StatusMessage = _localizer.Get("Backups_FolderMissing");
+ ViewModel.ReportFolderMissing();
return;
}
diff --git a/app/JustHostMC.App/Views/BanListContentDialog.xaml b/app/JustHostMC.App/Views/BanListContentDialog.xaml
new file mode 100644
index 0000000..fb3a264
--- /dev/null
+++ b/app/JustHostMC.App/Views/BanListContentDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/BanListContentDialog.xaml.cs b/app/JustHostMC.App/Views/BanListContentDialog.xaml.cs
new file mode 100644
index 0000000..a983491
--- /dev/null
+++ b/app/JustHostMC.App/Views/BanListContentDialog.xaml.cs
@@ -0,0 +1,15 @@
+using JustHostMC.App.Controls;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class BanListContentDialog : ContentDialog {
+ public BanListDialog Body { get; }
+
+ public BanListContentDialog(string serverId, bool canModify) {
+ Body = new BanListDialog(serverId, canModify);
+ InitializeComponent();
+ ContentDialogSizing.Apply(this, useWideLayout: true);
+ Opened += async (_, _) => await Body.LoadAsync();
+ }
+}
diff --git a/app/JustHostMC.App/Views/BanListDialog.xaml b/app/JustHostMC.App/Views/BanListDialog.xaml
index 484a3be..95ddaeb 100644
--- a/app/JustHostMC.App/Views/BanListDialog.xaml
+++ b/app/JustHostMC.App/Views/BanListDialog.xaml
@@ -18,13 +18,12 @@
+ Visibility="{x:Bind CanModify, Converter={StaticResource BoolToVis}, ConverterParameter=True}" />
-
+
+
+
+
-
+
+
+
+
@@ -220,9 +235,25 @@
IsIndeterminate="True"
Visibility="Collapsed" />
+ x:Name="LoadFailedText"
+ x:Uid="BanListLoadFailedText"
+ Visibility="Collapsed" />
+
+
+
+
diff --git a/app/JustHostMC.App/Views/BanListDialog.xaml.cs b/app/JustHostMC.App/Views/BanListDialog.xaml.cs
index 6ed4339..e360052 100644
--- a/app/JustHostMC.App/Views/BanListDialog.xaml.cs
+++ b/app/JustHostMC.App/Views/BanListDialog.xaml.cs
@@ -1,7 +1,6 @@
using System.Collections.ObjectModel;
using Grpc.Core;
using JustHostMC.App.Models;
-using JustHostMC.App.Services;
using McManager.Grpc;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
@@ -12,36 +11,29 @@ namespace JustHostMC.App.Views;
/// banned-ips.json.
public sealed partial class BanListDialog : UserControl {
private readonly string _serverId;
- private readonly ILocalizer _localizer = new LocalizationService();
public ObservableCollection Bans { get; } = new();
public bool CanModify { get; }
- public string StoppedNoticeTitle { get; }
- public string StoppedNoticeMessage { get; }
public BanListDialog(string serverId, bool canModify) {
- _serverId = serverId;
- CanModify = canModify;
- StoppedNoticeTitle = _localizer.Get("BanListStoppedNotice_Title");
- StoppedNoticeMessage = _localizer.Get("BanListStoppedNotice_Message");
+ _serverId = serverId;
+ CanModify = canModify;
InitializeComponent();
}
public async Task LoadAsync() {
BusyBar.Visibility = Visibility.Visible;
- StatusText.Text = "";
+ ClearStatus();
try {
var daemon = await App.Current.DaemonReady;
var list = await daemon.Players.ListBansAsync(
new ServerId { Id = _serverId });
Bans.Clear();
foreach (var entry in list.Entries)
- Bans.Add(new BanEntryItem(entry, _localizer));
+ Bans.Add(new BanEntryItem(entry));
UpdateEmptyState();
- } catch (RpcException ex) {
- StatusText.Text = ex.Status.Detail.Length > 0
- ? ex.Status.Detail
- : _localizer.Get("BanList_LoadFailed");
+ } catch (RpcException) {
+ ShowStatus(LoadFailedText);
} finally {
BusyBar.Visibility = Visibility.Collapsed;
}
@@ -52,12 +44,12 @@ private async void OnAddClick(object sender, RoutedEventArgs e) {
return;
var target = TargetBox.Text.Trim();
if (target.Length == 0) {
- StatusText.Text = _localizer.Get("BanList_TargetRequired");
+ ShowStatus(TargetRequiredText);
return;
}
BusyBar.Visibility = Visibility.Visible;
- StatusText.Text = "";
+ ClearStatus();
try {
var daemon = await App.Current.DaemonReady;
await daemon.Players.AddBanAsync(new AddBanRequest {
@@ -70,10 +62,8 @@ await daemon.Players.AddBanAsync(new AddBanRequest {
TargetBox.Text = "";
ReasonBox.Text = "";
await LoadAsync();
- } catch (RpcException ex) {
- StatusText.Text = ex.Status.Detail.Length > 0
- ? ex.Status.Detail
- : _localizer.Get("BanList_AddFailed");
+ } catch (RpcException) {
+ ShowStatus(AddFailedText);
} finally {
BusyBar.Visibility = Visibility.Collapsed;
}
@@ -81,14 +71,14 @@ await daemon.Players.AddBanAsync(new AddBanRequest {
private async void OnRemoveClick(object sender, RoutedEventArgs e) {
if (!CanModify) {
- StatusText.Text = _localizer.Get("BanList_StoppedRequired");
+ ShowStatus(StoppedRequiredText);
return;
}
if (sender is not FrameworkElement { Tag : BanEntryItem item })
return;
BusyBar.Visibility = Visibility.Visible;
- StatusText.Text = "";
+ ClearStatus();
try {
var daemon = await App.Current.DaemonReady;
await daemon.Players.RemoveBanAsync(new RemoveBanRequest {
@@ -97,10 +87,8 @@ await daemon.Players.RemoveBanAsync(new RemoveBanRequest {
Target = item.Target,
});
await LoadAsync();
- } catch (RpcException ex) {
- StatusText.Text = ex.Status.Detail.Length > 0
- ? ex.Status.Detail
- : _localizer.Get("BanList_RemoveFailed");
+ } catch (RpcException) {
+ ShowStatus(RemoveFailedText);
} finally {
BusyBar.Visibility = Visibility.Collapsed;
}
@@ -108,4 +96,19 @@ await daemon.Players.RemoveBanAsync(new RemoveBanRequest {
private void UpdateEmptyState() => EmptyHint.Visibility =
Bans.Count == 0 ? Visibility.Visible : Visibility.Collapsed;
+
+ private void ClearStatus() {
+ foreach (var text in StatusElements)
+ text.Visibility = Visibility.Collapsed;
+ }
+
+ private void ShowStatus(TextBlock status) {
+ ClearStatus();
+ status.Visibility = Visibility.Visible;
+ }
+
+ private IEnumerable
+ StatusElements => [LoadFailedText, TargetRequiredText, AddFailedText,
+ StoppedRequiredText, RemoveFailedText,
+ ];
}
diff --git a/app/JustHostMC.App/Views/CloseBusyDialog.xaml b/app/JustHostMC.App/Views/CloseBusyDialog.xaml
new file mode 100644
index 0000000..1ddf7f1
--- /dev/null
+++ b/app/JustHostMC.App/Views/CloseBusyDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/CloseBusyDialog.xaml.cs b/app/JustHostMC.App/Views/CloseBusyDialog.xaml.cs
new file mode 100644
index 0000000..8071a07
--- /dev/null
+++ b/app/JustHostMC.App/Views/CloseBusyDialog.xaml.cs
@@ -0,0 +1,11 @@
+using JustHostMC.App.Controls;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class CloseBusyDialog : ContentDialog {
+ public CloseBusyDialog() {
+ InitializeComponent();
+ ContentDialogSizing.Apply(this);
+ }
+}
diff --git a/app/JustHostMC.App/Views/CreateServerDialog.xaml b/app/JustHostMC.App/Views/CreateServerDialog.xaml
new file mode 100644
index 0000000..d36e717
--- /dev/null
+++ b/app/JustHostMC.App/Views/CreateServerDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/CreateServerDialog.xaml.cs b/app/JustHostMC.App/Views/CreateServerDialog.xaml.cs
new file mode 100644
index 0000000..3c8c8f7
--- /dev/null
+++ b/app/JustHostMC.App/Views/CreateServerDialog.xaml.cs
@@ -0,0 +1,24 @@
+using JustHostMC.App.Controls;
+using JustHostMC.App.ViewModels;
+using McManager.Grpc;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class CreateServerDialog : ContentDialog {
+ private readonly ServerDialog _content;
+
+ public CreateServerDialog(MainViewModel viewModel) {
+ InitializeComponent();
+ ContentDialogSizing.Apply(this);
+ _content = new ServerDialog(viewModel, ServerDialogMode.Create);
+ DialogBody.Content = _content;
+
+ IsPrimaryButtonEnabled = _content.CanSubmit;
+ _content.CanSubmitChanged += (_, _) => IsPrimaryButtonEnabled =
+ _content.CanSubmit;
+ }
+
+ public CreateServerRequest? BuildCreateRequest() =>
+ _content.BuildCreateRequest();
+}
diff --git a/app/JustHostMC.App/Views/DeleteServerDialog.xaml b/app/JustHostMC.App/Views/DeleteServerDialog.xaml
new file mode 100644
index 0000000..b777186
--- /dev/null
+++ b/app/JustHostMC.App/Views/DeleteServerDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/DeleteServerDialog.xaml.cs b/app/JustHostMC.App/Views/DeleteServerDialog.xaml.cs
new file mode 100644
index 0000000..d82bf5b
--- /dev/null
+++ b/app/JustHostMC.App/Views/DeleteServerDialog.xaml.cs
@@ -0,0 +1,11 @@
+using JustHostMC.App.Controls;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class DeleteServerDialog : ContentDialog {
+ public DeleteServerDialog() {
+ InitializeComponent();
+ ContentDialogSizing.Apply(this);
+ }
+}
diff --git a/app/JustHostMC.App/Views/EditServerDialog.xaml b/app/JustHostMC.App/Views/EditServerDialog.xaml
new file mode 100644
index 0000000..beef37b
--- /dev/null
+++ b/app/JustHostMC.App/Views/EditServerDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/EditServerDialog.xaml.cs b/app/JustHostMC.App/Views/EditServerDialog.xaml.cs
new file mode 100644
index 0000000..0e1317e
--- /dev/null
+++ b/app/JustHostMC.App/Views/EditServerDialog.xaml.cs
@@ -0,0 +1,25 @@
+using JustHostMC.App.Controls;
+using JustHostMC.App.Models;
+using JustHostMC.App.ViewModels;
+using McManager.Grpc;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class EditServerDialog : ContentDialog {
+ private readonly ServerDialog _content;
+
+ public EditServerDialog(MainViewModel viewModel, ServerItem server) {
+ InitializeComponent();
+ ContentDialogSizing.Apply(this);
+ _content = new ServerDialog(viewModel, ServerDialogMode.Edit, server);
+ DialogBody.Content = _content;
+
+ IsPrimaryButtonEnabled = _content.CanSubmit;
+ _content.CanSubmitChanged += (_, _) => IsPrimaryButtonEnabled =
+ _content.CanSubmit;
+ }
+
+ public UpdateServerRequest BuildUpdateRequest() =>
+ _content.BuildUpdateRequest();
+}
diff --git a/app/JustHostMC.App/Views/EngineStdioWindow.xaml b/app/JustHostMC.App/Views/EngineStdioWindow.xaml
index 3b3cd35..9a44397 100644
--- a/app/JustHostMC.App/Views/EngineStdioWindow.xaml
+++ b/app/JustHostMC.App/Views/EngineStdioWindow.xaml
@@ -19,7 +19,7 @@
-
+
diff --git a/app/JustHostMC.App/Views/EngineStdioWindow.xaml.cs b/app/JustHostMC.App/Views/EngineStdioWindow.xaml.cs
index 7613b2a..894b6e0 100644
--- a/app/JustHostMC.App/Views/EngineStdioWindow.xaml.cs
+++ b/app/JustHostMC.App/Views/EngineStdioWindow.xaml.cs
@@ -36,12 +36,10 @@ public ObservableCollection VisibleEntries {
public EngineStdioWindow(EngineHost host) {
_host = host;
InitializeComponent();
+ Title = MonitorTitleBar.Title;
InitializeFilterGroups();
_isInitialized = true;
- var title = _localizer.Get("EngineMonitor_Title");
- Title = title;
- MonitorTitleBar.Title = title;
ExtendsContentIntoTitleBar = true;
AppWindow.Resize(new SizeInt32(1040, 700));
diff --git a/app/JustHostMC.App/Views/HomePage.xaml b/app/JustHostMC.App/Views/HomePage.xaml
index b52ae24..21d83e7 100644
--- a/app/JustHostMC.App/Views/HomePage.xaml
+++ b/app/JustHostMC.App/Views/HomePage.xaml
@@ -87,9 +87,19 @@
+ Visibility="{Binding IsIncompleteInstallation, Converter={StaticResource BoolToVis}, ConverterParameter=True}">
+
+
+
+
+
@@ -104,10 +114,36 @@
Orientation="Horizontal"
Spacing="8">
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
-
+ VerticalAlignment="Center">
+
+
+
@@ -224,7 +303,13 @@
Orientation="Horizontal"
Spacing="8">
-
+
+
+
+
+
+
+
@@ -313,10 +398,23 @@
-
+
+
+
+
+
.
public sealed partial class HomePage : Page {
private readonly FirstRunService _firstRun = new();
- private readonly ILocalizer _localizer = new LocalizationService();
private readonly AddCard _addCard = new();
private NavShellViewModel _shell = null!;
@@ -88,20 +87,10 @@ private async void OnCardDeleteClick(object sender, RoutedEventArgs e) {
if (!TryGetServerItem(sender, out var item))
return;
- var confirm = new ContentDialog {
- XamlRoot = XamlRoot,
- Title = _localizer.Get(item.IsIncompleteInstallation
- ? "ServerInstallRemove_Title"
- : "ServerDelete_Title"),
- Content = _localizer.Get(item.IsIncompleteInstallation
- ? "ServerInstallRemove_Body"
- : "ServerDelete_Body"),
- PrimaryButtonText = _localizer.Get(
- item.IsIncompleteInstallation ? "ServerInstallRemove_Confirm"
- : "ServerDelete_Confirm"),
- CloseButtonText = _localizer.Get("Common_Cancel"),
- DefaultButton = ContentDialogButton.Close,
- };
+ ContentDialog confirm = item.IsIncompleteInstallation
+ ? new IncompleteServerRemovalDialog()
+ : new DeleteServerDialog();
+ confirm.XamlRoot = XamlRoot;
if (await confirm.ShowAsync() == ContentDialogResult.Primary)
Main.DeleteServerCommand.Execute(item);
}
@@ -116,27 +105,13 @@ private void OnCardCopyAddressClick(object sender, RoutedEventArgs e) {
}
private async void OnAddCardClick(object sender, RoutedEventArgs e) {
- var content = new ServerDialog(Main, ServerDialogMode.Create);
- var dialog = new ContentDialog {
+ var dialog = new CreateServerDialog(Main) {
XamlRoot = XamlRoot,
- Style = Application.Current
- .Resources["DefaultContentDialogStyle"] as Style,
- Title = _localizer.Get("CreateServerDialog_Title"),
- Content = content,
- PrimaryButtonText =
- _localizer.Get("CreateServerDialog_PrimaryButtonText"),
- CloseButtonText =
- _localizer.Get("CreateServerDialog_CloseButtonText"),
- DefaultButton = ContentDialogButton.Primary,
- IsPrimaryButtonEnabled = content.CanSubmit,
};
- content.CanSubmitChanged += (_, _) => dialog.IsPrimaryButtonEnabled =
- content.CanSubmit;
- ContentDialogSizing.Apply(dialog);
if (await dialog.ShowAsync() != ContentDialogResult.Primary)
return;
- if (content.BuildCreateRequest() is {} request)
+ if (dialog.BuildCreateRequest() is {} request)
await Main.InstallServerAsync(request);
}
@@ -144,45 +119,21 @@ private void OnMachineNoticeClosed(InfoBar sender, object args) =>
_firstRun.MarkOnMachineNoticeShown();
private async Task ShowEditDialogAsync(ServerItem item) {
- var content = new ServerDialog(Main, ServerDialogMode.Edit, item);
- var dialog = new ContentDialog {
+ var dialog = new EditServerDialog(Main, item) {
XamlRoot = XamlRoot,
- Style = Application.Current
- .Resources["DefaultContentDialogStyle"] as Style,
- Title = _localizer.Get("EditServerDialog_Title"),
- Content = content,
- PrimaryButtonText =
- _localizer.Get("EditServerDialog_PrimaryButtonText"),
- CloseButtonText =
- _localizer.Get("EditServerDialog_CloseButtonText"),
- DefaultButton = ContentDialogButton.Primary,
- IsPrimaryButtonEnabled = content.CanSubmit,
};
- content.CanSubmitChanged += (_, _) => dialog.IsPrimaryButtonEnabled =
- content.CanSubmit;
- ContentDialogSizing.Apply(dialog);
if (await dialog.ShowAsync() == ContentDialogResult.Primary)
- await Main.UpdateServerAsync(content.BuildUpdateRequest());
+ await Main.UpdateServerAsync(dialog.BuildUpdateRequest());
}
private async Task ShowRenameDialogAsync(ServerItem item) {
- var nameBox = new TextBox {
- Text = item.Name,
- Header = _localizer.Get("EditServerName_Header"),
- SelectionStart = 0,
- SelectionLength = item.Name.Length,
- };
- var dialog = new ContentDialog {
- XamlRoot = XamlRoot,
- Title = _localizer.Get("RenameServerDialog_Title"),
- Content = nameBox,
- PrimaryButtonText = _localizer.Get("Common_Save"),
- CloseButtonText = _localizer.Get("Common_Cancel"),
- DefaultButton = ContentDialogButton.Primary,
+ var dialog = new RenameServerDialog(item.Name) {
+ XamlRoot = XamlRoot,
};
+
if (await dialog.ShowAsync() == ContentDialogResult.Primary)
- await Main.RenameServerAsync(item, nameBox.Text);
+ await Main.RenameServerAsync(item, dialog.ServerName);
}
private static bool TryGetServerItem(object sender, out ServerItem item) {
diff --git a/app/JustHostMC.App/Views/IncompleteServerRemovalDialog.xaml b/app/JustHostMC.App/Views/IncompleteServerRemovalDialog.xaml
new file mode 100644
index 0000000..0ada498
--- /dev/null
+++ b/app/JustHostMC.App/Views/IncompleteServerRemovalDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/IncompleteServerRemovalDialog.xaml.cs b/app/JustHostMC.App/Views/IncompleteServerRemovalDialog.xaml.cs
new file mode 100644
index 0000000..4c13423
--- /dev/null
+++ b/app/JustHostMC.App/Views/IncompleteServerRemovalDialog.xaml.cs
@@ -0,0 +1,11 @@
+using JustHostMC.App.Controls;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class IncompleteServerRemovalDialog : ContentDialog {
+ public IncompleteServerRemovalDialog() {
+ InitializeComponent();
+ ContentDialogSizing.Apply(this);
+ }
+}
diff --git a/app/JustHostMC.App/Views/PermissionConsentContentDialog.xaml b/app/JustHostMC.App/Views/PermissionConsentContentDialog.xaml
new file mode 100644
index 0000000..231dcf5
--- /dev/null
+++ b/app/JustHostMC.App/Views/PermissionConsentContentDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/PermissionConsentContentDialog.xaml.cs b/app/JustHostMC.App/Views/PermissionConsentContentDialog.xaml.cs
new file mode 100644
index 0000000..7605111
--- /dev/null
+++ b/app/JustHostMC.App/Views/PermissionConsentContentDialog.xaml.cs
@@ -0,0 +1,21 @@
+using JustHostMC.App.Controls;
+using McManager.Grpc;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class PermissionConsentContentDialog : ContentDialog {
+ public PermissionConsentDialog Body { get; }
+
+ public PermissionConsentContentDialog(string scriptName,
+ IEnumerable permissions) {
+ Body = new PermissionConsentDialog(permissions);
+ InitializeComponent();
+ ContentDialogSizing.Apply(this);
+
+ Title = Title?.ToString()?.Replace("{name}", scriptName,
+ StringComparison.Ordinal);
+ }
+
+ public IReadOnlyList Granted => Body.Granted;
+}
diff --git a/app/JustHostMC.App/Views/PermissionConsentDialog.xaml b/app/JustHostMC.App/Views/PermissionConsentDialog.xaml
index 0120bdf..82c40ea 100644
--- a/app/JustHostMC.App/Views/PermissionConsentDialog.xaml
+++ b/app/JustHostMC.App/Views/PermissionConsentDialog.xaml
@@ -3,6 +3,7 @@
x:Class="JustHostMC.App.Views.PermissionConsentDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:controls="using:JustHostMC.App.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="using:JustHostMC.App.Views"
@@ -22,7 +23,7 @@
x:Uid="PermissionConsentNone"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextWrapping="WrapWholeWords"
- Visibility="{x:Bind Rows.Count, Converter={StaticResource BoolToVis}, ConverterParameter=invert}" />
+ Visibility="{x:Bind Rows, Converter={StaticResource CollectionToVis}, ConverterParameter=True}" />
@@ -43,10 +44,7 @@
Grid.Column="0"
VerticalAlignment="Center"
Spacing="4">
-
+
One requested permission row with an allow/deny toggle, bound in
/// the consent dialog.
public sealed partial class ConsentRow : ObservableObject {
- public ConsentRow(Permission permission, ILocalizer localizer,
- bool allowed) {
+ public ConsentRow(Permission permission, bool allowed) {
Kind = permission.Kind;
- Label = PermissionLabels.Label(permission.Kind, localizer);
Reason = permission.Reason;
Allowed = allowed;
}
public PermissionKind Kind { get; }
- public string Label { get; }
public string Reason { get; }
[ObservableProperty]
@@ -34,15 +29,14 @@ public partial bool Allowed {
public sealed partial class PermissionConsentDialog : UserControl {
public ObservableCollection Rows { get; } = new();
- public PermissionConsentDialog(IEnumerable permissions,
- ILocalizer localizer) {
+ public PermissionConsentDialog(IEnumerable permissions) {
// Populate before InitializeComponent so the OneTime x:Bind to
// Rows.Count (used to toggle the "no permissions" hint) sees the final
// count.
foreach (var p in permissions) {
// Default-allow each requested permission; the user can deny
// individually.
- Rows.Add(new ConsentRow(p, localizer, allowed: true));
+ Rows.Add(new ConsentRow(p, allowed: true));
}
InitializeComponent();
diff --git a/app/JustHostMC.App/Views/PlayerDataContentDialog.xaml b/app/JustHostMC.App/Views/PlayerDataContentDialog.xaml
new file mode 100644
index 0000000..d1ea898
--- /dev/null
+++ b/app/JustHostMC.App/Views/PlayerDataContentDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/PlayerDataContentDialog.xaml.cs b/app/JustHostMC.App/Views/PlayerDataContentDialog.xaml.cs
new file mode 100644
index 0000000..c8690fb
--- /dev/null
+++ b/app/JustHostMC.App/Views/PlayerDataContentDialog.xaml.cs
@@ -0,0 +1,19 @@
+using JustHostMC.App.Controls;
+using JustHostMC.App.Models;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class PlayerDataContentDialog : ContentDialog {
+ public PlayerDialogBase Body { get; }
+
+ public PlayerDataContentDialog(string serverId, PlayerItem player) {
+ var view = new PlayerDataDialog(serverId, player);
+ Body = new PlayerDialogBase(player, view);
+ InitializeComponent();
+ ContentDialogSizing.Apply(this, useWideLayout: true);
+
+ Title = string.Format(Title?.ToString() ?? "{0}", player.Name);
+ view.OnHeaderUpdated = Body.UpdateHeader;
+ }
+}
diff --git a/app/JustHostMC.App/Views/PlayerDataDialog.xaml b/app/JustHostMC.App/Views/PlayerDataDialog.xaml
index 99dcd9f..5551185 100644
--- a/app/JustHostMC.App/Views/PlayerDataDialog.xaml
+++ b/app/JustHostMC.App/Views/PlayerDataDialog.xaml
@@ -18,19 +18,16 @@
-
+
-
-
0
- ? ex.Status.Detail
- : "Player data could not be loaded. The player may need to join once and the server may need to save.";
+ } catch (RpcException) {
+ LoadFailedText.Visibility = Microsoft.UI.Xaml.Visibility.Visible;
} finally {
BusyBar.Visibility = Microsoft.UI.Xaml.Visibility.Collapsed;
}
diff --git a/app/JustHostMC.App/Views/PlayerInventoryContentDialog.xaml b/app/JustHostMC.App/Views/PlayerInventoryContentDialog.xaml
new file mode 100644
index 0000000..1f22b03
--- /dev/null
+++ b/app/JustHostMC.App/Views/PlayerInventoryContentDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/PlayerInventoryContentDialog.xaml.cs b/app/JustHostMC.App/Views/PlayerInventoryContentDialog.xaml.cs
new file mode 100644
index 0000000..dccb633
--- /dev/null
+++ b/app/JustHostMC.App/Views/PlayerInventoryContentDialog.xaml.cs
@@ -0,0 +1,19 @@
+using JustHostMC.App.Controls;
+using JustHostMC.App.Models;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class PlayerInventoryContentDialog : ContentDialog {
+ public PlayerDialogBase Body { get; }
+
+ public PlayerInventoryContentDialog(string serverId, PlayerItem player) {
+ var view = new PlayerInventoryDialog(serverId, player);
+ Body = new PlayerDialogBase(player, view);
+ InitializeComponent();
+ ContentDialogSizing.Apply(this, useWideLayout: true);
+
+ Title = string.Format(Title?.ToString() ?? "{0}", player.Name);
+ view.OnHeaderUpdated = Body.UpdateHeader;
+ }
+}
diff --git a/app/JustHostMC.App/Views/PlayerInventoryDialog.xaml b/app/JustHostMC.App/Views/PlayerInventoryDialog.xaml
index d5e98a3..1513e40 100644
--- a/app/JustHostMC.App/Views/PlayerInventoryDialog.xaml
+++ b/app/JustHostMC.App/Views/PlayerInventoryDialog.xaml
@@ -84,18 +84,18 @@
-
-
+ TextWrapping="Wrap"
+ Visibility="Collapsed" />
? OnHeaderUpdated { get; set; }
public ObservableCollection MainSlots {
@@ -49,7 +50,7 @@ private async Task LoadAsync() {
BusyBar.Visibility = Microsoft.UI.Xaml.Visibility.Visible;
LoadingSkeleton.Visibility = Visibility.Visible;
InventoryContent.Visibility = Visibility.Collapsed;
- StatusText.Text = "";
+ LoadFailedText.Visibility = Visibility.Collapsed;
try {
var daemon = await App.Current.DaemonReady;
var data = await daemon.Players.GetDataAsync(new PlayerLookup {
@@ -68,19 +69,19 @@ private async Task LoadAsync() {
var inventoryBySlot = inventory.ToDictionary(item => item.Slot);
var enderBySlot = ender.ToDictionary(item => item.Slot);
+ var inventorySlotFormat = _localizer.Get("player.inventory.slot");
+ var hotbarSlotFormat = _localizer.Get("player.inventory.hotbar");
+ var enderSlotFormat = _localizer.Get("player.inventory.ender_slot");
FillSlots(MainSlots, Enumerable.Range(9, 27), inventoryBySlot,
- slot => $"Inventory {slot - 8}");
+ slot => string.Format(inventorySlotFormat, slot - 8));
FillSlots(HotbarSlots, Enumerable.Range(0, 9), inventoryBySlot,
- slot => $"Hotbar {slot + 1}");
+ slot => string.Format(hotbarSlotFormat, slot + 1));
FillSlots(EquipmentSlots, new[] { 103, 102, 101, 100, -106 },
inventoryBySlot, EquipmentName);
FillSlots(EnderSlots, Enumerable.Range(0, 27), enderBySlot,
- slot => $"Ender chest {slot + 1}");
- } catch (RpcException ex) {
- StatusText.Text =
- ex.Status.Detail.Length > 0
- ? ex.Status.Detail
- : "Player inventory could not be loaded. The player may need to join once and the server may need to save.";
+ slot => string.Format(enderSlotFormat, slot + 1));
+ } catch (RpcException) {
+ LoadFailedText.Visibility = Visibility.Visible;
} finally {
BusyBar.Visibility = Microsoft.UI.Xaml.Visibility.Collapsed;
LoadingSkeleton.Visibility = Visibility.Collapsed;
@@ -101,15 +102,21 @@ private static void FillSlots(
: PlayerInventoryItemView.Empty(slot, slotName(slot)));
}
- private static string EquipmentName(int slot) => slot switch {
- 103 => "Helmet",
- 102 => "Chestplate",
- 101 => "Leggings",
- 100 => "Boots",
- -
- 106 => "Offhand",
- _ => $"Slot {slot}",
- };
+ private string EquipmentName(int slot) {
+ var key = slot switch {
+ 103 => "player.inventory.helmet",
+ 102 => "player.inventory.chestplate",
+ 101 => "player.inventory.leggings",
+ 100 => "player.inventory.boots",
+ -
+ 106 => "player.inventory.offhand",
+ _ => "",
+ };
+ return key.Length > 0
+ ? _localizer.Get(key)
+ : string.Format(
+ _localizer.Get("player.inventory.generic_slot"), slot);
+ }
private void OnInventorySlotClick(object sender, RoutedEventArgs e) {
if (sender is not Button {
@@ -117,137 +124,15 @@ private void OnInventorySlotClick(object sender, RoutedEventArgs e) {
} button)
return;
- var header = new Grid { ColumnSpacing = 12 };
- header.ColumnDefinitions.Add(
- new ColumnDefinition { Width = GridLength.Auto });
- header.ColumnDefinitions.Add(
- new ColumnDefinition { Width =
- new GridLength(1, GridUnitType.Star) });
- header.Children.Add(new Image {
- Source = item.Icon,
- Width = 52,
- Height = 52,
- Stretch = Stretch.Uniform,
- });
- var heading =
- new StackPanel { Spacing = 2,
- VerticalAlignment = VerticalAlignment.Center };
- heading.Children.Add(new TextBlock {
- Text = item.StyledName,
- FontSize = 16,
- FontWeight = Microsoft.UI.Text.FontWeights.SemiBold,
- TextWrapping = TextWrapping.Wrap,
- });
- heading.Children.Add(new TextBlock {
- Text = item.ItemId,
- FontFamily = new FontFamily("Consolas"),
- FontSize = 12,
- Foreground = (Brush)Application.Current
- .Resources["TextFillColorSecondaryBrush"],
- });
- Grid.SetColumn(heading, 1);
- header.Children.Add(heading);
-
- var content = new StackPanel {
- Spacing = 12,
- Width = 400,
- };
- content.Children.Add(header);
- foreach (var section in item.Nbt.Sections)
- content.Children.Add(CreateDetailSection(section));
-
- if (item.Nbt.Sections.Count == 0) {
- content.Children.Add(new TextBlock {
- Text = item.Nbt.ParseError is null
- ? "This item has no custom NBT metadata."
- : $"NBT could not be parsed: {item.Nbt.ParseError}",
- FontStyle = Windows.UI.Text.FontStyle.Italic,
- Foreground = (Brush)Application.Current
- .Resources["TextFillColorSecondaryBrush"],
- TextWrapping = TextWrapping.Wrap,
- });
- }
-
- var rawBox = new TextBox {
- Text = item.Nbt.FormattedJson,
- IsReadOnly = true,
- AcceptsReturn = true,
- TextWrapping = TextWrapping.Wrap,
- FontFamily = new FontFamily("Consolas"),
- FontSize = 11,
- MaxHeight = 260,
- HorizontalAlignment = HorizontalAlignment.Stretch,
- };
- content.Children.Add(new Expander {
- Header = "Raw NBT",
- Content = rawBox,
- HorizontalAlignment = HorizontalAlignment.Stretch,
- HorizontalContentAlignment = HorizontalAlignment.Stretch,
- });
-
var flyout = new Flyout {
Content =
new ScrollViewer {
- Content = content,
- MaxHeight = 540,
- HorizontalContentAlignment = HorizontalAlignment.Stretch,
+ Content = new InventoryItemDetails(item),
+ MaxHeight = 540,
+ HorizontalContentAlignment = HorizontalAlignment.Stretch,
VerticalScrollBarVisibility = ScrollBarVisibility.Auto,
},
};
flyout.ShowAt(button);
}
-
- private static UIElement CreateDetailSection(NbtDetailSection section) {
- var panel = new StackPanel { Spacing = 7 };
- panel.Children.Add(new TextBlock {
- Text = section.Title,
- Style = (Style)Application.Current
- .Resources["BodyStrongTextBlockStyle"],
- });
- foreach (var entry in section.Entries)
- panel.Children.Add(CreateDetailRow(entry));
- return panel;
- }
-
- private static UIElement CreateDetailRow(NbtDetailEntry entry) {
- if (string.IsNullOrWhiteSpace(entry.Label))
- return CreateValueText(entry, new Thickness(8, 0, 0, 0));
-
- var row = new Grid { ColumnSpacing = 12 };
- row.ColumnDefinitions.Add(
- new ColumnDefinition { Width = new GridLength(120) });
- row.ColumnDefinitions.Add(
- new ColumnDefinition { Width =
- new GridLength(1, GridUnitType.Star) });
- row.Children.Add(new TextBlock {
- Text = entry.Label,
- FontWeight = Microsoft.UI.Text.FontWeights.SemiBold,
- TextWrapping = TextWrapping.Wrap,
- Foreground = (Brush)Application.Current
- .Resources["TextFillColorSecondaryBrush"],
- });
- var valueText = CreateValueText(entry, new Thickness(0));
- Grid.SetColumn(valueText, 1);
- row.Children.Add(valueText);
- return row;
- }
-
- private static TextBlock CreateValueText(NbtDetailEntry entry,
- Thickness margin) {
- var text = new TextBlock {
- Text = entry.Value,
- TextWrapping = TextWrapping.Wrap,
- Margin = margin,
- FontStyle = entry.Kind == NbtDetailKind.Lore
- ? Windows.UI.Text.FontStyle.Italic
- : Windows.UI.Text.FontStyle.Normal,
- FontWeight =
- entry.Kind is NbtDetailKind.Enchantment or NbtDetailKind.Effect
- ? Microsoft.UI.Text.FontWeights.SemiBold
- : Microsoft.UI.Text.FontWeights.Normal,
- };
- if (entry.Kind is NbtDetailKind.Code or NbtDetailKind.Numeric)
- text.FontFamily = new FontFamily("Consolas");
- return text;
- }
}
diff --git a/app/JustHostMC.App/Views/RenameServerDialog.xaml b/app/JustHostMC.App/Views/RenameServerDialog.xaml
new file mode 100644
index 0000000..eae9fa2
--- /dev/null
+++ b/app/JustHostMC.App/Views/RenameServerDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/RenameServerDialog.xaml.cs b/app/JustHostMC.App/Views/RenameServerDialog.xaml.cs
new file mode 100644
index 0000000..db2b0ca
--- /dev/null
+++ b/app/JustHostMC.App/Views/RenameServerDialog.xaml.cs
@@ -0,0 +1,16 @@
+using JustHostMC.App.Controls;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class RenameServerDialog : ContentDialog {
+ public RenameServerDialog(string serverName) {
+ InitializeComponent();
+ ContentDialogSizing.Apply(this);
+ NameBox.Text = serverName;
+ NameBox.SelectionStart = 0;
+ NameBox.SelectionLength = serverName.Length;
+ }
+
+ public string ServerName => NameBox.Text;
+}
diff --git a/app/JustHostMC.App/Views/ScriptLogsWindow.xaml b/app/JustHostMC.App/Views/ScriptLogsWindow.xaml
index 5001bc8..40e196f 100644
--- a/app/JustHostMC.App/Views/ScriptLogsWindow.xaml
+++ b/app/JustHostMC.App/Views/ScriptLogsWindow.xaml
@@ -19,7 +19,7 @@
-
+
@@ -48,7 +48,7 @@
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextAlignment="Center"
- Visibility="{Binding LogSessions.Count, Mode=OneWay, Converter={StaticResource BoolToVis}, ConverterParameter=invert}" />
+ Visibility="{x:Bind ShowWhenEmpty(LogSessions.Count), Mode=OneWay}" />
-
+
+
+
+
+ Visibility="{Binding SelectedItem, ElementName=LogList, Converter={StaticResource ObjectToVisInverse}}" />
+ Visibility="{Binding SelectedItem, ElementName=LogList, Converter={StaticResource ObjectToVis}}">
@@ -106,10 +115,18 @@
-
+
+
+
+
-
+
+
+
+
LogSessions { get; }
+ public Visibility ShowWhenEmpty(int count) => count == 0
+ ? Visibility.Visible
+ : Visibility.Collapsed;
+
public ScriptLogsWindow(
ObservableCollection logSessions) {
LogSessions = logSessions;
InitializeComponent();
+ Title = LogsTitleBar.Title;
Root.DataContext = this;
- var title = new LocalizationService().Get("ScriptLogsWindow_Title");
- Title = title;
- LogsTitleBar.Title = title;
ExtendsContentIntoTitleBar = true;
AppWindow.Resize(new SizeInt32(960, 640));
diff --git a/app/JustHostMC.App/Views/ScriptsPage.xaml b/app/JustHostMC.App/Views/ScriptsPage.xaml
index 0e8e63a..e651717 100644
--- a/app/JustHostMC.App/Views/ScriptsPage.xaml
+++ b/app/JustHostMC.App/Views/ScriptsPage.xaml
@@ -31,6 +31,11 @@
TextWrapping="WrapWholeWords"
Visibility="{x:Bind ViewModel.HasStatusMessage, Mode=OneWay, Converter={StaticResource BoolToVis}}" />
+
+
+
+
+
?> RequestConsentAsync(
string scriptName, string luaSource) {
var permissions = LuaPermissions.Parse(luaSource);
- var content = new PermissionConsentDialog(permissions, _localizer);
- var dialog = new ContentDialog {
- XamlRoot = XamlRoot,
- Style = Application.Current
- .Resources["DefaultContentDialogStyle"] as Style,
- Title = _localizer.Get("PermissionConsentTitleNamed",
- ("name", scriptName)),
- Content = content,
- PrimaryButtonText =
- _localizer.Get("PermissionConsentDialog_PrimaryButtonText"),
- CloseButtonText =
- _localizer.Get("PermissionConsentDialog_CloseButtonText"),
- DefaultButton = ContentDialogButton.Primary,
- };
- ContentDialogSizing.Apply(dialog);
+ var dialog =
+ new PermissionConsentContentDialog(scriptName, permissions) {
+ XamlRoot = XamlRoot,
+ };
if (await dialog.ShowAsync() != ContentDialogResult.Primary)
return null;
- return content.Granted;
+ return dialog.Granted;
}
private async void OnRemoveScript(object sender, RoutedEventArgs e) {
diff --git a/app/JustHostMC.App/Views/ServerDialog.xaml.cs b/app/JustHostMC.App/Views/ServerDialog.xaml.cs
index 7263320..ee0955d 100644
--- a/app/JustHostMC.App/Views/ServerDialog.xaml.cs
+++ b/app/JustHostMC.App/Views/ServerDialog.xaml.cs
@@ -63,7 +63,9 @@ private void InitializeEditMode(ServerItem server) {
LaunchLockedInfo.Visibility = Visibility.Visible;
NameBox.Text = server.Name;
- EditTypeBox.Text = server.TypeText;
+ EditTypeBox.Text = string.IsNullOrWhiteSpace(server.TypeText)
+ ? server.ProviderId
+ : server.TypeText;
VersionBox.IsEditable = false;
VersionBox.ItemsSource = new[] { server.McVersion };
VersionBox.SelectedIndex = 0;
diff --git a/app/JustHostMC.App/Views/ServerFolderNotFoundDialog.xaml b/app/JustHostMC.App/Views/ServerFolderNotFoundDialog.xaml
new file mode 100644
index 0000000..2ebb944
--- /dev/null
+++ b/app/JustHostMC.App/Views/ServerFolderNotFoundDialog.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/ServerFolderNotFoundDialog.xaml.cs b/app/JustHostMC.App/Views/ServerFolderNotFoundDialog.xaml.cs
new file mode 100644
index 0000000..ba0073a
--- /dev/null
+++ b/app/JustHostMC.App/Views/ServerFolderNotFoundDialog.xaml.cs
@@ -0,0 +1,11 @@
+using JustHostMC.App.Controls;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class ServerFolderNotFoundDialog : ContentDialog {
+ public ServerFolderNotFoundDialog() {
+ InitializeComponent();
+ ContentDialogSizing.Apply(this);
+ }
+}
diff --git a/app/JustHostMC.App/Views/ServerPage.xaml.cs b/app/JustHostMC.App/Views/ServerPage.xaml.cs
index e2ee3d2..b42b4cf 100644
--- a/app/JustHostMC.App/Views/ServerPage.xaml.cs
+++ b/app/JustHostMC.App/Views/ServerPage.xaml.cs
@@ -1,7 +1,6 @@
using System.ComponentModel;
using System.Diagnostics;
-using JustHostMC.App.Controls;
using JustHostMC.App.Models;
using JustHostMC.App.Services;
using JustHostMC.App.ViewModels;
@@ -146,19 +145,10 @@ private static async Task RunSilentlyAsync(Task task) {
}
private async void OnBackupsClick(object sender, RoutedEventArgs e) {
- var content = new BackupsDialog(Server.Id, Server.Name,
- Server.IsRunning, DispatcherQueue);
- var dialog = new ContentDialog {
+ var dialog = new BackupsContentDialog(
+ Server.Id, Server.Name, Server.IsRunning, DispatcherQueue) {
XamlRoot = XamlRoot,
- Style = Application.Current
- .Resources["DefaultContentDialogStyle"] as Style,
- Title = Server.Name,
- Content = content,
- CloseButtonText = _localizer.Get("BackupsDialog_CloseButtonText"),
- DefaultButton = ContentDialogButton.Close,
};
- dialog.Opened += async (_, _) => await content.LoadAsync();
- ContentDialogSizing.Apply(dialog, useWideLayout: true);
await dialog.ShowAsync();
}
@@ -169,57 +159,29 @@ private async void OnEditClick(object sender, RoutedEventArgs e) =>
await ShowEditDialogAsync();
private async Task ShowEditDialogAsync() {
- var content = new ServerDialog(_main, ServerDialogMode.Edit, Server);
- var dialog = new ContentDialog {
+ var dialog = new EditServerDialog(_main, Server) {
XamlRoot = XamlRoot,
- Style = Application.Current
- .Resources["DefaultContentDialogStyle"] as Style,
- Title = _localizer.Get("EditServerDialog_Title"),
- Content = content,
- PrimaryButtonText =
- _localizer.Get("EditServerDialog_PrimaryButtonText"),
- CloseButtonText =
- _localizer.Get("EditServerDialog_CloseButtonText"),
- DefaultButton = ContentDialogButton.Primary,
- IsPrimaryButtonEnabled = content.CanSubmit,
};
- content.CanSubmitChanged += (_, _) => dialog.IsPrimaryButtonEnabled =
- content.CanSubmit;
- ContentDialogSizing.Apply(dialog);
if (await dialog.ShowAsync() == ContentDialogResult.Primary)
- await _main.UpdateServerAsync(content.BuildUpdateRequest());
+ await _main.UpdateServerAsync(dialog.BuildUpdateRequest());
}
private async Task ShowRenameDialogAsync() {
- var nameBox = new TextBox {
- Text = Server.Name,
- Header = _localizer.Get("EditServerName_Header"),
- SelectionStart = 0,
- SelectionLength = Server.Name.Length,
- };
- var dialog = new ContentDialog {
- XamlRoot = XamlRoot,
- Title = _localizer.Get("RenameServerDialog_Title"),
- Content = nameBox,
- PrimaryButtonText = _localizer.Get("Common_Save"),
- CloseButtonText = _localizer.Get("Common_Cancel"),
- DefaultButton = ContentDialogButton.Primary,
+ var dialog = new RenameServerDialog(Server.Name) {
+ XamlRoot = XamlRoot,
};
+
if (await dialog.ShowAsync() == ContentDialogResult.Primary)
- await _main.RenameServerAsync(Server, nameBox.Text);
+ await _main.RenameServerAsync(Server, dialog.ServerName);
}
private async void OnOpenInstanceFolderClick(object sender,
RoutedEventArgs e) {
var folder = ResolveInstanceFolder();
if (folder is null) {
- var dialog = new ContentDialog {
- XamlRoot = XamlRoot,
- Title = _localizer.Get("ServerFolder_NotFoundTitle"),
- Content = _localizer.Get("ServerFolder_NotFoundBody"),
- CloseButtonText = "OK",
- DefaultButton = ContentDialogButton.Close,
+ var dialog = new ServerFolderNotFoundDialog {
+ XamlRoot = XamlRoot,
};
await dialog.ShowAsync();
return;
@@ -270,19 +232,10 @@ private IEnumerable InstanceFolderCandidates(string root) {
}
private async void OnDeleteClick(object sender, RoutedEventArgs e) {
- var incomplete = Server.IsIncompleteInstallation;
- var confirm = new ContentDialog {
- XamlRoot = XamlRoot,
- Title = _localizer.Get(incomplete ? "ServerInstallRemove_Title"
- : "ServerDelete_Title"),
- Content = _localizer.Get(incomplete ? "ServerInstallRemove_Body"
- : "ServerDelete_Body"),
- PrimaryButtonText =
- _localizer.Get(incomplete ? "ServerInstallRemove_Confirm"
- : "ServerDelete_Confirm"),
- CloseButtonText = _localizer.Get("Common_Cancel"),
- DefaultButton = ContentDialogButton.Close,
- };
+ ContentDialog confirm = Server.IsIncompleteInstallation
+ ? new IncompleteServerRemovalDialog()
+ : new DeleteServerDialog();
+ confirm.XamlRoot = XamlRoot;
if (await confirm.ShowAsync() != ContentDialogResult.Primary)
return;
_main.DeleteServerCommand.Execute(Server);
diff --git a/app/JustHostMC.App/Views/SettingsPage.xaml b/app/JustHostMC.App/Views/SettingsPage.xaml
index 9d4b526..6a5e5e8 100644
--- a/app/JustHostMC.App/Views/SettingsPage.xaml
+++ b/app/JustHostMC.App/Views/SettingsPage.xaml
@@ -100,11 +100,24 @@
-
+
+
+
+ TextWrapping="Wrap"
+ Visibility="{x:Bind ViewModel.IsDockerUnavailable, Mode=OneWay, Converter={StaticResource BoolToVis}}" />
@@ -146,13 +159,20 @@
-
+
+
+
+
+
+
+
+
+ Password="{x:Bind ViewModel.CurseForgeKey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
@@ -236,11 +256,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/ShopDependencySelectionDialog.xaml b/app/JustHostMC.App/Views/ShopDependencySelectionDialog.xaml
new file mode 100644
index 0000000..bb7c692
--- /dev/null
+++ b/app/JustHostMC.App/Views/ShopDependencySelectionDialog.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/ShopDependencySelectionDialog.xaml.cs b/app/JustHostMC.App/Views/ShopDependencySelectionDialog.xaml.cs
new file mode 100644
index 0000000..626999a
--- /dev/null
+++ b/app/JustHostMC.App/Views/ShopDependencySelectionDialog.xaml.cs
@@ -0,0 +1,31 @@
+using JustHostMC.App.Controls;
+using McManager.Grpc;
+using Microsoft.UI.Xaml.Controls;
+
+namespace JustHostMC.App.Views;
+
+public sealed partial class ShopDependencySelectionDialog : ContentDialog {
+ private readonly IReadOnlyList _choices;
+
+ public ShopDependencySelectionDialog(
+ IReadOnlyList dependencies) {
+ InitializeComponent();
+ ContentDialogSizing.Apply(this);
+
+ _choices = dependencies
+ .Select(dependency => new CheckBox {
+ Content = dependency.Title.Length > 0
+ ? dependency.Title
+ : dependency.ProjectId,
+ IsChecked = true,
+ Tag = dependency,
+ })
+ .ToArray();
+ foreach (var choice in _choices) ChoicesPanel.Children.Add(choice);
+ }
+
+ public IReadOnlyList SelectedDependencies =>
+ _choices.Where(choice => choice.IsChecked == true)
+ .Select(choice => (ShopDependency)choice.Tag)
+ .ToArray();
+}
diff --git a/app/JustHostMC.App/Views/ShopDetailPage.xaml b/app/JustHostMC.App/Views/ShopDetailPage.xaml
index df1fba6..27c255f 100644
--- a/app/JustHostMC.App/Views/ShopDetailPage.xaml
+++ b/app/JustHostMC.App/Views/ShopDetailPage.xaml
@@ -119,10 +119,14 @@
HorizontalContentAlignment="Center"
AutomationProperties.AutomationId="ShopInstallLatest"
Click="OnInstallClick"
- Content="{x:Bind ViewModel.PrimaryActionLabel, Mode=OneWay}"
IsEnabled="{x:Bind ViewModel.CanInstallLatest, Mode=OneWay}"
Style="{StaticResource AccentButtonStyle}"
- Tag="{x:Bind ViewModel.LatestRelease, Mode=OneWay}" />
+ Tag="{x:Bind ViewModel.LatestRelease, Mode=OneWay}">
+
+
+
+
+
+ Visibility="{x:Bind ViewModel.HasGallery, Mode=OneWay, Converter={StaticResource BoolToVis}}">
@@ -247,10 +251,14 @@
HorizontalContentAlignment="Center"
AutomationProperties.AutomationId="ShopInstallLatestCompact"
Click="OnInstallClick"
- Content="{x:Bind ViewModel.PrimaryActionLabel, Mode=OneWay}"
IsEnabled="{x:Bind ViewModel.CanInstallLatest, Mode=OneWay}"
Style="{StaticResource AccentButtonStyle}"
- Tag="{x:Bind ViewModel.LatestRelease, Mode=OneWay}" />
+ Tag="{x:Bind ViewModel.LatestRelease, Mode=OneWay}">
+
+
+
+
+
+ Tag="{x:Bind}">
+
+
+
+
+
@@ -396,12 +408,20 @@
+ Visibility="{x:Bind ViewModel.IsInstalling, Mode=OneWay, Converter={StaticResource BoolToVis}}" />
+ IsOpen="{x:Bind ViewModel.HasStatus, Mode=OneWay}"
+ Severity="{x:Bind StatusSeverity(ViewModel.InstallSucceeded), Mode=OneWay}">
+
+
+
+
+
+
+
+
+
diff --git a/app/JustHostMC.App/Views/ShopDetailPage.xaml.cs b/app/JustHostMC.App/Views/ShopDetailPage.xaml.cs
index 074980f..2f2d1fb 100644
--- a/app/JustHostMC.App/Views/ShopDetailPage.xaml.cs
+++ b/app/JustHostMC.App/Views/ShopDetailPage.xaml.cs
@@ -96,35 +96,14 @@ private async void OnInstallClick(object sender, RoutedEventArgs e) {
}
var dependencies = ViewModel.MissingDependencies(version);
- var chosen = new List();
+ IReadOnlyList chosen = [];
if (dependencies.Count > 0) {
- var picks =
- dependencies
- .Select(d => new CheckBox {
- Content = d.Title.Length > 0 ? d.Title : d.ProjectId,
- IsChecked = true,
- Tag = d,
- })
- .ToArray();
- var panel = new StackPanel { Spacing = 8 };
- panel.Children.Add(new TextBlock {
- Text = _localizer.Get("Shop_DependencyPromptBody"),
- TextWrapping = TextWrapping.Wrap,
- });
- foreach (var pick in picks) panel.Children.Add(pick);
-
- var dialog = new ContentDialog {
+ var dialog = new ShopDependencySelectionDialog(dependencies) {
XamlRoot = XamlRoot,
- Title = _localizer.Get("Shop_DependencyPromptTitle"),
- Content = new ScrollViewer { Content = panel, MaxHeight = 320 },
- PrimaryButtonText = _localizer.Get("Shop_InstallConfirm"),
- CloseButtonText = _localizer.Get("Common_Cancel"),
- DefaultButton = ContentDialogButton.Primary,
};
if (await dialog.ShowAsync() != ContentDialogResult.Primary)
return;
- chosen.AddRange(picks.Where(p => p.IsChecked == true)
- .Select(p => (ShopDependency)p.Tag));
+ chosen = dialog.SelectedDependencies;
}
await ViewModel.InstallAsync(version, chosen);
@@ -139,9 +118,6 @@ private async Task OpenWebsiteAsync() {
await Windows.System.Launcher.LaunchUriAsync(uri);
}
- public Visibility BoolToVisibility(bool value) =>
- value ? Visibility.Visible : Visibility.Collapsed;
-
public Visibility BodyVisibility(bool loading, string body) =>
!loading && body.Length > 0? Visibility.Visible : Visibility.Collapsed;
diff --git a/app/JustHostMC.App/Views/ShopHomePage.xaml b/app/JustHostMC.App/Views/ShopHomePage.xaml
index fa2f4f9..84eca1b 100644
--- a/app/JustHostMC.App/Views/ShopHomePage.xaml
+++ b/app/JustHostMC.App/Views/ShopHomePage.xaml
@@ -158,12 +158,12 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="8"
- Visibility="{x:Bind HasStatus(ViewModel.StatusMessage), Mode=OneWay}">
+ Visibility="{x:Bind ViewModel.HasLoadFailure, Converter={StaticResource BoolToVis}, Mode=OneWay}">
-
+
_ =
private void OnDismissWelcome(object sender, RoutedEventArgs e) =>
WelcomeBanner.Visibility = Visibility.Collapsed;
- public Visibility HasStatus(string status) =>
- status.Length > 0? Visibility.Visible : Visibility.Collapsed;
-
public static Visibility InvertVisibility(bool value) =>
value ? Visibility.Collapsed : Visibility.Visible;
diff --git a/app/JustHostMC.App/Views/ShopSearchPage.xaml b/app/JustHostMC.App/Views/ShopSearchPage.xaml
index 14b1061..67e0dd4 100644
--- a/app/JustHostMC.App/Views/ShopSearchPage.xaml
+++ b/app/JustHostMC.App/Views/ShopSearchPage.xaml
@@ -275,7 +275,7 @@
Content="{x:Bind ViewModel.LoaderFilterLabel, Mode=OneWay}"
IsChecked="{x:Bind ViewModel.UseLoaderFilter, Mode=TwoWay}"
Visibility="{x:Bind ViewModel.HasLoaderFilter}" />
-
+
@@ -370,7 +370,7 @@
IsChecked="{x:Bind ViewModel.UseLoaderFilter, Mode=TwoWay}"
Visibility="{x:Bind ViewModel.HasLoaderFilter}" />
-
+
diff --git a/app/JustHostMC.App/Views/ShopSearchPage.xaml.cs b/app/JustHostMC.App/Views/ShopSearchPage.xaml.cs
index 1283362..5d7f8e3 100644
--- a/app/JustHostMC.App/Views/ShopSearchPage.xaml.cs
+++ b/app/JustHostMC.App/Views/ShopSearchPage.xaml.cs
@@ -122,7 +122,4 @@ public Visibility ShowSkeleton(bool loading, int resultCount) =>
public Visibility ShowLoadMoreIndicator(bool loading, int resultCount) =>
loading && resultCount > 0? Visibility.Visible : Visibility.Collapsed;
-
- public Visibility BoolToVisibility(bool value) =>
- value ? Visibility.Visible : Visibility.Collapsed;
}
diff --git a/app/JustHostMC.App/Views/ShopWindow.xaml b/app/JustHostMC.App/Views/ShopWindow.xaml
index 50ce60f..799b5cf 100644
--- a/app/JustHostMC.App/Views/ShopWindow.xaml
+++ b/app/JustHostMC.App/Views/ShopWindow.xaml
@@ -13,6 +13,20 @@
+
+
+
+
@@ -21,6 +35,7 @@
@@ -95,16 +110,24 @@
-
+ Spacing="8">
+
+
+
/Resources.resw` with exactly the
+same identifiers, add the language to the manifest and
+`AppxDefaultResourceQualifiers`, run the resource tests, build, and exercise the
+complete smoke matrix in that language.
+
+## Static XAML localization
+
+Put `x:Uid` on every XAML element with static visible or accessibility text.
+The resource identifier is property-qualified:
+
+```xaml
+
+
+```
+
+```xml
+
+ Save
+
+
+ Name
+
+```
+
+This applies to `Text`, `Content`, `Header`, `Title`, `PlaceholderText`, dialog
+button properties, InfoBar text, menu items, empty states, tooltips, and
+automation properties. Do not add a C# property whose only purpose is to carry
+a static localized string into XAML.
+
+Attached properties use the fully qualified MRT Core form:
+
+```xml
+Refresh
+Send command
+```
+
+Never reuse one UID across control types unless every property supplied by that
+UID exists on every target. In particular, a `.Content` entry cannot be shared
+with a `TextBlock`, which requires `.Text` and otherwise can crash at page load.
+
+Do not put `x:Uid` on a `Window` root. Applying a `Window.Title` property
+resource during `InitializeComponent` can fail before the native window is
+ready and crash XAML loading. Localize the in-content `TitleBar.Title` with its
+own UID, then copy that value to `Window.Title` immediately after
+`InitializeComponent` in the window constructor.
+
+## Dynamic UI
+
+Prefer, in order:
+
+1. Separate localized labels and bound semantic values in neighboring elements.
+2. Two localized elements selected by visibility for finite states.
+3. A reusable `UserControl`, `DataTemplate`, style, or template selector.
+4. A verified Community Toolkit single-value converter.
+5. Programmatic lookup only for a complete translator-controlled format,
+ backend key, or framework surface that XAML cannot represent.
+
+WinUI 3 has no `MultiBinding` or `IMultiValueConverter`. Use `x:Bind` function
+binding or a small view/control instead. Do not split a translator-controlled
+sentence when word order or plural grammar must remain translatable.
+
+## ContentDialog architecture
+
+Localized dialogs are XAML classes whose root is `ContentDialog`. Static title,
+body, field labels, and button text come from the dialog root/elements' UIDs.
+Code may pass runtime data, set `XamlRoot`, update validation state, show the
+dialog, and handle its result. Large existing bodies may remain reusable
+`UserControl` instances inside a dedicated dialog class.
+
+Every `ContentDialog` XAML root uses `DefaultContentDialogStyle`. Each dialog
+class owns its sizing policy by calling `ContentDialogSizing.Apply(this)` in
+its constructor, with `useWideLayout: true` for wide dialog bodies. Parent
+pages, windows, and controls only assign `XamlRoot`, show the dialog, and react
+to its result; they do not configure dialog sizing. Never return to a factory
+that accepts already-localized title/body/button strings.
+
+## Tooltips and imperative controls
+
+Static tooltips use an attached-property UID in XAML. When a WinUI limitation
+requires a control to be created in C# (notably the Mod Shop `SelectorBar`), C#
+may choose a XAML-defined style or template containing the localized tooltip;
+it must not load and inject the string. Preserve the documented imperative
+SelectorBar construction because `ItemsSource` plus an `x:Bind` template for
+plain managed types can crash at startup.
+
+## Programmatic lookup
+
+`LocalizationService` is for runtime-only localization. Resource identifiers
+may be hierarchical, for example `install.progress.downloading_server`. MRT
+Core exposes such identifiers to `ResourceLoader.GetString` with slash paths,
+so the service maps dots to slashes:
+
+```text
+install.progress.downloading_server
+ -> install/progress/downloading_server
+```
+
+Do not change property dots in XAML identifiers such as `SaveButton.Content`;
+those are resolved directly by XAML. Missing programmatic resources return the
+key for dynamic fallback scenarios and emit a debugger diagnostic rather than
+being silently hidden.
+
+Backend `LocalizedMessage` values deliberately use dotted keys plus runtime
+arguments. Their RESW identifiers remain dotted and their placeholders remain
+translator-controlled. Raw gRPC status details, exception messages, and Go
+diagnostics are never normal user-facing fallbacks; map typed error codes to
+localized resources.
+
+## Community Toolkit converters
+
+Converters come from `CommunityToolkit.WinUI.Converters`, aligned with the
+other Windows Community Toolkit packages. App-wide converters live in
+`Application.Resources`, because an `x:Bind` converter declared only in an
+inner element's resources can fail during XAML loading. `BoolToVisibility` uses
+`ConverterParameter=True` for inversion. Collection, string, and object values
+must use their matching converters rather than being passed to a bool converter.
+
+RESW identifiers are not XAML `StaticResource` keys. Do not pass a RESW key as a
+converter's `TrueValue` or `FalseValue`; use localized elements/templates.
+
+## Semantic deduplication
+
+Resource identity includes meaning, target property, and grammatical context,
+not just the English spelling. Reuse a physical property entry only when those
+are compatible. When XAML requires duplicate property entries for different
+target types or responsive copies, identify the canonical semantic entry in a
+translator comment using `Duplicate of `. Identical words with
+different meanings remain separate and receive context comments. The resource
+tests reject duplicate identifiers and undocumented duplicate visible values.
+
+## Approved C# exceptions
+
+Every remaining programmatic lookup must fit this table and be covered by the
+resource audit. Convenience is not an exception.
+
+| Area | Allowed reason |
+| --- | --- |
+| Backend progress and shop messages | Runtime `LocalizedMessage` key and arguments supplied by gRPC/Lua |
+| Error mapping | Typed gRPC/error code selected at runtime; diagnostic detail is not displayed |
+| Translator-controlled formats | Complete sentence needs runtime placeholders or accessibility ordering |
+| `TrayIconService` | Win32 notification-area tooltip and menu objects cannot consume XAML |
+| Runtime accessibility announcements | The complete announcement is created for a runtime-only event |
+| Upstream metadata | Raw upstream names/descriptions are data, not application UI literals |
+
+Static view text, finite-state labels, dialog chrome, and tooltips are not on
+this list.
+
+### Audited programmatic exception inventory
+
+The July 2026 refactor reduced programmatic localization from 200 lookups in
+34 files to 59 lookups in 20 files. This is the exhaustive remaining inventory;
+adding another source file requires documenting why XAML cannot own the text.
+
+| Source | Calls | Approved runtime reason |
+| --- | ---: | --- |
+| `app/JustHostMC.App/Controls/ScriptEntryCard.xaml.cs` | 1 | Translator-controlled confirmation format containing the selected script name |
+| `app/JustHostMC.App/Controls/Server/ServerHeaderPanel.xaml.cs` | 1 | Translator-controlled memory value format |
+| `app/JustHostMC.App/Controls/Server/ServerPlayersPanel.xaml.cs` | 1 | Translator-controlled live player-count header |
+| `app/JustHostMC.App/MainWindow.xaml.cs` | 1 | Runtime teaching-tip event kind selects the announcement title |
+| `app/JustHostMC.App/Models/ConfigEntryItem.cs` | 1 | Dynamic configuration identifier lookup with a humanized fallback |
+| `app/JustHostMC.App/Models/ModFileItem.cs` | 4 | Runtime parser result and translator-controlled compatibility formats |
+| `app/JustHostMC.App/Models/ParserItem.cs` | 1 | Translator-controlled format list description |
+| `app/JustHostMC.App/Models/ServerItem.cs` | 3 | Runtime navigation accessibility, status, and port formats |
+| `app/JustHostMC.App/Services/TrayIconService.cs` | 3 | Win32 notification-area tooltip and menu objects cannot consume XAML |
+| `app/JustHostMC.App/ViewModels/BackupsViewModel.cs` | 1 | Typed backup error-code mapping |
+| `app/JustHostMC.App/ViewModels/MainViewModel.cs` | 10 | Backend progress keys, runtime tracker states, and generated default name |
+| `app/JustHostMC.App/ViewModels/ModsViewModel.cs` | 4 | Typed mod-operation error-code mapping |
+| `app/JustHostMC.App/ViewModels/ScriptsViewModel.cs` | 10 | Typed script-operation error-code mapping |
+| `app/JustHostMC.App/ViewModels/SettingsViewModel.cs` | 4 | Translator-controlled count, version, and size result formats |
+| `app/JustHostMC.App/ViewModels/ShopDetailViewModel.cs` | 2 | Runtime source-name format and backend error key |
+| `app/JustHostMC.App/ViewModels/ShopViewModel.cs` | 4 | Backend/Lua category and home-section keys |
+| `app/JustHostMC.App/Views/EngineStdioWindow.xaml.cs` | 1 | Translator-controlled live PID and entry-count status |
+| `app/JustHostMC.App/Views/PlayerInventoryDialog.xaml.cs` | 5 | Runtime inventory-slot tooltip and accessibility labels, including translator-controlled numeric formats |
+| `app/JustHostMC.App/Views/ServerDialog.xaml.cs` | 1 | Translator-controlled provider-author format |
+| `app/JustHostMC.App/Views/ShopSearchPage.xaml.cs` | 1 | Translator-controlled result-count and query summary |
+
+## Images, manifest resources, and themes
+
+Package logos, tile/splash artwork, and images loaded by URI belong under
+`Assets/`. XAML uses a relative package path or `ms-appx:///Assets/...`; code
+must use an absolute `ms-appx:///` URI. Provide scale variants with names such
+as `logo.scale-100.png`, `logo.scale-200.png`, and `logo.scale-400.png` when an
+image must remain sharp at different DPI settings. Use `theme-dark`/
+`theme-light` or high-contrast qualifiers only when the bitmap itself changes;
+brushes, dimensions, styles, and control templates belong in a XAML resource
+dictionary.
+
+Manifest `DisplayName` and `Description` use `ms-resource:` identifiers. Icon-
+only controls still need localized automation names even when the image itself
+does not change by language. Do not duplicate or move assets without a concrete
+packaging, scale, theme, or localization need.
+
+## Validation and runtime testing
+
+Run:
+
+```powershell
+rtk dotnet test app\JustHostMC.App.ResourceTests\JustHostMC.App.ResourceTests.csproj
+rtk dotnet build app\JustHostMC.App\JustHostMC.App.csproj -p:Platform=x64
+rtk dotnet test app\JustHostMC.Core.Tests\JustHostMC.Core.Tests.csproj
+```
+
+The resource tests validate XML, unique/non-empty identifiers, locale parity,
+XAML UID coverage, safe window-title localization, dotted backend identifiers,
+converter architecture, dialog architecture, tooltip ownership, and
+raw-diagnostic safety.
+
+A build is necessary but insufficient. In both `en-US` and `zh-TW`, instantiate
+MainWindow; Home, Scripts, Settings, every Server section, Mod Shop
+home/search/detail, engine/script-log windows, every dialog, menus, flyouts,
+templates, and localized tooltips. Repeat for unpackaged output and the MSIX
+path when packaging tooling is available. Watch the debugger/XAML binding output
+for missing resources and attached-property failures.
+
+## Migration summary and WinUI pitfalls
+
+The 2026 resource refactor moved dotted backend aliases to MRT slash lookup,
+replaced the custom visibility converter with Community Toolkit converters,
+moved localized tooltip selection and dialog chrome into XAML, synchronized
+`en-US`/`zh-TW`, added automated validation, and documented runtime-only C#
+exceptions.
+
+Keep these runtime constraints in mind:
+
+- marshal stream/background changes through `DispatcherQueue`;
+- keep app-wide `x:Bind` converters in `Application.Resources` or the XAML root;
+- do not use `ElementName` binding from inside a list-item template;
+- do not bind `NavigationView.MenuItemsSource` to plain managed items with an
+ `x:Bind` template;
+- never share a UID property across incompatible control types;
+- compile success does not prove that an attached-property UID works at runtime.