misc
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using NGettext.Wpf;
|
||||
|
||||
using System.Globalization;
|
||||
using System.Windows.Interop;
|
||||
|
||||
namespace MpvNet.Windows.WPF;
|
||||
|
||||
@@ -22,6 +23,12 @@ public class WpfTranslator : ITranslator
|
||||
return Translation._(msgId);
|
||||
}
|
||||
|
||||
public string GetParticularString(string context, string text)
|
||||
{
|
||||
InitNGettextWpf();
|
||||
return Translation.GetParticularString(context, text);
|
||||
}
|
||||
|
||||
void InitNGettextWpf()
|
||||
{
|
||||
if (Translation.Localizer == null || _localizerLangauge != App.Language)
|
||||
|
||||
@@ -77,7 +77,7 @@ public class AppClass
|
||||
Player.Initialized += Player_Initialized;
|
||||
}
|
||||
|
||||
public static string About => "Copyright (C) 2000-2023 mpv.net/mpv/mplayer\n" +
|
||||
public static string About => "Copyright (C) 2000-2024 mpv.net/mpv/mplayer\n" +
|
||||
$"{AppInfo.Product} {AppInfo.Version}" + GetLastWriteTime(Environment.ProcessPath!) + "\n" +
|
||||
$"{Player.GetPropertyString("mpv-version")}" + GetLastWriteTime(Folder.Startup + "libmpv-2.dll") + "\n" +
|
||||
$"ffmpeg {Player.GetPropertyString("ffmpeg-version")}\n" + "GPL v2 License";
|
||||
|
||||
@@ -10,4 +10,5 @@ public static class Global
|
||||
public static readonly AppClass App = new AppClass();
|
||||
|
||||
public static string _(string value) => Translator.Current!.Gettext(value);
|
||||
public static string _p(string context, string value) => Translator.Current!.GetParticularString(context, value);
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ public static class InputHelp
|
||||
|
||||
new ("", _("Track")),
|
||||
|
||||
new (_("Volume"), _("Up"), "add volume 2", "+"),
|
||||
new (_("Volume"), _("Down"), "add volume -2", "-"),
|
||||
new (_("Volume"), _p("Volume", "Up"), "add volume 2", "+"),
|
||||
new (_("Volume"), _p("Volume", "Down"), "add volume -2", "-"),
|
||||
new (_("Volume"), "-"),
|
||||
new (_("Volume"), _("Mute"), "cycle mute", "m"),
|
||||
|
||||
@@ -141,11 +141,11 @@ public static class InputHelp
|
||||
new (_("Window") + " > " + _("Zoom"), _("100 %"), "script-message-to mpvnet window-scale 1.0", "Alt+1"),
|
||||
new (_("Window") + " > " + _("Zoom"), _("200 %"), "script-message-to mpvnet window-scale 2.0", "Alt+2"),
|
||||
new (_("Window") + " > " + _("Zoom"), _("300 %"), "script-message-to mpvnet window-scale 3.0", "Alt+3"),
|
||||
new (_("Window") + " > " + _("Move"), _("Left"), "script-message-to mpvnet move-window left", "Alt+Left"),
|
||||
new (_("Window") + " > " + _("Move"), _("Right"), "script-message-to mpvnet move-window right", "Alt+Right"),
|
||||
new (_("Window") + " > " + _("Move"), _("Up"), "script-message-to mpvnet move-window top", "Alt+Up"),
|
||||
new (_("Window") + " > " + _("Move"), _("Down"), "script-message-to mpvnet move-window bottom", "Alt+Down"),
|
||||
new (_("Window") + " > " + _("Move"), _("Center"), "script-message-to mpvnet move-window center", "Alt+BS"),
|
||||
new (_("Window") + " > " + _("Move"), _p("Move", "Left"), "script-message-to mpvnet move-window left", "Alt+Left"),
|
||||
new (_("Window") + " > " + _("Move"), _p("Move", "Right"), "script-message-to mpvnet move-window right", "Alt+Right"),
|
||||
new (_("Window") + " > " + _("Move"), _p("Move", "Up"), "script-message-to mpvnet move-window top", "Alt+Up"),
|
||||
new (_("Window") + " > " + _("Move"), _p("Move", "Down"), "script-message-to mpvnet move-window bottom", "Alt+Down"),
|
||||
new (_("Window") + " > " + _("Move"), _p("Move", "Center"), "script-message-to mpvnet move-window center", "Alt+BS"),
|
||||
new (_("Window"), _("Toggle Border"), "cycle border", "b"),
|
||||
new (_("Window"), _("Toggle On Top"), "cycle ontop", "Ctrl+t"),
|
||||
|
||||
|
||||
@@ -9,4 +9,5 @@ public class Translator
|
||||
public interface ITranslator
|
||||
{
|
||||
public string Gettext(string msgId);
|
||||
public string GetParticularString(string context, string text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user