Add translation for CMD plugin

This commit is contained in:
qianlifeng 2015-01-07 18:51:11 +08:00
parent 898c8854aa
commit 12abca39a2
5 changed files with 142 additions and 110 deletions

View File

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Windows.Forms; using System.Windows.Forms;
using WindowsInput; using WindowsInput;
using WindowsInput.Native; using WindowsInput.Native;
@ -10,7 +11,7 @@ using Control = System.Windows.Controls.Control;
namespace Wox.Plugin.CMD namespace Wox.Plugin.CMD
{ {
public class CMD : IPlugin, ISettingProvider public class CMD : IPlugin, ISettingProvider,IPluginI18n
{ {
private readonly GlobalHotkey globalHotkey = new GlobalHotkey(); private readonly GlobalHotkey globalHotkey = new GlobalHotkey();
private PluginInitContext context; private PluginInitContext context;
@ -206,5 +207,10 @@ namespace Wox.Plugin.CMD
{ {
return new CMDSetting(); return new CMDSetting();
} }
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
}
} }
} }

View File

@ -13,11 +13,11 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal"> <StackPanel Grid.Row="0" Orientation="Horizontal">
<CheckBox x:Name="cbReplaceWinR" >Replace Win+R</CheckBox> <CheckBox x:Name="cbReplaceWinR" Content="{DynamicResource wox_plugin_cmd_relace_winr}" ></CheckBox>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0 10 0 0"> <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0 10 0 0">
<CheckBox x:Name="cbLeaveCmdOpen" > <CheckBox x:Name="cbLeaveCmdOpen" Content="{DynamicResource wox_plugin_cmd_leave_cmd_open}">
Do not close Command Prompt after command execution
</CheckBox> </CheckBox>
</StackPanel> </StackPanel>
</Grid> </Grid>

View File

@ -0,0 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_cmd_relace_winr">Replace Win+R</system:String>
<system:String x:Key="wox_plugin_cmd_leave_cmd_open">Do not close Command Prompt after command execution</system:String>
</ResourceDictionary>

View File

@ -0,0 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_cmd_relace_winr">替换 Win+R</system:String>
<system:String x:Key="wox_plugin_cmd_leave_cmd_open">执行后不关闭命令窗口</system:String>
</ResourceDictionary>

View File

@ -67,6 +67,16 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Content Include="Languages\en.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Languages\zh-cn.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj"> <ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">