Skip to content

Commit

Permalink
localization
Browse files Browse the repository at this point in the history
  • Loading branch information
chenguanzhou committed Jun 21, 2017
1 parent 1b5b023 commit d5ad38d
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 14 deletions.
27 changes: 27 additions & 0 deletions MarkDownEditor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions MarkDownEditor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -582,4 +582,13 @@
<data name="QiniuUserScope" xml:space="preserve">
<value>QiniuUserScope</value>
</data>
<data name="InsertLocalImage" xml:space="preserve">
<value>Insert local image URL</value>
</data>
<data name="OISS" xml:space="preserve">
<value>Online Image Storage Service</value>
</data>
<data name="UploadToImageStorageService" xml:space="preserve">
<value>Upload Image To </value>
</data>
</root>
9 changes: 9 additions & 0 deletions MarkDownEditor/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -582,4 +582,13 @@
<data name="QiniuUserScope" xml:space="preserve">
<value>七牛用户存储空间</value>
</data>
<data name="InsertLocalImage" xml:space="preserve">
<value>插入本地图片URL</value>
</data>
<data name="OISS" xml:space="preserve">
<value>在线图片存储服务</value>
</data>
<data name="UploadToImageStorageService" xml:space="preserve">
<value>上传至</value>
</data>
</root>
2 changes: 1 addition & 1 deletion MarkDownEditor/View/SettingsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</StackPanel>
</Expander>

<Expander IsExpanded="True" Header="Image Storage Service">
<Expander IsExpanded="True" Header="{x:Static p:Resources.OISS}">
<Controls:MetroAnimatedSingleRowTabControl SelectedIndex="{Binding CurrentImageStrorageServiceIndex}">
<Controls:MetroTabItem Header="SM.MS"/>
<Controls:MetroTabItem Header="IMGUR"/>
Expand Down
31 changes: 18 additions & 13 deletions MarkDownEditor/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
using CefSharp;
using CefSharp.Wpf;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using ICSharpCode.AvalonEdit.Document;
using Imgur.API.Authentication.Impl;
using Imgur.API.Endpoints.Impl;
using Imgur.API.Models;
using MahApps.Metro;
using MahApps.Metro.Controls.Dialogs;
using MarkDownEditor.Model;
using MarkDownEditor.View;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Win32;
using Qiniu.IO;
using Qiniu.RS;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;

namespace MarkDownEditor.ViewModel
{
Expand Down Expand Up @@ -1137,8 +1130,8 @@ public bool CanRedo
{
AffirmativeButtonText = Properties.Resources.OnlineImage,
NegativeButtonText = Properties.Resources.Cancel,
FirstAuxiliaryButtonText = "Upload Image To " + currentImageStorageService,
SecondAuxiliaryButtonText = "Insert local image (maybe not avalible when exporting)",
FirstAuxiliaryButtonText = Properties.Resources.UploadToImageStorageService + currentImageStorageService,
SecondAuxiliaryButtonText = Properties.Resources.InsertLocalImage,
ColorScheme = MetroDialogColorScheme.Accented
});

Expand All @@ -1153,7 +1146,7 @@ public bool CanRedo
}
else if (ret == MessageDialogResult.FirstAuxiliary)
//upload
{
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = Properties.Resources.UploadImagesTitle;
dlg.Filter = Properties.Resources.ImageFilter;
Expand Down Expand Up @@ -1183,10 +1176,22 @@ public bool CanRedo
await progress.CloseAsync();

await DialogCoordinator.Instance.ShowMessageAsync(this, Properties.Resources.Error, ex.Message,
MessageDialogStyle.Affirmative, new MetroDialogSettings(){ ColorScheme = MetroDialogColorScheme.Accented });
}
MessageDialogStyle.Affirmative, new MetroDialogSettings() { ColorScheme = MetroDialogColorScheme.Accented });
}
}
}
}
else if (ret == MessageDialogResult.SecondAuxiliary)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = Properties.Resources.UploadImagesTitle;
dlg.Filter = Properties.Resources.ImageFilter;
if (dlg.ShowDialog() == true)
{
var uri = new Uri(dlg.FileName);

insertUrl(uri.AbsoluteUri);
}
}
});

public ICommand SeparateLineCommand => new RelayCommand(() =>
Expand Down

0 comments on commit d5ad38d

Please sign in to comment.