Added complete language support.
Added Japanese
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using NavCityBreda.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
|
||||
@@ -23,5 +23,7 @@ namespace NavCityBreda.Helpers
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(100));
|
||||
App.rootFrame.Navigate(typeof(MainPage));
|
||||
}
|
||||
|
||||
public static string CurrentLanguage { get { return ApplicationLanguages.PrimaryLanguageOverride; } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
|
||||
<PRIResource Include="Strings\ja-JP\Resources.resw" />
|
||||
<PRIResource Include="Strings\de-DE\Resources.resw" />
|
||||
<PRIResource Include="Strings\nl-NL\Resources.resw" />
|
||||
<None Include="project.json" />
|
||||
@@ -106,6 +107,7 @@
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Model\GeoTracker.cs" />
|
||||
<Compile Include="Model\Landmark.cs" />
|
||||
<Compile Include="Model\Route.cs" />
|
||||
<Compile Include="Model\Waypoint.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: 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">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<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">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<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" 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">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="MenuItemHelp.Text" xml:space="preserve">
|
||||
<value>ヘルプ</value>
|
||||
</data>
|
||||
<data name="MenuItemSettings.Text" xml:space="preserve">
|
||||
<value>設定</value>
|
||||
</data>
|
||||
<data name="PageTitleDefault.Text" xml:space="preserve">
|
||||
<value>ようこそ</value>
|
||||
</data>
|
||||
<data name="PageTitleHelp" xml:space="preserve">
|
||||
<value>ヘルプ</value>
|
||||
</data>
|
||||
<data name="PageTitleMap" xml:space="preserve">
|
||||
<value>地図</value>
|
||||
</data>
|
||||
<data name="PageTitleRoute" xml:space="preserve">
|
||||
<value>ルート</value>
|
||||
</data>
|
||||
<data name="PageTitleRouteDetail" xml:space="preserve">
|
||||
<value>ルート 詳しく</value>
|
||||
</data>
|
||||
<data name="PageTitleSettings" xml:space="preserve">
|
||||
<value>設定</value>
|
||||
</data>
|
||||
<data name="PageTitleWaypoint" xml:space="preserve">
|
||||
<value>Waypoint</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -8,17 +8,23 @@
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="Settings - Add TileMapOption" Grid.Row="0"/>
|
||||
<Button Name="DeutschesKnopfe" Click="DeutschesKnopfe_Click" Content="Deutsch" Grid.Row="1"/>
|
||||
<Button Name="EnglishButton" Click="EnglishButton_Click" Content="English" Grid.Row="2" />
|
||||
<Button Name="NederlandseKnop" Click="NederlandseKnop_Click" Content="Nederlands" Grid.Row="3" />
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Stretch">
|
||||
|
||||
<StackPanel Margin="10">
|
||||
<TextBlock FontSize="20" Text="Language" Margin="0,0,0,10"/>
|
||||
<ComboBox Name="Language" SelectionChanged="Language_SelectionChanged" HorizontalAlignment="Stretch">
|
||||
<ComboBoxItem>English</ComboBoxItem>
|
||||
<ComboBoxItem>Nederlands</ComboBoxItem>
|
||||
<ComboBoxItem>Deutsch</ComboBoxItem>
|
||||
<ComboBoxItem>日本語</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ProgressRing IsActive="False" Name="LanguageLoading" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<TextBlock Text="Settings - Add TileMapOption" Grid.Row="0" Margin="10"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using NavCityBreda.Helpers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
@@ -28,19 +29,58 @@ namespace NavCityBreda.Views
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
private void DeutschesKnopfe_Click(object sender, RoutedEventArgs e)
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
Settings.ChangeLanguage("de-DE");
|
||||
Debug.WriteLine("Switching to settings: " + Settings.CurrentLanguage);
|
||||
|
||||
switch (Settings.CurrentLanguage)
|
||||
{
|
||||
default:
|
||||
Debug.WriteLine("No language found: " + Settings.CurrentLanguage);
|
||||
break;
|
||||
case "en-US":
|
||||
Language.SelectedIndex = 0;
|
||||
break;
|
||||
case "de-DE":
|
||||
Language.SelectedIndex = 2;
|
||||
break;
|
||||
case "nl-NL":
|
||||
Language.SelectedIndex = 1;
|
||||
break;
|
||||
case "ja":
|
||||
Language.SelectedIndex = 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void EnglishButton_Click(object sender, RoutedEventArgs e)
|
||||
private void Language_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
Settings.ChangeLanguage("en-US");
|
||||
}
|
||||
LanguageLoading.IsActive = true;
|
||||
|
||||
private void NederlandseKnop_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Settings.ChangeLanguage("nl-NL");
|
||||
switch(Language.SelectedIndex)
|
||||
{
|
||||
default:
|
||||
Language.SelectedIndex = 0;
|
||||
break;
|
||||
case 0:
|
||||
if(Settings.CurrentLanguage != "en-US")
|
||||
Settings.ChangeLanguage("en-US");
|
||||
break;
|
||||
case 2:
|
||||
if (Settings.CurrentLanguage != "de-DE")
|
||||
Settings.ChangeLanguage("de-DE");
|
||||
break;
|
||||
case 1:
|
||||
if (Settings.CurrentLanguage != "nl-NL")
|
||||
Settings.ChangeLanguage("nl-NL");
|
||||
break;
|
||||
case 3:
|
||||
if (Settings.CurrentLanguage != "ja")
|
||||
Settings.ChangeLanguage("ja-JP");
|
||||
break;
|
||||
}
|
||||
|
||||
LanguageLoading.IsActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user