Spanish translation and fix LastQueryMode's language display

This commit is contained in:
NeedJustWord 2022-09-28 06:37:55 +08:00 committed by GitHub
parent 7050c046e0
commit 16b81c8e9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 38 additions and 11 deletions

View file

@ -71,6 +71,7 @@
<system:String x:Key="currentPriority">Current Priority</system:String>
<system:String x:Key="newPriority">New Priority</system:String>
<system:String x:Key="priority">Priority</system:String>
<system:String x:Key="priorityToolTip">Change Plugin Results Priority</system:String>
<system:String x:Key="pluginDirectory">Plugin Directory</system:String>
<system:String x:Key="author">by</system:String>
<system:String x:Key="plugin_init_time">Init time:</system:String>

View file

@ -69,6 +69,7 @@
<system:String x:Key="currentPriority">Prioridad Actual</system:String>
<system:String x:Key="newPriority">Nueva Prioridad</system:String>
<system:String x:Key="priority">Prioridad</system:String>
<system:String x:Key="priorityToolTip">Cambiar la prioridad del resultado del plugin</system:String>
<system:String x:Key="pluginDirectory">Directorio de Plugins</system:String>
<system:String x:Key="author">por</system:String>
<system:String x:Key="plugin_init_time">Tiempo de inicio:</system:String>

View file

@ -69,6 +69,7 @@
<system:String x:Key="currentPriority">Prioridad actual</system:String>
<system:String x:Key="newPriority">Nueva prioridad</system:String>
<system:String x:Key="priority">Prioridad</system:String>
<system:String x:Key="priorityToolTip">Cambiar la prioridad del resultado del complemento</system:String>
<system:String x:Key="pluginDirectory">Carpeta de complementos</system:String>
<system:String x:Key="author">por</system:String>
<system:String x:Key="plugin_init_time">Tiempo de inicio:</system:String>

View file

@ -69,6 +69,7 @@
<system:String x:Key="currentPriority">현재 중요도:</system:String>
<system:String x:Key="newPriority">새 중요도:</system:String>
<system:String x:Key="priority">중요도</system:String>
<system:String x:Key="priorityToolTip">플러그인 결과 우선 순위 변경</system:String>
<system:String x:Key="pluginDirectory">플러그인 폴더</system:String>
<system:String x:Key="author">제작자</system:String>
<system:String x:Key="plugin_init_time">초기화 시간:</system:String>

View file

@ -69,6 +69,7 @@
<system:String x:Key="currentPriority">当前优先级</system:String>
<system:String x:Key="newPriority">新优先级</system:String>
<system:String x:Key="priority">优先级</system:String>
<system:String x:Key="priorityToolTip">更改插件结果优先级</system:String>
<system:String x:Key="pluginDirectory">插件目录</system:String>
<system:String x:Key="author">出自</system:String>
<system:String x:Key="plugin_init_time">加载耗时:</system:String>

View file

@ -69,6 +69,7 @@
<system:String x:Key="currentPriority">目前優先</system:String>
<system:String x:Key="newPriority">新增優先</system:String>
<system:String x:Key="priority">優先</system:String>
<system:String x:Key="priorityToolTip">更改插件結果優先順序</system:String>
<system:String x:Key="pluginDirectory">外掛資料夾</system:String>
<system:String x:Key="author">作者</system:String>
<system:String x:Key="plugin_init_time">載入耗時:</system:String>

View file

@ -995,7 +995,7 @@
Click="OnPluginPriorityClick"
Content="{Binding Priority, UpdateSourceTrigger=PropertyChanged}"
Cursor="Hand"
ToolTip="Change Plugin Results Priority">
ToolTip="{DynamicResource priorityToolTip}">
<!--#region Priority Button Style-->
<Button.Resources>
<Style TargetType="Border">

View file

@ -125,25 +125,44 @@ namespace Flow.Launcher.ViewModel
#region general
// todo a better name?
public class LastQueryMode
public class LastQueryMode : BaseModel
{
public string Display { get; set; }
public Infrastructure.UserSettings.LastQueryMode Value { get; set; }
}
private List<LastQueryMode> _lastQueryModes = new List<LastQueryMode>();
public List<LastQueryMode> LastQueryModes
{
get
{
List<LastQueryMode> modes = new List<LastQueryMode>();
var enums = (Infrastructure.UserSettings.LastQueryMode[])Enum.GetValues(typeof(Infrastructure.UserSettings.LastQueryMode));
foreach (var e in enums)
if (_lastQueryModes.Count == 0)
{
var key = $"LastQuery{e}";
var display = _translater.GetTranslation(key);
var m = new LastQueryMode { Display = display, Value = e, };
modes.Add(m);
_lastQueryModes = InitLastQueryModes();
}
return modes;
return _lastQueryModes;
}
}
private List<LastQueryMode> InitLastQueryModes()
{
var modes = new List<LastQueryMode>();
var enums = (Infrastructure.UserSettings.LastQueryMode[])Enum.GetValues(typeof(Infrastructure.UserSettings.LastQueryMode));
foreach (var e in enums)
{
var key = $"LastQuery{e}";
var display = _translater.GetTranslation(key);
var m = new LastQueryMode { Display = display, Value = e, };
modes.Add(m);
}
return modes;
}
private void UpdateLastQueryModeDisplay()
{
foreach (var item in LastQueryModes)
{
item.Display = _translater.GetTranslation($"LastQuery{item.Value}");
}
}
@ -159,6 +178,8 @@ namespace Flow.Launcher.ViewModel
if (InternationalizationManager.Instance.PromptShouldUsePinyin(value))
ShouldUsePinyin = true;
UpdateLastQueryModeDisplay();
}
}
@ -305,7 +326,7 @@ namespace Flow.Launcher.ViewModel
{
Settings.Theme = value;
ThemeManager.Instance.ChangeTheme(value);
if (ThemeManager.Instance.BlurEnabled && Settings.UseDropShadowEffect)
DropShadowEffect = false;
}