Skip to content

Commit

Permalink
Merge pull request #2697 from cwensley/curtis/localization-tweaks
Browse files Browse the repository at this point in the history
Localization updates
  • Loading branch information
cwensley authored Oct 29, 2024
2 parents 7870805 + 4891d6b commit c98adbd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Eto.Mac/Forms/Menu/MenuBarHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public IEnumerable<Command> GetSystemCommands()
yield return new Command((sender, e) => NSApplication.SharedApplication.Hide(NSApplication.SharedApplication))
{
ID = "mac_hide",
MenuText = Application.Instance.Localize(Widget, string.Format("Hide {0}", appName)),
MenuText = string.Format(Application.Instance.Localize(Widget, "Hide {0}"), appName),
ToolBarText = Application.Instance.Localize(Widget, "Hide"),
ToolTip = Application.Instance.Localize(Widget, string.Format("Hides the main {0} window", appName)),
ToolTip = string.Format(Application.Instance.Localize(Widget, "Hides the main {0} window"), appName),
Shortcut = Keys.H | Keys.Application
};

Expand Down
11 changes: 6 additions & 5 deletions src/Eto/Forms/Key.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,17 @@ public static string ToShortcutString(this Keys key, string separator = "+")
{
var sb = new StringBuilder();
if (key.HasFlag(Keys.Application))
AppendSeparator(sb, separator,
AppendSeparator(sb, separator,
Application.Instance.Localize(key,
EtoEnvironment.Platform.IsMac ? "\x2318" :
EtoEnvironment.Platform.IsWindows ? "Win" :
"App");
"App"));
if (key.HasFlag(Keys.Control))
AppendSeparator(sb, separator, EtoEnvironment.Platform.IsMac ? "^" : "Ctrl");
AppendSeparator(sb, separator, Application.Instance.Localize(key, EtoEnvironment.Platform.IsMac ? "^" : "Ctrl"));
if (key.HasFlag(Keys.Shift))
AppendSeparator(sb, separator, EtoEnvironment.Platform.IsMac ? "\x21e7" : "Shift");
AppendSeparator(sb, separator, Application.Instance.Localize(key, EtoEnvironment.Platform.IsMac ? "\x21e7" : "Shift"));
if (key.HasFlag(Keys.Alt))
AppendSeparator(sb, separator, EtoEnvironment.Platform.IsMac ? "\x2325" : "Alt");
AppendSeparator(sb, separator, Application.Instance.Localize(key, EtoEnvironment.Platform.IsMac ? "\x2325" : "Alt"));

var mainKey = key & Keys.KeyMask;
string val;
Expand Down
8 changes: 4 additions & 4 deletions src/Eto/Forms/ThemedControls/ThemedPropertyGridHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,9 @@ public CollectionEditorDialog(CollectionEditor editor)
if (s_defaultSize != null)
Size = s_defaultSize.Value;

var cancelButton = new Button { Text = Application.Instance.Localize(this, "Cancel") };
var cancelButton = new Button { Text = Application.Instance.Localize(editor, "Cancel") };
cancelButton.Click += CancelButton_Click;
var okButton = new Button { Text = Application.Instance.Localize(this, Platform.IsMac ? "Apply" : "OK") };
var okButton = new Button { Text = Application.Instance.Localize(editor, Platform.IsMac ? "Apply" : "OK") };
okButton.Click += OkButton_Click;
DefaultButton = okButton;
AbortButton = cancelButton;
Expand Down Expand Up @@ -869,9 +869,9 @@ public PropertyGridDialog(ThemedPropertyGrid editor)
if (s_defaultSize != null)
Size = s_defaultSize.Value;

var cancelButton = new Button { Text = Application.Instance.Localize(this, "Cancel") };
var cancelButton = new Button { Text = Application.Instance.Localize(editor, "Cancel") };
cancelButton.Click += CancelButton_Click;
var okButton = new Button { Text = Application.Instance.Localize(this, Platform.IsMac ? "Apply" : "OK") };
var okButton = new Button { Text = Application.Instance.Localize(editor, Platform.IsMac ? "Apply" : "OK") };
okButton.Click += OkButton_Click;
DefaultButton = okButton;
AbortButton = cancelButton;
Expand Down

0 comments on commit c98adbd

Please sign in to comment.