mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-10 17:29:08 +00:00
Add English and Chinese translations
This commit is contained in:
@@ -70,7 +70,7 @@ namespace QuickLook.Plugin.TextViewer
|
||||
|
||||
public void View(string path, ContextObject context)
|
||||
{
|
||||
_tvp = new TextViewerPanel(path);
|
||||
_tvp = new TextViewerPanel(path, context);
|
||||
|
||||
context.ViewerContent = _tvp;
|
||||
context.Title = $"{Path.GetFileName(path)}";
|
||||
|
@@ -90,5 +90,11 @@
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Translations.lang">
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
@@ -10,8 +10,7 @@
|
||||
d:DesignWidth="448.79"
|
||||
UseLayoutRounding="True">
|
||||
<Grid>
|
||||
<avalonEdit:TextEditor x:Name="viewer" Background="#00FFFFFF" FontFamily="Consolas" FontSize="14"
|
||||
ShowLineNumbers="True"
|
||||
<avalonEdit:TextEditor x:Name="viewer" Background="#00FFFFFF" FontSize="14" ShowLineNumbers="True"
|
||||
WordWrap="True" IsReadOnly="True" />
|
||||
</Grid>
|
||||
</UserControl>
|
@@ -16,8 +16,10 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using ICSharpCode.AvalonEdit.Highlighting;
|
||||
using QuickLook.Plugin.TextViewer.SimpleHelpers;
|
||||
|
||||
@@ -28,10 +30,15 @@ namespace QuickLook.Plugin.TextViewer
|
||||
/// </summary>
|
||||
public partial class TextViewerPanel : UserControl
|
||||
{
|
||||
public TextViewerPanel(string path)
|
||||
public TextViewerPanel(string path, ContextObject context)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
viewer.FontFamily =
|
||||
new FontFamily(context.GetString(
|
||||
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Translations.lang"),
|
||||
"Editor_FontFamily", failsafe: "Consolas"));
|
||||
|
||||
LoadFile(path);
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Translations>
|
||||
<en>
|
||||
<Editor_FontFamily>Consolas</Editor_FontFamily>
|
||||
</en>
|
||||
<zh-CN>
|
||||
<Editor_FontFamily>Consolas,Microsoft Yahei UI,Microsoft Yahei,SimSun</Editor_FontFamily>
|
||||
</zh-CN>
|
||||
<ja-JP>
|
||||
<Editor_FontFamily>Consolas,Meiryo UI,MS UI Gothic,MS Gothic</Editor_FontFamily>
|
||||
</ja-JP>
|
||||
</Translations>
|
Reference in New Issue
Block a user