Skip to content

Commit

Permalink
Localizing C# Project of FancyZones (FancyZonesEditor) (#199) (#1122)
Browse files Browse the repository at this point in the history
* removed hardcoded strings from CanvasEditorWindow.xaml

* removed hardcoded strings from GridEditorWindow.xaml

* loc

* Localized MainWindow

* reverting MainWindow.xaml as it is not rendering the window as expected

* Changed the resource settings from internal to public

* the culture is set based on the culture of the system UI set in the system settings

* Removed the french resource files used for testing

* Localized canvasWindow and mainwindow

* Removed setting the UI culture explicitly as it would be implicitly set to the culture of system UI

* Removed redundant header file
  • Loading branch information
alekhyareddy28 authored and udit3333 committed Feb 20, 2020
1 parent 2b5dac4 commit 2a0839e
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
mc:Ignorable="d"
Title=""
Width="528"
Expand Down Expand Up @@ -164,14 +165,14 @@

</Window.Resources>
<StackPanel>
<TextBlock Name="windowEditorDialogTitle" Text="Custom layout creator" Style="{StaticResource titleText}" />
<TextBlock Name="windowEditorDialogTitle" Text="{x:Static props:Resources.Custom_Layout_Creator}" Style="{StaticResource titleText}" />
<Button x:Name="newZoneButton" Width="496" Height="136" Style="{StaticResource newZoneButton}" Click="OnAddZone">
<StackPanel>
<TextBlock x:Name="newSoneName" Text="Add new zone" Style="{StaticResource templateTitleText}" />
<TextBlock x:Name="newSoneName" Text="{x:Static props:Resources.Add_zone}" Style="{StaticResource templateTitleText}" />
<TextBlock HorizontalAlignment="Center" Text="+" Margin="0,-40,0,0"/>
</StackPanel>
</Button>
<TextBlock Text="Name" Style="{StaticResource textLabel}" />
<TextBlock Text="{x:Static props:Resources.Name}" Style="{StaticResource textLabel}" />
<TextBox Text="{Binding Name}" Width="496" Style="{StaticResource textBox}" />
<!--
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
Expand All @@ -182,8 +183,8 @@
</StackPanel>
-->
<StackPanel Orientation="Horizontal" Margin="0,12,0,16">
<Button Content="Cancel" Style="{StaticResource secondaryButton}" Click="OnCancel"/>
<Button Content="Save and apply" Style="{StaticResource primaryButton}" Click="OnSaveApplyTemplate" />
<Button Content="{x:Static props:Resources.Cancel}" Style="{StaticResource secondaryButton}" Click="OnCancel"/>
<Button Content="{x:Static props:Resources.Save_Apply}" Style="{StaticResource primaryButton}" Click="OnSaveApplyTemplate" />
</StackPanel>
</StackPanel>
</local:EditorWindow>
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
mc:Ignorable="d"
Title=""
Width="528"
Expand Down Expand Up @@ -163,10 +164,10 @@

</Window.Resources>
<StackPanel>
<TextBlock Name="windowEditorDialogTitle" Text="Custom table layout creator" Style="{StaticResource titleText}" />
<TextBlock Name="windowEditorDialogTitle" Text="{x:Static props:Resources.Custom_Table_Layout}" Style="{StaticResource titleText}" />

<TextBlock Text="Note: Hold down Shift Key to change orientation of splitter" Style="{StaticResource textLabel}" />
<TextBlock Text="Name" Style="{StaticResource textLabel}" />
<TextBlock Text="{x:Static props:Resources.Note_Custom_Table}" Style="{StaticResource textLabel}" />
<TextBlock Text="{x:Static props:Resources.Name}" Style="{StaticResource textLabel}" />
<TextBox Text="{Binding Name}" Width="494" Style="{StaticResource textBox}" />
<!--
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
Expand All @@ -177,8 +178,8 @@
</StackPanel>
-->
<StackPanel Orientation="Horizontal" Margin="0,12,0,16">
<Button Content="Cancel" Style="{StaticResource secondaryButton}" Click="OnCancel" />
<Button Content="Save and apply" Style="{StaticResource primaryButton}" Click="OnSaveApplyTemplate" />
<Button Content="{x:Static props:Resources.Cancel}" Style="{StaticResource secondaryButton}" Click="OnCancel" />
<Button Content="{x:Static props:Resources.Save_Apply}" Style="{StaticResource primaryButton}" Click="OnSaveApplyTemplate" />
</StackPanel>
</StackPanel>
</local:EditorWindow>
11 changes: 6 additions & 5 deletions src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:Converters="clr-namespace:FancyZonesEditor.Converters"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
mc:Ignorable="d"
Title=""
Width="810"
Expand Down Expand Up @@ -177,10 +178,10 @@

