Skip to content

Commit ec60d8d

Browse files
committed
Localization for Chinese finished
1 parent 4513ce0 commit ec60d8d

22 files changed

+517
-35
lines changed

FastCopy/AnimatedValue.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include "pch.h"
2+
#include "AnimatedValue.h"
3+
#if __has_include("AnimatedValue.g.cpp")
4+
#include "AnimatedValue.g.cpp"
5+
#endif
6+
7+
namespace winrt::FastCopy::implementation
8+
{
9+
10+
winrt::Microsoft::UI::Xaml::DependencyProperty AnimatedValue::m_valueProperty =
11+
winrt::Microsoft::UI::Xaml::DependencyProperty::Register(
12+
L"Value",
13+
winrt::xaml_typename<double>(),
14+
winrt::xaml_typename<winrt::FastCopy::AnimatedValue>(),
15+
winrt::Microsoft::UI::Xaml::PropertyMetadata{ winrt::box_value(0.0) }
16+
);
17+
18+
double AnimatedValue::Value()
19+
{
20+
return winrt::unbox_value<double>(GetValue(m_valueProperty));
21+
}
22+
void AnimatedValue::Value(double value)
23+
{
24+
OutputDebugString((std::to_wstring(value) + L"\n").data());
25+
SetValue(m_valueProperty, winrt::box_value(value));
26+
}
27+
}

FastCopy/AnimatedValue.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#pragma once
2+
3+
#include "AnimatedValue.g.h"
4+
5+
namespace winrt::FastCopy::implementation
6+
{
7+
struct AnimatedValue : AnimatedValueT<AnimatedValue>
8+
{
9+
AnimatedValue()
10+
{
11+
OutputDebugString(L"Constructed");
12+
}
13+
14+
static winrt::Microsoft::UI::Xaml::DependencyProperty ValueProperty()
15+
{
16+
return m_valueProperty;
17+
}
18+
19+
double Value();
20+
void Value(double value);
21+
private:
22+
static winrt::Microsoft::UI::Xaml::DependencyProperty m_valueProperty;
23+
};
24+
}
25+
26+
namespace winrt::FastCopy::factory_implementation
27+
{
28+
struct AnimatedValue : AnimatedValueT<AnimatedValue, implementation::AnimatedValue>
29+
{
30+
};
31+
}

FastCopy/AnimatedValue.idl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace FastCopy
2+
{
3+
[bindable]
4+
[default_interface]
5+
runtimeclass AnimatedValue : Microsoft.UI.Xaml.DependencyObject
6+
{
7+
AnimatedValue();
8+
9+
Double Value{ get; set; };
10+
static Microsoft.UI.Xaml.DependencyProperty ValueProperty{ get; };
11+
}
12+
}

FastCopy/CopyDialog.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,25 @@ void winrt::FastCopy::implementation::CopyDialog::CheckBox_Checked(winrt::Window
6262
{
6363
OutputDebugString(L"Checkbox clicked\n");
6464
}
65+
66+
67+
void winrt::FastCopy::implementation::CopyDialog::Button_Loaded(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::RoutedEventArgs const& e)
68+
{
69+
//winrt::Microsoft::UI::Xaml::Media::Animation::DoubleAnimation animation;
70+
//animation.From(0.0);
71+
//animation.To(100.0);
72+
//animation.Duration({ std::chrono::seconds{ 1 } });
73+
74+
//winrt::Microsoft::UI::Xaml::Media::Animation::Storyboard::SetTargetProperty(animation, L"Value");
75+
//winrt::Microsoft::UI::Xaml::Media::Animation::Storyboard::SetTarget(animation, m_height);
76+
//animation.EnableDependentAnimation(true);
77+
78+
//winrt::Microsoft::UI::Xaml::Media::Animation::Storyboard storyboard;
79+
//storyboard.Children().Append(animation);
80+
//storyboard.Begin();
81+
82+
83+
//MyAnimation().SetTarget(MyAnimation(), m_height);
84+
//MyAnimation().SetTargetProperty(MyAnimation(), L"Value");
85+
//MyAnimation().Begin();
86+
}

FastCopy/CopyDialog.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "CopyDialog.g.h"
44
#include "RobocopyViewModel.g.h"
5-
5+
#include "AnimatedValue.g.h"
66
namespace winrt::FastCopy::implementation
77
{
88
struct CopyDialog : CopyDialogT<CopyDialog>
@@ -19,6 +19,10 @@ namespace winrt::FastCopy::implementation
1919
void HyperlinkButton_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::RoutedEventArgs const& e);
2020
void PauseButton_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::RoutedEventArgs const& e);
2121
void CheckBox_Checked(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::RoutedEventArgs const& e);
22+
void Button_Loaded(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::RoutedEventArgs const& e);
23+
24+
private:
25+
winrt::FastCopy::AnimatedValue m_height;
2226
};
2327
}
2428

