Skip to content

Commit

Permalink
Add Japanese support.
Browse files Browse the repository at this point in the history
And bug fixes.
  • Loading branch information
XezolesS committed Sep 28, 2022
1 parent 15c7dd9 commit e3cee2a
Show file tree
Hide file tree
Showing 20 changed files with 833 additions and 992 deletions.
2 changes: 2 additions & 0 deletions WaccaMyPageScraper.Wpf/Converters/LanguageConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
Language.English => Localization.Language.English,
Language.Korean => Localization.Language.Korean,
Language.Japanese => Localization.Language.Japanese,

_ => Localization.Language.English,
};
Expand All @@ -38,6 +39,7 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
{
var str when str.Equals(Localization.Language.English) => Language.English,
var str when str.Equals(Localization.Language.Korean) => Language.Korean,
var str when str.Equals(Localization.Language.Japanese) => Language.Japanese,

_ => Language.English,
};
Expand Down
3 changes: 2 additions & 1 deletion WaccaMyPageScraper.Wpf/Enums/Language.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace WaccaMyPageScraper.Wpf.Enums
public enum Language
{
English,
Korean
Korean,
Japanese,
}
}
9 changes: 9 additions & 0 deletions WaccaMyPageScraper.Wpf/Localization/Language.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 WaccaMyPageScraper.Wpf/Localization/Language.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<data name="English" xml:space="preserve">
<value>English</value>
</data>
<data name="Japanese" xml:space="preserve">
<value>日本語</value>
</data>
<data name="Korean" xml:space="preserve">
<value>한국어</value>
</data>
Expand Down
167 changes: 167 additions & 0 deletions WaccaMyPageScraper.Wpf/Localization/UI.ja.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<?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="About" xml:space="preserve">
<value>情報</value>
</data>
<data name="Color" xml:space="preserve">
<value>カラー</value>
</data>
<data name="DescendingToolTip" xml:space="preserve">
<value>降順/昇順ソート</value>
</data>
<data name="FetchButtonText" xml:space="preserve">
<value>フェッチ</value>
</data>
<data name="Language" xml:space="preserve">
<value>言語</value>
</data>
<data name="LanguageRestart" xml:space="preserve">
<value>言語設定はプログラムを再起動すると適用されます。</value>
</data>
<data name="LoginButtonText" xml:space="preserve">
<value>ログイン</value>
</data>
<data name="RecordDetailToolTip" xml:space="preserve">
<value>記録詳細を見る</value>
</data>
<data name="RecordSearchWatermark" xml:space="preserve">
<value>曲名やアーティスト名で検索</value>
</data>
<data name="RichViewToolTip" xml:space="preserve">
<value>シンプル/リッチなフォームで見る</value>
</data>
<data name="Settings" xml:space="preserve">
<value>設定</value>
</data>
<data name="StageClearConditionText" xml:space="preserve">
<value>{1}判定 {0}個内</value>
<comment>{0}: Count, {1}: Judge</comment>
</data>
<data name="StageLifeRestoreText" xml:space="preserve">
<value>ライフ {0} 回復</value>
<comment>{0}: Lifes</comment>
</data>
<data name="Theme" xml:space="preserve">
<value>テーマ</value>
</data>
<data name="TimesPlayed" xml:space="preserve">
<value>回プレイ</value>
</data>
</root>
81 changes: 0 additions & 81 deletions WaccaMyPageScraper.Wpf/Localization/UI.ko.Designer.cs

This file was deleted.

1 change: 1 addition & 0 deletions WaccaMyPageScraper.Wpf/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private void InitializeCultures()
{
Language.English => "en",
Language.Korean => "ko",
Language.Japanese => "ja",
};

Thread.CurrentThread.CurrentCulture = new CultureInfo(languageCode);
Expand Down
2 changes: 1 addition & 1 deletion WaccaMyPageScraper.Wpf/Views/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
FontSize="18"
VerticalAlignment="Bottom"
HorizontalAlignment="Left" />
<Label Content="v1.1.0"
<Label Content="v1.1.1"
Foreground="{DynamicResource MahApps.Brushes.Accent3}"
VerticalAlignment="Bottom"
HorizontalAlignment="Right" />
Expand Down
3 changes: 3 additions & 0 deletions WaccaMyPageScraper.Wpf/WaccaMyPageScraper.Wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Language.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Localization\UI.ja.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Localization\UI.ko.resx">
<LastGenOutput>UI.ko.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
Expand Down
2 changes: 1 addition & 1 deletion WaccaMyPageScraper/FetcherActions/TrophiesFetcherAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ internal sealed class TrophiesFetcherAction : FetcherAction<Trophy[]>
.GetStringAsync($"{DescriptionUrl}?trid={resultItem.Id}")
.ConfigureAwait(false);
var descDocument = new HtmlDocument();
if (!this.TryLoadHtml(ref descDocument, responseContent))
if (!this.TryLoadHtml(ref descDocument, descResponse))
{
this._fetcher.LoginStatus = LoginStatus.LoggedOff;
return null;
Expand Down
Loading

0 comments on commit e3cee2a

Please sign in to comment.