Skip to content

Commit

Permalink
Added language selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-André Paillé committed Nov 1, 2020
1 parent 58d339f commit 964e785
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 8 deletions.
55 changes: 47 additions & 8 deletions application/GW2 Addon Manager/UI/OpeningPage/OpeningView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:l="clr-namespace:Localization;assembly=Localization"
xmlns:viewModel ="clr-namespace:GW2_Addon_Manager"
x:Class="GW2_Addon_Manager.OpeningView"
mc:Ignorable="d"
Expand Down Expand Up @@ -41,7 +42,7 @@
</TextBlock>

<TextBlock
Margin="110, 0, 0, -10"
Margin="170, 0, 0, -10"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Background="Transparent"
Expand Down Expand Up @@ -93,10 +94,48 @@
Style="{StaticResource AddonMenuItemStyle}"
/>
</MenuItem>
<MenuItem Header="{x:Static l:StaticText.Language}" HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Center"
Height="30"
Padding="5,2,5,5"
Template="{StaticResource AddonMenuItemControlTemplate}"
Style="{StaticResource AddonMenuItemStyle}"
Background="Transparent"
Foreground="DimGray"
>
<MenuItem
Header="{x:Static l:StaticText.English}"
Command="{Binding Path=ChangeLanguage}"
CommandParameter="{x:Static l:CultureConstants.English}"
Template="{StaticResource AddonMenuItemControlTemplate}"
Style="{StaticResource AddonMenuItemStyle}"
/>
<MenuItem
Header="{x:Static l:StaticText.French}"
Command="{Binding Path=ChangeLanguage}"
CommandParameter="{x:Static l:CultureConstants.French}"
Template="{StaticResource AddonMenuItemControlTemplate}"
Style="{StaticResource AddonMenuItemStyle}"
/>
<MenuItem
Header="{x:Static l:StaticText.Chinese}"
Command="{Binding Path=ChangeLanguage}"
CommandParameter="{x:Static l:CultureConstants.Chinese}"
Template="{StaticResource AddonMenuItemControlTemplate}"
Style="{StaticResource AddonMenuItemStyle}"
/>
<MenuItem
Header="{x:Static l:StaticText.Korean}"
Command="{Binding Path=ChangeLanguage}"
CommandParameter="{x:Static l:CultureConstants.Korean}"
Template="{StaticResource AddonMenuItemControlTemplate}"
Style="{StaticResource AddonMenuItemStyle}"
/>
</MenuItem>
</Menu>
<TextBlock Text="{Binding UpdateAvailable}"
Grid.Row="1"
Margin="320,-6,0,0"
Margin="380,-6,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontFamily="Microsoft YaHei UI Light"
Expand All @@ -108,7 +147,7 @@
/>
<TextBlock Text="{Binding UpdateAvailable}"
Grid.Row="1"
Margin="320,-6,0,0"
Margin="380,-6,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontFamily="Microsoft YaHei UI Light"
Expand All @@ -120,7 +159,7 @@
/>
<ProgressBar
Grid.Row = "1"
Margin="435,-6,0,0"
Margin="495,-6,0,0"
Width="125"
Height="12"
HorizontalAlignment="Left"
Expand All @@ -131,7 +170,7 @@
/>
<Button
Grid.Row = "1"
Margin="415,-10,0,0"
Margin="475,-10,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Width="50"
Expand All @@ -149,7 +188,7 @@
<Button Name="SelectDirectoryBtn"
Click="SelectDirectoryBtn_OnClick"
Grid.Row="2"
Margin="725,0,0,9"
Margin="785,0,0,9"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="Select Directory"
Expand All @@ -164,7 +203,7 @@
/>
<TextBox Text="{Binding GamePath}"
Grid.Row="2"
Margin="320,0,0,10"
Margin="380,0,0,10"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Width="400"
Expand Down Expand Up @@ -211,7 +250,7 @@
</StackPanel>
</Border>

<Border Grid.Row="2" Width="450" Height="280" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="320,20,0,0" BorderThickness="1" BorderBrush="DimGray" Background="WhiteSmoke">
<Border Grid.Row="2" Width="450" Height="280" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="380,20,0,0" BorderThickness="1" BorderBrush="DimGray" Background="WhiteSmoke">
<Grid>
<DockPanel Width="450" Height="280" HorizontalAlignment="Left">
<Label FontSize="13"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ public ICommand CleanInstall
{
get => new RelayCommand<object>(param => _pluginManagement.DeleteAll(), true);
}
/// <summary>
/// Handles the Change Language buttons.
/// </summary>
public ICommand ChangeLanguage
{
get => new RelayCommand<string>(param => _configuration.SetCulture(param), true);
}

/******************************************/

Expand Down
9 changes: 9 additions & 0 deletions application/Localization/StaticText.Designer.cs

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

3 changes: 3 additions & 0 deletions application/Localization/StaticText.fr-CA.resx
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,7 @@
<data name="Korean" xml:space="preserve">
<value>Coréen</value>
</data>
<data name="Language" xml:space="preserve">
<value>Langue</value>
</data>
</root>
3 changes: 3 additions & 0 deletions application/Localization/StaticText.resx
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,7 @@
<data name="Korean" xml:space="preserve">
<value>Korean</value>
</data>
<data name="Language" xml:space="preserve">
<value>Language</value>
</data>
</root>

0 comments on commit 964e785

Please sign in to comment.