Skip to content

Commit

Permalink
软件已基本支持英语,并准备发布2.7.7-pre3
Browse files Browse the repository at this point in the history
  • Loading branch information
Hgnim committed Jan 8, 2025
1 parent 904ec7c commit 30d078e
Show file tree
Hide file tree
Showing 11 changed files with 252 additions and 163 deletions.
28 changes: 19 additions & 9 deletions TimedPower/AboutForm.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
using static TimedPower.DataCore.DataFiles;
using static TimedPower.DataCore;
using System.Globalization;
using System.Resources;
namespace TimedPower {
public partial class AboutForm : Form {
public AboutForm() => InitializeComponent();
public AboutForm() {
InitializeComponent();

Main.ProgramLanguage.UpdateLanguage += UpdateLanguage;
UpdateLanguage();
}
static ResourceManager langRes = null!;
static string GetLangStr(string key, string head = "aboutForm") => langRes.GetString($"{head}.{key}", CultureInfo.CurrentUICulture)!;
void UpdateLanguage() {
LanguageData.UpdateLanguageResource(out langRes, FilePath.MainLanguageFile);
LanguageData.UpdateFormLanguage(this);
}

private void AboutForm_Load(object sender, EventArgs e) {
info_name.Text = $"{PInfo.alias}({PInfo.name})";
info_name.Text = PInfo.Alias;
info_version.Text = $"V{PInfo.version}";
info_copyright.Text = PInfo.copyright;
info_githubUrl.Text = PInfo.githubUrl;

statsBox_stats.Text =
@$"所有统计信息仅会存储在本地
启动次数: {statsData.StartNum}
执行操作次数: {statsData.DoActionNum}
更多统计信息敬请期待...
";
statsBox_stats.Text =string.Format(GetLangStr("stats"),
statsData.StartNum,
statsData.DoActionNum
);
}

private void LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) =>
Expand Down
16 changes: 13 additions & 3 deletions TimedPower/AboutForm.en-us.resx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@
<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: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="type" type="xsd:string" msdata:Ordinal="3" />
Expand All @@ -77,7 +79,8 @@
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<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>
Expand All @@ -98,4 +101,11 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>

<data name="$this.Text" xml:space="preserve">
<value>About</value>
</data>
<data name="statsBox.Text" xml:space="preserve">
<value>Stats</value>
</data>
</root>
91 changes: 48 additions & 43 deletions TimedPower/AboutForm.resx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
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
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>
Expand All @@ -26,36 +26,36 @@
<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
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
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
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
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
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
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
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Expand Down Expand Up @@ -117,28 +117,33 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="info_githubUrl.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="info_githubUrl.Locked" type="System.Boolean, mscorlib">
<value>True</value>
</metadata>
<metadata name="info_github.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
</data>
<data name="info_github.Locked" type="System.Boolean, mscorlib">
<value>True</value>
</metadata>
<metadata name="info_copyright.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
</data>
<data name="info_copyright.Locked" type="System.Boolean, mscorlib">
<value>True</value>
</metadata>
<metadata name="info_version.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
</data>
<data name="info_version.Locked" type="System.Boolean, mscorlib">
<value>True</value>
</metadata>
<metadata name="info_name.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
</data>
<data name="info_name.Locked" type="System.Boolean, mscorlib">
<value>True</value>
</metadata>
<metadata name="statsBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
</data>
<data name="statsBox.Locked" type="System.Boolean, mscorlib">
<value>True</value>
</metadata>
<metadata name="statsBox_stats.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
</data>
<data name="statsBox_stats.Locked" type="System.Boolean, mscorlib">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib">
<value>True</value>
</metadata>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\TimedPower_logo_window-icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Loading

0 comments on commit 30d078e

Please sign in to comment.