Translate phase 1
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using MareSynchronos.Localization;
|
||||
using MareSynchronos.MareConfiguration;
|
||||
using MareSynchronos.PlayerData.Pairs;
|
||||
using MareSynchronos.Services.Mediator;
|
||||
using MareSynchronos.Services.ServerConfiguration;
|
||||
using MareSynchronos.UI.Components;
|
||||
using System.Globalization;
|
||||
|
||||
namespace MareSynchronos.UI.Handlers;
|
||||
|
||||
@@ -22,6 +24,13 @@ public class UidDisplayHandler
|
||||
private bool _popupShown = false;
|
||||
private DateTime? _popupTime;
|
||||
|
||||
private static string L(string key, string fallback, params object[] args)
|
||||
{
|
||||
var safeArgs = args ?? Array.Empty<object>();
|
||||
return LocalizationService.Instance?.GetString(key, fallback, safeArgs)
|
||||
?? string.Format(CultureInfo.CurrentCulture, fallback, safeArgs);
|
||||
}
|
||||
|
||||
public UidDisplayHandler(MareMediator mediator, PairManager pairManager,
|
||||
ServerConfigurationManager serverManager, MareConfigService mareConfigService)
|
||||
{
|
||||
@@ -77,9 +86,7 @@ public class UidDisplayHandler
|
||||
|
||||
if (_popupTime > DateTime.UtcNow || !_mareConfigService.Current.ProfilesShow)
|
||||
{
|
||||
ImGui.SetTooltip("Left click to switch between UID display and nick" + Environment.NewLine
|
||||
+ "Right click to change nick for " + pair.UserData.AliasOrUID + Environment.NewLine
|
||||
+ "Middle Mouse Button to open their profile in a separate window");
|
||||
ImGui.SetTooltip(L("UidDisplay.Tooltip", "Left click to switch between UID display and nick\nRight click to change nick for {0}\nMiddle Mouse Button to open their profile in a separate window", pair.UserData.AliasOrUID));
|
||||
}
|
||||
else if (_popupTime < DateTime.UtcNow && !_popupShown)
|
||||
{
|
||||
@@ -125,7 +132,7 @@ public class UidDisplayHandler
|
||||
ImGui.SetCursorPosY(originalY);
|
||||
|
||||
ImGui.SetNextItemWidth(editBoxWidth.Invoke());
|
||||
if (ImGui.InputTextWithHint("##" + pair.UserData.UID, "Nick/Notes", ref _editUserComment, 255, ImGuiInputTextFlags.EnterReturnsTrue))
|
||||
if (ImGui.InputTextWithHint("##" + pair.UserData.UID, L("UidDisplay.EditNotes.Hint", "Nick/Notes"), ref _editUserComment, 255, ImGuiInputTextFlags.EnterReturnsTrue))
|
||||
{
|
||||
_serverManager.SetNoteForUid(pair.UserData.UID, _editUserComment);
|
||||
_serverManager.SaveNotes();
|
||||
@@ -136,7 +143,7 @@ public class UidDisplayHandler
|
||||
{
|
||||
_editNickEntry = string.Empty;
|
||||
}
|
||||
UiSharedService.AttachToolTip("Hit ENTER to save\nRight click to cancel");
|
||||
UiSharedService.AttachToolTip(L("GroupPanel.CommentTooltip", "Hit ENTER to save\nRight click to cancel"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,4 +208,4 @@ public class UidDisplayHandler
|
||||
|
||||
return showUidInsteadOfName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user