Skip to content

Commit

Permalink
fix bugs & i18n (en-US) & personalization supports
Browse files Browse the repository at this point in the history
  • Loading branch information
Pd233 committed Jan 13, 2024
1 parent c49ce1b commit 96fedc3
Show file tree
Hide file tree
Showing 57 changed files with 1,927 additions and 585 deletions.
11 changes: 9 additions & 2 deletions src/LipUI/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Microsoft.UI.Xaml;
using System.IO;
using LipUI.Models;
using Microsoft.UI.Xaml;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

Expand All @@ -17,6 +17,13 @@ public partial class App : Application
public App()
{
InitializeComponent();

Current.RequestedTheme = Main.Config.PersonalizationSettings.ColorTheme switch
{
ElementTheme.Dark => ApplicationTheme.Dark,
ElementTheme.Light => ApplicationTheme.Light,
ElementTheme.Default or _ => Current.RequestedTheme
};
}

/// <summary>
Expand Down
231 changes: 231 additions & 0 deletions src/LipUI/Language/en-US/Resources.resw
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
<?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="autoSuggestBox$search.PlaceholderText" xml:space="preserve">
<value>Search</value>
</data>
<data name="eula$accept" xml:space="preserve">
<value>Agree</value>
</data>
<data name="eula$deny" xml:space="preserve">
<value>Disagree</value>
</data>
<data name="home$emptyDesc" xml:space="preserve">
<value>No description</value>
</data>
<data name="home$nullServerPath" xml:space="preserve">
<value>No server selected</value>
</data>
<data name="infoBar$error" xml:space="preserve">
<value>Error</value>
</data>
<data name="infoBar$info" xml:space="preserve">
<value>Information</value>
</data>
<data name="infoBar$warning" xml:space="preserve">
<value>Warning</value>
</data>
<data name="lipExecution$nullLipPath" xml:space="preserve">
<value>Unknown Lip path!</value>
</data>
<data name="lipInstaller$cancel.Content" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="lipInstaller$install.Content" xml:space="preserve">
<value>Install</value>
</data>
<data name="lipInstaller$installCompleted" xml:space="preserve">
<value>Installation completed!</value>
</data>
<data name="lipInstaller$installLip" xml:space="preserve">
<value>Install Lip</value>
</data>
<data name="lipuiTitle.Text" xml:space="preserve">
<value>LipUI</value>
</data>
<data name="localTooth$uninstall" xml:space="preserve">
<value>Uninstall</value>
</data>
<data name="localTooth$update" xml:space="preserve">
<value>Update</value>
</data>
<data name="modules$title$allowListViewer" xml:space="preserve">
<value>Allowlist</value>
</data>
<data name="modules$title$modulePage" xml:space="preserve">
<value>Modules</value>
</data>
<data name="modules$title$propertiesEditor" xml:space="preserve">
<value>Server properties</value>
</data>
<data name="navigationView$home.Content" xml:space="preserve">
<value>Home</value>
</data>
<data name="navigationView$localPackages.Content" xml:space="preserve">
<value>Local packages</value>
</data>
<data name="navigationView$packageIndex.Content" xml:space="preserve">
<value>Lip index</value>
</data>
<data name="navigationView$packTooth.Content" xml:space="preserve">
<value>Pack Tooth package</value>
</data>
<data name="propertiesEditor$nullServerPath" xml:space="preserve">
<value>Unknown server path!</value>
</data>
<data name="propertiesEditor$saveCompleted" xml:space="preserve">
<value>Save successful!</value>
</data>
<data name="propertiesEditor$saving" xml:space="preserve">
<value>Saving…</value>
</data>
<data name="readme$notfound" xml:space="preserve">
<value>README.md not found</value>
</data>
<data name="selectServer.Text" xml:space="preserve">
<value>Select server</value>
</data>
<data name="server$editor$cancel" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="server$editor$confirm" xml:space="preserve">
<value>Confirm</value>
</data>
<data name="serverEditView$placeholder$desc.PlaceholderText" xml:space="preserve">
<value>Description</value>
</data>
<data name="serverEditView$placeholder$name.PlaceholderText" xml:space="preserve">
<value>Name</value>
</data>
<data name="serverEditView$placeholder$version.PlaceholderText" xml:space="preserve">
<value>Version</value>
</data>
<data name="serverEditView$placeholder$workingDir.PlaceholderText" xml:space="preserve">
<value>Working directory</value>
</data>
<data name="serverSelection$existed" xml:space="preserve">
<value>Server path already exists!</value>
</data>
<data name="startServer.Text" xml:space="preserve">
<value>Start server</value>
</data>
<data name="tooth$install.Text" xml:space="preserve">
<value>Install</value>
</data>
</root>
Loading

0 comments on commit 96fedc3

Please sign in to comment.