Translate phase 1

This commit is contained in:
2025-09-21 17:01:12 +02:00
parent 0808266887
commit 6d8a8476b4
30 changed files with 2763 additions and 749 deletions

View File

@@ -12,6 +12,7 @@ using Dalamud.Plugin.Services;
using Dalamud.Utility;
using MareSynchronos.FileCache;
using MareSynchronos.Interop.Ipc;
using MareSynchronos.Localization;
using MareSynchronos.MareConfiguration;
using MareSynchronos.MareConfiguration.Models;
using MareSynchronos.PlayerData.Pairs;
@@ -20,6 +21,7 @@ using MareSynchronos.Services.Mediator;
using MareSynchronos.Services.ServerConfiguration;
using MareSynchronos.WebAPI;
using Microsoft.Extensions.Logging;
using System.Globalization;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Text;
@@ -53,6 +55,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
private readonly DalamudUtilService _dalamudUtil;
private readonly IpcManager _ipcManager;
private readonly IDalamudPluginInterface _pluginInterface;
private readonly LocalizationService _localizationService;
private readonly ITextureProvider _textureProvider;
private readonly Dictionary<string, object> _selectedComboItems = new(StringComparer.Ordinal);
private readonly ServerConfigurationManager _serverConfigurationManager;
@@ -84,7 +87,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
public UiSharedService(ILogger<UiSharedService> logger, IpcManager ipcManager, ApiController apiController,
CacheMonitor cacheMonitor, FileDialogManager fileDialogManager,
MareConfigService configService, DalamudUtilService dalamudUtil, IDalamudPluginInterface pluginInterface,
ITextureProvider textureProvider,
LocalizationService localizationService, ITextureProvider textureProvider,
ServerConfigurationManager serverManager, MareMediator mediator) : base(logger, mediator)
{
_ipcManager = ipcManager;
@@ -94,6 +97,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
_configService = configService;
_dalamudUtil = dalamudUtil;
_pluginInterface = pluginInterface;
_localizationService = localizationService;
_textureProvider = textureProvider;
_serverConfigurationManager = serverManager;
@@ -124,6 +128,10 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
}
public ApiController ApiController => _apiController;
public LocalizationService Localization => _localizationService;
public string Localize(string key, string fallback, params object[] args) => _localizationService.GetString(key, fallback, args);
public string Localize(string fallback, params object[] args) => _localizationService.GetString(fallback, args);
public bool EditTrackerPosition { get; set; }
@@ -761,15 +769,19 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
var check = FontAwesomeIcon.Check;
var cross = FontAwesomeIcon.SquareXmark;
var availableTemplate = Localize("Settings.Plugins.Tooltip.Available", "{0} is available and up to date.");
var unavailableTemplate = Localize("Settings.Plugins.Tooltip.Unavailable", "{0} is unavailable or not up to date.");
string FormatTooltip(bool exists, string pluginName) => string.Format(CultureInfo.CurrentCulture, exists ? availableTemplate : unavailableTemplate, pluginName);
if (intro)
{
ImGui.SetWindowFontScale(0.8f);
BigText("Mandatory Plugins");
BigText(Localize("Settings.Plugins.MandatoryHeading", "Mandatory Plugins"));
ImGui.SetWindowFontScale(1.0f);
}
else
{
ImGui.TextUnformatted("Mandatory Plugins:");
ImGui.TextUnformatted(Localize("Settings.Plugins.MandatoryLabel", "Mandatory Plugins:"));
ImGui.SameLine();
}
@@ -777,23 +789,23 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
ImGui.SameLine();
IconText(_penumbraExists ? check : cross, GetBoolColor(_penumbraExists));
ImGui.SameLine();
AttachToolTip($"Penumbra is " + (_penumbraExists ? "available and up to date." : "unavailable or not up to date."));
AttachToolTip(FormatTooltip(_penumbraExists, "Penumbra"));
ImGui.TextUnformatted("Glamourer");
ImGui.SameLine();
IconText(_glamourerExists ? check : cross, GetBoolColor(_glamourerExists));
AttachToolTip($"Glamourer is " + (_glamourerExists ? "available and up to date." : "unavailable or not up to date."));
AttachToolTip(FormatTooltip(_glamourerExists, "Glamourer"));
if (intro)
{
ImGui.SetWindowFontScale(0.8f);
BigText("Optional Addons");
BigText(Localize("Settings.Plugins.OptionalHeading", "Optional Addons"));
ImGui.SetWindowFontScale(1.0f);
UiSharedService.TextWrapped("These addons are not required for basic operation, but without them you may not see others as intended.");
UiSharedService.TextWrapped(Localize("Settings.Plugins.OptionalDescription", "These addons are not required for basic operation, but without them you may not see others as intended."));
}
else
{
ImGui.TextUnformatted("Optional Addons:");
ImGui.TextUnformatted(Localize("Settings.Plugins.OptionalLabel", "Optional Addons:"));
ImGui.SameLine();
}
@@ -803,7 +815,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
ImGui.SameLine();
IconText(_heelsExists ? check : cross, GetBoolColor(_heelsExists));
ImGui.SameLine();
AttachToolTip($"SimpleHeels is " + (_heelsExists ? "available and up to date." : "unavailable or not up to date."));
AttachToolTip(FormatTooltip(_heelsExists, "SimpleHeels"));
ImGui.Spacing();
ImGui.SameLine();
@@ -811,7 +823,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
ImGui.SameLine();
IconText(_customizePlusExists ? check : cross, GetBoolColor(_customizePlusExists));
ImGui.SameLine();
AttachToolTip($"Customize+ is " + (_customizePlusExists ? "available and up to date." : "unavailable or not up to date."));
AttachToolTip(FormatTooltip(_customizePlusExists, "Customize+"));
ImGui.Spacing();
ImGui.SameLine();
@@ -819,7 +831,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
ImGui.SameLine();
IconText(_honorificExists ? check : cross, GetBoolColor(_honorificExists));
ImGui.SameLine();
AttachToolTip($"Honorific is " + (_honorificExists ? "available and up to date." : "unavailable or not up to date."));
AttachToolTip(FormatTooltip(_honorificExists, "Honorific"));
ImGui.Spacing();
ImGui.SameLine();
@@ -827,7 +839,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
ImGui.SameLine();
IconText(_petNamesExists ? check : cross, GetBoolColor(_petNamesExists));
ImGui.SameLine();
AttachToolTip($"PetNicknames is " + (_petNamesExists ? "available and up to date." : "unavailable or not up to date."));
AttachToolTip(FormatTooltip(_petNamesExists, "PetNicknames"));
ImGui.Spacing();
ImGui.SetCursorPosX(alignPos);
@@ -835,7 +847,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
ImGui.SameLine();
IconText(_moodlesExists ? check : cross, GetBoolColor(_moodlesExists));
ImGui.SameLine();
AttachToolTip($"Moodles is " + (_moodlesExists ? "available and up to date." : "unavailable or not up to date."));
AttachToolTip(FormatTooltip(_moodlesExists, "Moodles"));
ImGui.Spacing();
ImGui.SameLine();
@@ -843,12 +855,12 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
ImGui.SameLine();
IconText(_brioExists ? check : cross, GetBoolColor(_brioExists));
ImGui.SameLine();
AttachToolTip($"Brio is " + (_moodlesExists ? "available and up to date." : "unavailable or not up to date."));
AttachToolTip(FormatTooltip(_brioExists, "Brio"));
ImGui.Spacing();
if (!_penumbraExists || !_glamourerExists)
{
ImGui.TextColored(ImGuiColors.DalamudRed, "You need to install both Penumbra and Glamourer and keep them up to date to use Umbra.");
ImGui.TextColored(ImGuiColors.DalamudRed, Localize("Settings.Plugins.WarningMandatoryMissing", "You need to install both Penumbra and Glamourer and keep them up to date to use Umbra."));
return false;
}