FastCopy/CopyDialog.xaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<RowDefinition Height="Auto"/>
6262
<RowDefinition Height="Auto"/>
6363
<RowDefinition Height="Auto"/>
64+
<RowDefinition Height="Auto"/>
6465
</Grid.RowDefinitions>
6566

6667
<TextBlock Style="{StaticResource HeaderTextStyle}">
@@ -76,11 +77,11 @@
7677
<Run Text="{x:Bind ViewModel.FinishedItemCount, Mode=OneWay}"/>
7778
/
7879
<Run Text="{x:Bind ViewModel.ItemCount, Mode=OneWay}"/>
79-
<Run Text="items from "/>
80+
<Run x:Uid="ItemsFromText"/>
8081
</TextBlock>
8182

8283
<TextBlock Style="{StaticResource StatusTextStyle}" Foreground="LightGreen" Text="{x:Bind ViewModel.Source, Mode=OneWay}" Margin="3,0,0,0"/>
83-
<TextBlock Style="{StaticResource StatusTextStyle}" Text=" to "/>
84+
<TextBlock Style="{StaticResource StatusTextStyle}" x:Uid="ToText"/>
8485
<Button FontSize="11" Padding="2" Foreground="LightGreen" Content="{x:Bind ViewModel.Destination, Mode=OneWay}" Background="Transparent" BorderThickness="0" Margin="2,-3,0,0" Click="HyperlinkButton_Click"/>
8586
</StackPanel>
8687

@@ -114,12 +115,14 @@
114115
</Grid.RowDefinitions>
115116

116117
<TextBlock Grid.Row="0" Grid.ColumnSpan="2" Height="55" Padding="0,25,0,20" LineHeight="42" VerticalAlignment="Center" FontSize="12">
117-
<Run Text="Destination folder contains 3 duplicates"/>
118+
<Run x:Uid="DestinationFolderContains"/>
119+
<Run Text="{x:Bind ViewModel.DuplicateFiles.Size, Mode=OneWay}"/>
120+
<Run x:Uid="Duplicates"/>
118121
</TextBlock>
119122

120123
<Line Margin="0,0,0,0" Grid.Row="1" Grid.ColumnSpan="2" X1="0" X2="500" Y1="0" Y2="0" Stroke="{StaticResource SeperatorLineColor}" Opacity="{StaticResource SeperatorLineOpacity}"/>
121-
<CheckBox Grid.Row="1" Content="Use source" Checked="CheckBox_Checked" IsThreeState="True" IsChecked="{x:Bind ViewModel.UseSource, Mode=TwoWay}"/>
122-
<CheckBox Grid.Row="1" Grid.Column="1" Content="Use destination" IsThreeState="True" IsChecked="{x:Bind ViewModel.UseDestination, Mode=TwoWay}"/>
124+
<CheckBox Grid.Row="1" x:Uid="UseSourceCheckBox" Checked="CheckBox_Checked" IsThreeState="True" IsChecked="{x:Bind ViewModel.UseSource, Mode=TwoWay}"/>
125+
<CheckBox Grid.Row="1" x:Uid="UseDestinationCheckBox" Grid.Column="1" IsThreeState="True" IsChecked="{x:Bind ViewModel.UseDestination, Mode=TwoWay}"/>
123126
<Line Margin="0,0,0,0" Grid.Row="1" Grid.ColumnSpan="2" X1="0" X2="500" Y1="45" Y2="45" Stroke="{StaticResource SeperatorLineColor}" Opacity="{StaticResource SeperatorLineOpacity}"/>
124127
</Grid>
125128

@@ -171,5 +174,7 @@
171174
</DataTemplate>
172175
</ItemsRepeater.ItemTemplate>
173176
</ItemsRepeater>
177+
178+
<Button x:Uid="ContinueButton" HorizontalAlignment="Right" Grid.Row="5" Style="{StaticResource AccentButtonStyle}" Loaded="Button_Loaded"/>
174179
</Grid>
175180
</Page>

