Skip to content

Commit

Permalink
Fixed some text localization
Browse files Browse the repository at this point in the history
  • Loading branch information
Rambalac committed Jul 18, 2019
1 parent fc16bf0 commit 8fd02c7
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 46 deletions.
10 changes: 5 additions & 5 deletions JoinerSplitter/AppModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public async Task AddFiles(string[] files, VideoFile before, int groupIndex)
throw new InvalidOperationException("Some files can not be exported by ffmpeg:\r\n" + string.Join("\r\n", error.Select(s => " " + s)));
}

if (string.IsNullOrEmpty(CurrentJob.OutputName) && files.Length > 0)
if (string.IsNullOrEmpty(CurrentJob.OutputName) && (files.Length > 0))
{
CurrentJob.OutputName = Path.GetFileNameWithoutExtension(files[0]) + ".out" + Path.GetExtension(files[0]);
}
Expand Down Expand Up @@ -148,7 +148,7 @@ public void MoveFiles(VideoFile[] files, VideoFile before, int groupIndex)
if (before != null)
{
var ind = jobFiles.IndexOf(before);
while (before != null && files.Contains(before))
while ((before != null) && files.Contains(before))
{
ind++;
before = (ind < jobFiles.Count) ? jobFiles[ind] : null;
Expand Down Expand Up @@ -183,7 +183,7 @@ public void MoveVideosUp(IList selectedItems)
foreach (var file in selected)
{
var fileindex = jobFiles.IndexOf(file);
if (fileindex > 0 && !selected.Contains(jobFiles[fileindex - 1]))
if ((fileindex > 0) && !selected.Contains(jobFiles[fileindex - 1]))
{
if (jobFiles[fileindex - 1].GroupIndex < file.GroupIndex)
{
Expand Down Expand Up @@ -258,7 +258,7 @@ public void SplitCurrentVideo(double currentTime)
{
var currentIndex = CurrentJob.Files.IndexOf(CurrentFile);
var splitTime = CurrentFile.KeyFrames?.Where(f => f > currentTime).DefaultIfEmpty(CurrentFile.Duration).First() ?? currentTime;
if (splitTime <= CurrentFile.Start || splitTime >= CurrentFile.End)
if ((splitTime <= CurrentFile.Start) || (splitTime >= CurrentFile.End))
{
return;
}
Expand Down Expand Up @@ -309,7 +309,7 @@ internal void MoveVideosDown(IList selectedItems)
{
var file = selected[i];
var fileindex = jobFiles.IndexOf(file);
if (fileindex < jobFiles.Count - 1 && !selected.Contains(jobFiles[fileindex + 1]))
if ((fileindex < jobFiles.Count - 1) && !selected.Contains(jobFiles[fileindex + 1]))
{
if (jobFiles[fileindex + 1].GroupIndex > file.GroupIndex)
{
Expand Down
4 changes: 0 additions & 4 deletions JoinerSplitter/EncodingPreset.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
namespace JoinerSplitter
{
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using JetBrains.Annotations;

[DataContract]
[Serializable]
Expand Down
4 changes: 2 additions & 2 deletions JoinerSplitter/FFMpeg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private static Task<ProcessResult> StartProcessFull(
if (!string.IsNullOrWhiteSpace(args.Data))
{
result.ErrorLines.AddLast(args.Data);
if (result.Parameters.ErrorLinesLimit != -1 && result.ErrorLines.Count > result.Parameters.ErrorLinesLimit)
if ((result.Parameters.ErrorLinesLimit != -1) && (result.ErrorLines.Count > result.Parameters.ErrorLinesLimit))
{
result.ErrorLines.RemoveFirst();
}
Expand All @@ -178,7 +178,7 @@ private static Task<ProcessResult> StartProcessFull(
proc.OutputDataReceived += (sender, args) =>
{
result.ResultLines.AddLast(args.Data);
if (result.Parameters.ResultLinesLimit != -1 && result.ResultLines.Count > result.Parameters.ResultLinesLimit)
if ((result.Parameters.ResultLinesLimit != -1) && (result.ResultLines.Count > result.Parameters.ResultLinesLimit))
{
result.ResultLines.RemoveFirst();
}
Expand Down
5 changes: 3 additions & 2 deletions JoinerSplitter/ListViewInsertMarkAdorner.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace JoinerSplitter
{
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
Expand Down Expand Up @@ -28,7 +29,7 @@ public double Offset
{
set
{
if (value != 0 && offset != value)
if ((Math.Abs(value) > 0.001) && (Math.Abs(offset - value) > 0.001))
{
offset = value;
(Parent as AdornerLayer)?.Update(AdornedElement);
Expand All @@ -38,7 +39,7 @@ public double Offset

public FrameworkElement View { get; set; }

protected override int VisualChildrenCount => (offset == 0) ? 0 : 1;
protected override int VisualChildrenCount => Math.Abs(offset) < 0.001 ? 0 : 1;
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator

public override GeneralTransform GetDesiredTransform(GeneralTransform transform)
Expand Down
2 changes: 0 additions & 2 deletions JoinerSplitter/ListViewInsertMarkAdornerView.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
namespace JoinerSplitter
{
using System.Windows.Controls;

/// <summary>
/// Interaction logic for UserControl1.xaml
/// </summary>
Expand Down
5 changes: 1 addition & 4 deletions JoinerSplitter/Pages/EncodingPresetsWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
namespace JoinerSplitter.Pages
{
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Properties;

/// <summary>
/// Interaction logic for EncodingPresetsWindow.xaml
/// </summary>
public partial class EncodingPresetsWindow : Window
public partial class EncodingPresetsWindow
{
public EncodingPresetsWindow()
{
Expand Down
6 changes: 3 additions & 3 deletions JoinerSplitter/Pages/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private static TItemContainer GetContainerAtPoint<TItemContainer>(ItemsControl c

private async Task AddFiles(string[] files, VideoFile before = null, int groupIndex = -1)
{
var infoBox = InfoBox.Show(this, "Retrieving video files details...");
var infoBox = InfoBox.Show(this, Properties.Resources.ReadingFile);

try
{
Expand Down Expand Up @@ -425,7 +425,7 @@ private async void MainWindow_OnClosing(object sender, CancelEventArgs e)
{
if (Data.CurrentJob.Changed)
{
var result = MessageBox.Show("There are unsaved changes. Do you want to save current job?", "Unsaved job", MessageBoxButton.YesNoCancel);
var result = MessageBox.Show(Properties.Resources.UnsavedChanges, Properties.Resources.UnsavedChangesTitle, MessageBoxButton.YesNoCancel);
switch (result)
{
case MessageBoxResult.Yes:
Expand Down Expand Up @@ -488,7 +488,7 @@ private async void OpenJob(object sender, RoutedEventArgs e)
return;
}

var infoBox = InfoBox.Show(this, "Retrieving video files details...");
var infoBox = InfoBox.Show(this, Properties.Resources.ReadingFile);
await OpenJob(dlg.FileName);
infoBox.Close();
}
Expand Down
4 changes: 2 additions & 2 deletions JoinerSplitter/ParallelProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ public abstract class ParallelProgress
{
internal abstract double Current { get; }

internal bool Done { get; set; } = false;
internal bool Done { get; set; }

internal ParallelProgressRoot Root { get; set; } = null;
internal ParallelProgressRoot Root { get; set; }
}
}
2 changes: 1 addition & 1 deletion JoinerSplitter/ProgressWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace JoinerSplitter
/// <summary>
/// Interaction logic for ProgressWindow.xaml
/// </summary>
public partial class ProgressWindow : Window
public partial class ProgressWindow
{
private readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
private bool wasEnabled;
Expand Down
27 changes: 27 additions & 0 deletions JoinerSplitter/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 JoinerSplitter/Properties/Resources.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,13 @@
<data name="Button_9" xml:space="preserve">
<value>グループの中の下</value>
</data>
<data name="UnsavedChanges" xml:space="preserve">
<value>変更がありますから、タスクを保存しましょうか?</value>
</data>
<data name="UnsavedChangesTitle" xml:space="preserve">
<value>保存されていないタスク</value>
</data>
<data name="ReadingFile" xml:space="preserve">
<value>ビデオの詳細を読んでいます…</value>
</data>
</root>
9 changes: 9 additions & 0 deletions JoinerSplitter/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,13 @@
<data name="Button_12" xml:space="preserve">
<value>Delete</value>
</data>
<data name="UnsavedChanges" xml:space="preserve">
<value>There are unsaved changes. Do you want to save current job?</value>
</data>
<data name="UnsavedChangesTitle" xml:space="preserve">
<value>Unsaved job</value>
</data>
<data name="ReadingFile" xml:space="preserve">
<value>Retrieving video files details...</value>
</data>
</root>
40 changes: 22 additions & 18 deletions JoinerSplitter/Properties/Settings.Designer.cs

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

6 changes: 3 additions & 3 deletions JoinerSplitterSetup/JoinerSplitterSetup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -452,15 +452,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:JoinerSplitter"
"ProductCode" = "8:{52BB0A9E-DA3E-43F5-B6EF-529E59D135C4}"
"PackageCode" = "8:{0B66F9F5-2C5C-409F-859D-3F4E78C7B0BD}"
"ProductCode" = "8:{4A7B5E15-AEFF-4349-AC7A-D3B9E39150B3}"
"PackageCode" = "8:{8CBF853F-94DC-4AF9-8AE8-7373F82B6171}"
"UpgradeCode" = "8:{22295F9C-F8CC-4D23-B355-5CB10AD0E5E5}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.3.2"
"ProductVersion" = "8:1.3.3"
"Manufacturer" = "8:Rambalac"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:https://github.com/Rambalac/JoinerSplitter"
Expand Down

0 comments on commit 8fd02c7

Please sign in to comment.