diff --git a/Deploy/Installer/Installer.iss b/Deploy/Installer/Installer.iss
index 253572eef3..3a30f94d86 100644
--- a/Deploy/Installer/Installer.iss
+++ b/Deploy/Installer/Installer.iss
@@ -7,7 +7,7 @@
#define MyAppVer = GetFileVersion(MyAppPath + "\Wox.exe")
[Setup]
-AppId={{A5AF4C34-70A7-4D3B-BA18-E49C0AEEA5E6}
+AppId=05700E94-3DAD-4827-8AAA-9908178DE132-Wox
AppMutex=DBDE24E4-91F6-11DF-B495-C536DFD72085-Wox
AppName={#MyAppName}
AppVerName={#MyAppName} v{#MyAppVer}
@@ -21,6 +21,8 @@ OutputBaseFilename=Wox-setup
OutputDir={#OutputPath}
Compression=lzma
SolidCompression=yes
+DisableDirPage=auto
+DisableProgramGroupPage=auto
[Languages]
Name: english; MessagesFile: compiler:Default.isl
diff --git a/Plugins/Wox.Plugin.WebSearch/Languages/en.xaml b/Plugins/Wox.Plugin.WebSearch/Languages/en.xaml
new file mode 100644
index 0000000000..e0a143f53c
--- /dev/null
+++ b/Plugins/Wox.Plugin.WebSearch/Languages/en.xaml
@@ -0,0 +1,28 @@
+
+
+ Delete
+ Edit
+ Add
+ Action Keyword
+ URL
+ Enable search suggestions
+ Please select a web search
+ Are your sure to delete {0}?
+
+
+
+ Title
+ Enable
+ Select Icon
+ Icon
+ Cancel
+ Invalid web search
+ Please input title
+ Please input action keyword
+ Please input URL
+ ActionWord has existed, please input a new one
+ Succeed
+
+
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.WebSearch/Languages/zh-cn.xaml b/Plugins/Wox.Plugin.WebSearch/Languages/zh-cn.xaml
new file mode 100644
index 0000000000..6e13e40ceb
--- /dev/null
+++ b/Plugins/Wox.Plugin.WebSearch/Languages/zh-cn.xaml
@@ -0,0 +1,28 @@
+
+
+ 删除
+ 编辑
+ 添加
+ 触发关键字
+ URL
+ 启用搜索建议
+ 请选择一项
+ 你确定要删除 {0} 吗?
+
+
+
+ 标题
+ 启用
+ 图标
+ 选择图标
+ 取消
+ 非法的网页搜索
+ 请输入标题
+ 请输入触发关键字
+ 请输入URL
+ 触发关键字已经存在,请选择一个新的关键字
+ 操作成功
+
+
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs b/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs
index 6b24eead6d..f7bd002aa5 100644
--- a/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs
+++ b/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs
@@ -1,13 +1,15 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.IO;
using System.Linq;
+using System.Reflection;
using Wox.Core.UserSettings;
using Wox.Plugin.WebSearch.SuggestionSources;
namespace Wox.Plugin.WebSearch
{
- public class WebSearchPlugin : IPlugin, ISettingProvider
+ public class WebSearchPlugin : IPlugin, ISettingProvider,IPluginI18n
{
private PluginInitContext context;
@@ -86,9 +88,14 @@ namespace Wox.Plugin.WebSearch
public System.Windows.Controls.Control CreateSettingPanel()
{
- return new WebSearchesSetting();
+ return new WebSearchesSetting(context);
}
#endregion
+
+ public string GetLanguagesFolder()
+ {
+ return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
+ }
}
}
diff --git a/Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml b/Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml
index 2ffc409d66..86beaf2917 100644
--- a/Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml
+++ b/Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml
@@ -17,27 +17,28 @@
- Title:
+
- URL:
+
- ActionWord:
+
- Enable:
+
- Icon:
+
-
+
-
-
+
+
diff --git a/Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml.cs b/Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml.cs
index c237a5f5bf..c7e5138d06 100644
--- a/Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml.cs
+++ b/Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml.cs
@@ -15,9 +15,11 @@ namespace Wox.Plugin.WebSearch
private WebSearchesSetting settingWindow;
private bool update;
private Core.UserSettings.WebSearch updateWebSearch;
+ private PluginInitContext context;
- public WebSearchSetting(WebSearchesSetting settingWidow)
+ public WebSearchSetting(WebSearchesSetting settingWidow,PluginInitContext context)
{
+ this.context = context;
this.settingWindow = settingWidow;
InitializeComponent();
}
@@ -27,7 +29,9 @@ namespace Wox.Plugin.WebSearch
updateWebSearch = UserSettingStorage.Instance.WebSearches.FirstOrDefault(o => o == webSearch);
if (updateWebSearch == null || string.IsNullOrEmpty(updateWebSearch.Url))
{
- MessageBox.Show("Invalid web search");
+
+ string warning = context.API.GetTranslation("wox_plugin_websearch_invalid_web_search");
+ MessageBox.Show(warning);
Close();
return;
}
@@ -63,21 +67,24 @@ namespace Wox.Plugin.WebSearch
string title = tbTitle.Text;
if (string.IsNullOrEmpty(title))
{
- MessageBox.Show("Please input Title field");
+ string warning = context.API.GetTranslation("wox_plugin_websearch_input_title");
+ MessageBox.Show(warning);
return;
}
string url = tbUrl.Text;
if (string.IsNullOrEmpty(url))
{
- MessageBox.Show("Please input URL field");
+ string warning = context.API.GetTranslation("wox_plugin_websearch_input_url");
+ MessageBox.Show(warning);
return;
}
string action = tbActionword.Text;
if (string.IsNullOrEmpty(action))
{
- MessageBox.Show("Please input ActionWord field");
+ string warning = context.API.GetTranslation("wox_plugin_websearch_input_action_keyword");
+ MessageBox.Show(warning);
return;
}
@@ -86,7 +93,8 @@ namespace Wox.Plugin.WebSearch
{
if (UserSettingStorage.Instance.WebSearches.Exists(o => o.ActionWord == action))
{
- MessageBox.Show("ActionWord has existed, please input a new one.");
+ string warning = context.API.GetTranslation("wox_plugin_websearch_action_keyword_exist");
+ MessageBox.Show(warning);
return;
}
UserSettingStorage.Instance.WebSearches.Add(new Core.UserSettings.WebSearch()
@@ -97,13 +105,15 @@ namespace Wox.Plugin.WebSearch
Url = url,
Title = title
});
- MessageBox.Show(string.Format("Add {0} web search successfully!", title));
+ string msg = context.API.GetTranslation("wox_plugin_websearch_succeed");
+ MessageBox.Show(msg);
}
else
{
if (UserSettingStorage.Instance.WebSearches.Exists(o => o.ActionWord == action && o != updateWebSearch))
{
- MessageBox.Show("ActionWord has existed, please input a new one.");
+ string warning = context.API.GetTranslation("wox_plugin_websearch_action_keyword_exist");
+ MessageBox.Show(warning);
return;
}
updateWebSearch.ActionWord = action;
@@ -111,7 +121,8 @@ namespace Wox.Plugin.WebSearch
updateWebSearch.Enabled = cbEnable.IsChecked ?? false;
updateWebSearch.Url = url;
updateWebSearch.Title= title;
- MessageBox.Show(string.Format("Update {0} web search successfully!", title));
+ string msg = context.API.GetTranslation("wox_plugin_websearch_succeed");
+ MessageBox.Show(msg);
}
UserSettingStorage.Instance.Save();
settingWindow.ReloadWebSearchView();
diff --git a/Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml b/Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml
index be59621a3d..0a823dc7cd 100644
--- a/Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml
+++ b/Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml
@@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300">
+ d:DesignHeight="300" d:DesignWidth="500">
@@ -12,21 +12,21 @@
- Enable search suggestions
+
-
+
-
+
@@ -37,9 +37,9 @@
-
-
-
+
+
+
diff --git a/Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml.cs b/Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml.cs
index a6d18d1b55..474ada7589 100644
--- a/Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml.cs
+++ b/Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml.cs
@@ -11,8 +11,12 @@ namespace Wox.Plugin.WebSearch
///
public partial class WebSearchesSetting : UserControl
{
- public WebSearchesSetting()
+ PluginInitContext context;
+
+ public WebSearchesSetting(PluginInitContext context)
{
+ this.context = context;
+
InitializeComponent();
Loaded += Setting_Loaded;
@@ -48,7 +52,7 @@ namespace Wox.Plugin.WebSearch
private void btnAddWebSearch_OnClick(object sender, RoutedEventArgs e)
{
- WebSearchSetting webSearch = new WebSearchSetting(this);
+ WebSearchSetting webSearch = new WebSearchSetting(this,context);
webSearch.ShowDialog();
}
@@ -57,8 +61,9 @@ namespace Wox.Plugin.WebSearch
Core.UserSettings.WebSearch selectedWebSearch = webSearchView.SelectedItem as Core.UserSettings.WebSearch;
if (selectedWebSearch != null)
{
- if (MessageBox.Show("Are your sure to delete " + selectedWebSearch.Title, "Delete WebSearch",
- MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+ string msg = string.Format(context.API.GetTranslation("wox_plugin_websearch_delete_warning"),selectedWebSearch.Title);
+
+ if (MessageBox.Show(msg,string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
UserSettingStorage.Instance.WebSearches.Remove(selectedWebSearch);
webSearchView.Items.Refresh();
@@ -66,7 +71,8 @@ namespace Wox.Plugin.WebSearch
}
else
{
- MessageBox.Show("Please select a web search");
+ string warning =context.API.GetTranslation("wox_plugin_websearch_pls_select_web_search");
+ MessageBox.Show(warning);
}
}
@@ -75,13 +81,14 @@ namespace Wox.Plugin.WebSearch
Core.UserSettings.WebSearch selectedWebSearch = webSearchView.SelectedItem as Core.UserSettings.WebSearch;
if (selectedWebSearch != null)
{
- WebSearchSetting webSearch = new WebSearchSetting(this);
+ WebSearchSetting webSearch = new WebSearchSetting(this,context);
webSearch.UpdateItem(selectedWebSearch);
webSearch.ShowDialog();
}
else
{
- MessageBox.Show("Please select a web search");
+ string warning = context.API.GetTranslation("wox_plugin_websearch_pls_select_web_search");
+ MessageBox.Show(warning);
}
}
diff --git a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj
index 8ca2c7ed37..28dcb62c5a 100644
--- a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj
+++ b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj
@@ -1,129 +1,139 @@
-
-
-
-
- Debug
- AnyCPU
- {403B57F2-1856-4FC7-8A24-36AB346B763E}
- Library
- Properties
- Wox.Plugin.WebSearch
- Wox.Plugin.WebSearch
- v3.5
- 512
- ..\..\
- true
-
-
- true
- full
- false
- ..\..\Output\Debug\Plugins\Wox.Plugin.WebSearch\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- ..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll
-
-
- False
- ..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WebSearchesSetting.xaml
-
-
-
- WebSearchSetting.xaml
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
-
-
-
-
-
- {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}
- Wox.Core
-
-
- {4fd29318-a8ab-4d8f-aa47-60bc241b8da3}
- Wox.Infrastructure
-
-
- {8451ecdd-2ea4-4966-bb0a-7bbc40138e80}
- Wox.Plugin
-
-
-
-
-
- PreserveNewest
-
-
-
-
- PreserveNewest
-
-
-
-
- PreserveNewest
-
-
-
-
- PreserveNewest
-
-
-
-
-
-
- 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。
-
-
-
-
+
+
+
+
+ Debug
+ AnyCPU
+ {403B57F2-1856-4FC7-8A24-36AB346B763E}
+ Library
+ Properties
+ Wox.Plugin.WebSearch
+ Wox.Plugin.WebSearch
+ v3.5
+ 512
+ ..\..\
+ true
+
+
+ true
+ full
+ false
+ ..\..\Output\Debug\Plugins\Wox.Plugin.WebSearch\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll
+
+
+ False
+ ..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WebSearchesSetting.xaml
+
+
+
+ WebSearchSetting.xaml
+
+
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+
+ {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}
+ Wox.Core
+
+
+ {4fd29318-a8ab-4d8f-aa47-60bc241b8da3}
+ Wox.Infrastructure
+
+
+ {8451ecdd-2ea4-4966-bb0a-7bbc40138e80}
+ Wox.Plugin
+
+
+
+
+
+ PreserveNewest
+
+
+
+
+ PreserveNewest
+
+
+
+
+ PreserveNewest
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+ 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。
+
+
+
+
\ No newline at end of file