FastCopy/CopyDialogWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1111
mc:Ignorable="d">
1212

13-
<local:CopyDialog x:Name="CopyDialog"/>
13+
<local:CopyDialog x:Name="CopyDialog" Loaded="CopyDialog_Loaded"/>
1414
</Window>

FastCopy/CopyDialogWindow.xaml.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "WindowHelper.h"
1111
#include "Global.h"
1212
#include "Taskbar.h"
13+
#include <winrt/Windows.Graphics.h>
14+
#include <winrt/Microsoft.UI.Xaml.Media.Animation.h>
1315

1416
using namespace winrt;
1517
using namespace Microsoft::UI::Xaml;
@@ -24,7 +26,7 @@ namespace winrt::FastCopy::implementation
2426
InitializeComponent();
2527

2628
//CenterWindow(*this, { 450, 300 });
27-
CenterWindow(*this, { 540, 350 });
29+
CenterWindow(*this, { 540, 400 });
2830
auto appWindow = GetAppWindow(*this);
2931
auto presenter = appWindow.Presenter().as<winrt::Microsoft::UI::Windowing::OverlappedPresenter>();
3032
presenter.IsResizable(false);
@@ -56,5 +58,13 @@ namespace winrt::FastCopy::implementation
5658
// }
5759
// hasSetSize = !hasSetSize;
5860
//});
61+
62+
5963
}
6064
}
65+
66+
67+
void winrt::FastCopy::implementation::CopyDialogWindow::CopyDialog_Loaded(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::RoutedEventArgs const& e)
68+
{
69+
70+
}

FastCopy/CopyDialogWindow.xaml.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
#pragma once
55

66
#include "CopyDialogWindow.g.h"
7+
#include "AnimatedValue.g.h"
78

89
namespace winrt::FastCopy::implementation
910
{
1011
struct CopyDialogWindow : CopyDialogWindowT<CopyDialogWindow>
1112
{
1213
CopyDialogWindow();
1314

14-
winrt::Microsoft::UI::Xaml::Controls::Button m_button;
15+
public:
16+
void CopyDialog_Loaded(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::RoutedEventArgs const& e);
1517
};
1618
}
1719

FastCopy/FastCopy.vcxproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@
129129
</ItemGroup>
130130
<ItemGroup>
131131
<ClInclude Include="AcrylicHelper.h" />
132+
<ClInclude Include="AnimatedValue.h">
133+
<DependentUpon>AnimatedValue.idl</DependentUpon>
134+
<SubType>Code</SubType>
135+
</ClInclude>
132136
<ClInclude Include="BoolToVisibilityConverter.h">
133137
<DependentUpon>BoolToVisibilityConverter.idl</DependentUpon>
134138
<SubType>Code</SubType>
@@ -259,6 +263,10 @@
259263
</ItemGroup>
260264
<ItemGroup>
261265
<ClCompile Include="AcrylicHelper.cpp" />
266+
<ClCompile Include="AnimatedValue.cpp">
267+
<DependentUpon>AnimatedValue.idl</DependentUpon>
268+
<SubType>Code</SubType>
269+
</ClCompile>
262270
<ClCompile Include="BoolToVisibilityConverter.cpp">
263271
<DependentUpon>BoolToVisibilityConverter.idl</DependentUpon>
264272
<SubType>Code</SubType>
@@ -364,6 +372,9 @@
364372
</ClCompile>
365373
</ItemGroup>
366374
<ItemGroup>
375+
<Midl Include="AnimatedValue.idl">
376+
<SubType>Designer</SubType>
377+
</Midl>
367378
<Midl Include="App.idl">
368379
<SubType>Code</SubType>
369380
<DependentUpon>App.xaml</DependentUpon>
@@ -515,6 +526,10 @@
515526
<Project>{17f52e4d-1e98-4288-9aa1-20a384171876}</Project>
516527
</ProjectReference>
517528
</ItemGroup>
529+
<ItemGroup>
530+
<PRIResource Include="Strings\en-US\Resources.resw" />
531+
<PRIResource Include="Strings\zh-CN\Resources.resw" />
532+
</ItemGroup>
518533
<!--
519534
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
520535
Explorer "Package and Publish" context menu entry to be enabled for this project even if

0 commit comments

Comments
 (0)