<StackPanel>

<TextBlock Name="dialog_Title" Text="Choose your layout" Style="{StaticResource titleText}" />
<TextBlock Name="dialog_Title" Text="{x:Static props:Resources.Choose_Layout}" Style="{StaticResource titleText}" />

<TabControl BorderThickness="0" x:Name="TemplateTab" SelectedIndex="{Binding IsCustomLayoutActive, Mode=OneWay, Converter={StaticResource BooleanToIntConverter}}">
<TabItem Header="Templates" Template="{StaticResource myTabs}">
<TabItem Header="{x:Static props:Resources.Templates}" Template="{StaticResource myTabs}">
<StackPanel>
<StackPanel Margin="0,15,0,8" Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="decrementZones" Width="40" Height="40" Content="-" Style="{StaticResource spinnerButton}" Click="DecrementZones_Click"/>
Expand Down Expand Up @@ -232,7 +233,7 @@
</TabItem>


<TabItem Header="Custom" Template="{StaticResource myTabs}">
<TabItem Header="{x:Static props:Resources.Custom}" Template="{StaticResource myTabs}">
<StackPanel>
<ItemsControl ItemsSource="{Binding CustomModels}" Margin="8,8,0,0">
<ItemsControl.ItemsPanel>
Expand Down Expand Up @@ -267,8 +268,8 @@
</ItemsControl>

<StackPanel Orientation="Horizontal" Margin="0,10,0,16">
<Button x:Name="EditCustomButton" Content="Edit selected layout" Padding="8" Style="{StaticResource secondaryButton}" Click="EditLayout_Click"/>
<Button x:Name="ApplyCustomButton" Content="Apply" Padding="8" Style="{StaticResource primaryButton}" Click="Apply_Click"/>
<Button x:Name="EditCustomButton" Content="{x:Static props:Resources.Edit_Selected_Layout}" Padding="8" Style="{StaticResource secondaryButton}" Click="EditLayout_Click"/>
<Button x:Name="ApplyCustomButton" Content="{x:Static props:Resources.Apply}" Padding="8" Style="{StaticResource primaryButton}" Click="Apply_Click"/>
</StackPanel>
</StackPanel>
</TabItem>
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
Expand All @@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
Expand All @@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
Expand All @@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
Expand All @@ -109,9 +112,51 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Add_zone" xml:space="preserve">
<value>Add new zone</value>
</data>
<data name="Apply" xml:space="preserve">
<value>Apply</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="Choose_Layout" xml:space="preserve">
<value>Choose your layout</value>
</data>
<data name="Custom" xml:space="preserve">
<value>Custom</value>
</data>
<data name="Custom_Layout_Creator" xml:space="preserve">
<value>Custom layout creator</value>
</data>
<data name="Custom_Table_Layout" xml:space="preserve">
<value>Custom table layout creator</value>
</data>
<data name="Edit_Selected_Layout" xml:space="preserve">
<value>Edit selected layout</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="Note_Custom_Table" xml:space="preserve">
<value>Note: Hold down Shift Key to change orientation of splitter</value>
</data>
<data name="Save_Apply" xml:space="preserve">
<value>Save and apply</value>
</data>
<data name="Show_Space_Zones" xml:space="preserve">
<value>Show space around zones</value>
</data>
<data name="Space_Around_Zones" xml:space="preserve">
<value>Space around zones</value>
</data>
<data name="Templates" xml:space="preserve">
<value>Templates</value>
</data>
</root>

0 comments on commit 2a0839e

Please sign in to comment.