Skip to content

Commit

Permalink
Begin localisation work + Twitter mode
Browse files Browse the repository at this point in the history
  • Loading branch information
WamWooWam committed Nov 22, 2024
1 parent dc74335 commit 92e2719
Show file tree
Hide file tree
Showing 10 changed files with 321 additions and 12 deletions.
8 changes: 7 additions & 1 deletion UniSky/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
</ResourceDictionary.ThemeDictionaries>

<x:String x:Key="BlueSkyLogoPath">M13.873 3.77C21.21 9.243 29.103 20.342 32 26.3v15.732c0-.335-.13.043-.41.858-1.512 4.414-7.418 21.642-20.923 7.87-7.111-7.252-3.819-14.503 9.125-16.692-7.405 1.252-15.73-.817-18.014-8.93C1.12 22.804 0 8.431 0 6.488 0-3.237 8.579-.18 13.873 3.77ZM50.127 3.77C42.79 9.243 34.897 20.342 32 26.3v15.732c0-.335.13.043.41.858 1.512 4.414 7.418 21.642 20.923 7.87 7.111-7.252 3.819-14.503-9.125-16.692 7.405 1.252 15.73-.817 18.014-8.93C62.88 22.804 64 8.431 64 6.488 64-3.237 55.422-.18 50.127 3.77Z</x:String>

<x:Int32 x:Key="BlueSkyLogoWidth">64</x:Int32>
<x:Int32 x:Key="BlueSkyLogoHeight">57</x:Int32>

<!--<x:String x:Key="BlueSkyLogoPath">m64.67 6.525c-1.74 2.61-4.06 4.93-6.525 6.815 0 .58 0 1.16 0 1.74 0 17.4-13.195 37.555-37.555 37.555-7.395 0-14.355-2.175-20.155-5.945 1.015.145 2.03.145 3.19.145 6.235 0 11.89-2.175 16.385-5.655-5.8-.145-10.585-3.915-12.325-9.135.87.145 1.595.29 2.465.29 1.16 0 2.32-.145 3.48-.435C7.54 30.595 2.9 25.23 2.9 18.85c0 0 0-.145 0-.145 1.74 1.015 3.77 1.595 5.945 1.595C5.365 17.98 3.045 13.92 3.045 9.425c0-2.465.58-4.64 1.74-6.67 6.525 7.975 16.24 13.195 27.115 13.775-.29-1.015-.29-2.03-.29-3.045 0-7.25 5.945-13.195 13.195-13.195 3.77 0 7.25 1.595 9.57 4.205 3.045-.58 5.8-1.74 8.41-3.19-1.015 3.045-3.045 5.655-5.8 7.25 2.61-.29 5.22-1.015 7.54-2.03z</x:String>
<x:Int32 x:Key="BlueSkyLogoWidth">64</x:Int32>
<x:Int32 x:Key="BlueSkyLogoHeight">38</x:Int32>-->

<Thickness x:Key="HairlineThickness">0,1,0,0</Thickness>
<CornerRadius x:Key="ControlCornerRadius">0,0,0,0</CornerRadius>
</ResourceDictionary>
Expand Down
3 changes: 3 additions & 0 deletions UniSky/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Core;
using Windows.ApplicationModel.Resources.Core;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;
Expand Down Expand Up @@ -38,6 +39,8 @@ public App()
this.Suspending += OnSuspending;

this.ConfigureServices();

ResourceContext.SetGlobalQualifierValue("Custom", "Twitter", ResourceQualifierPersistence.None);
}

private void ConfigureServices()
Expand Down
8 changes: 6 additions & 2 deletions UniSky/DataTemplates/FeedTemplates.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
Foreground="{ThemeResource ApplicationSecondaryForegroundThemeBrush}"
FontSize="12"
Margin="8,0">
Reposted by <Run Text="{x:Bind RetweetedBy.Name, Mode=OneWay}" FontWeight="Bold"/>
<Run x:Uid="RetweetedByRun" Text="Reposted by"/> <Run Text="{x:Bind RetweetedBy.Name, Mode=OneWay}" FontWeight="Bold"/>
</TextBlock>
</Grid>

Expand All @@ -238,7 +238,7 @@
Foreground="{ThemeResource ApplicationSecondaryForegroundThemeBrush}"
FontSize="12"
Margin="8,0">
Replying to <Run Text="{x:Bind ReplyTo.Name, Mode=OneWay}" FontWeight="Bold"/>
<Run x:Uid="ReplyingToRun" Text="Replying to"/> <Run Text="{x:Bind ReplyTo.Name, Mode=OneWay}" FontWeight="Bold"/>
</TextBlock>
</Grid>

Expand Down Expand Up @@ -305,6 +305,7 @@
</Grid.ColumnDefinitions>

<Button x:Name="RepliesButton"
x:Uid="PostReplyButton"
Grid.Column="0"
Style="{StaticResource FeedItemActionButtonStyle}">
<StackPanel Orientation="Horizontal">
Expand All @@ -321,6 +322,7 @@
</StackPanel>
</Button>
<Button x:Name="RetweetButton"
x:Uid="PostRetweetButton"
Grid.Column="1"
Style="{StaticResource FeedItemActionButtonStyle}">
<StackPanel Orientation="Horizontal">
Expand All @@ -338,6 +340,7 @@
</Button>

<Button x:Name="LikeButton"
x:Uid="PostLikeButton"
Grid.Column="2"
Style="{StaticResource FeedItemActionButtonStyle}"
Command="{x:Bind LikeCommand}">
Expand All @@ -356,6 +359,7 @@
</Button>

<Button x:Name="MoreButton"
x:Uid="PostMoreButton"
Style="{StaticResource FeedItemActionButtonStyle}"
HorizontalAlignment="Right"
Grid.Column="3"
Expand Down
8 changes: 6 additions & 2 deletions UniSky/Helpers/Composition/BirdAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public static void RunBirdAnimation(Frame frame)
if (!ApiInformation.IsMethodPresent(typeof(Compositor).FullName, "CreateGeometricClip"))
return;

var bskyLogoPath = (string)App.Current.Resources["BlueSkyLogoPath"];
var bskyLogoWidth = (int)App.Current.Resources["BlueSkyLogoWidth"];
var bskyLogoHeight = (int)App.Current.Resources["BlueSkyLogoHeight"];

var size = new Size(frame.ActualWidth, frame.ActualHeight);
var frameVisual = ElementCompositionPreview.GetElementVisual(frame);

Expand All @@ -37,9 +41,9 @@ public static void RunBirdAnimation(Frame frame)
var offsetY = (float)(size.Height / 2.0);

var compositor = frameVisual.Compositor;
var clip = compositor.CreateGeometricClip(BSKY_LOGO);
var clip = compositor.CreateGeometricClip(bskyLogoPath);
clip.ViewBox = compositor.CreateViewBox();
clip.ViewBox.Size = new Vector2(WIDTH, HEIGHT);
clip.ViewBox.Size = new Vector2(bskyLogoWidth, bskyLogoHeight);
clip.ViewBox.Stretch = CompositionStretch.None;
clip.AnchorPoint = new Vector2(0.5f, 0.5f);
clip.Scale = new Vector2(initialScale, initialScale);
Expand Down
6 changes: 3 additions & 3 deletions UniSky/Pages/ProfilePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@
Foreground="{ThemeResource ApplicationSecondaryForegroundThemeBrush}"
Typography.NumeralAlignment="Tabular"
Margin="0,4,0,0">
<Run Foreground="{ThemeResource ApplicationForegroundThemeBrush}" Text="{Binding Followers, Mode=OneWay, FallbackValue=0}"/> Followers
<Run Foreground="{ThemeResource ApplicationForegroundThemeBrush}" Text="{Binding Following, Mode=OneWay, FallbackValue=0}"/> Following
<Run Foreground="{ThemeResource ApplicationForegroundThemeBrush}" Text="{Binding Posts, Mode=OneWay, FallbackValue=0}"/> Posts
<Run Foreground="{ThemeResource ApplicationForegroundThemeBrush}" Text="{Binding Followers, Mode=OneWay, FallbackValue=0}"/> <Run x:Uid="FollowersRun"/>
<Run Foreground="{ThemeResource ApplicationForegroundThemeBrush}" Text="{Binding Following, Mode=OneWay, FallbackValue=0}"/> <Run x:Uid="FollowingRun"/>
<Run Foreground="{ThemeResource ApplicationForegroundThemeBrush}" Text="{Binding Posts, Mode=OneWay, FallbackValue=0}"/> <Run x:Uid="PostsRun"/>
</TextBlock>
</StackPanel>

Expand Down
153 changes: 153 additions & 0 deletions UniSky/Resources/en-GB/Resources.resw
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<?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="PostsRun.Text" xml:space="preserve">
<value>Posts</value>
</data>
<data name="FollowersRun.Text" xml:space="preserve">
<value>Followers</value>
</data>
<data name="FollowingRun.Text" xml:space="preserve">
<value>Following</value>
</data>
<data name="FeedPosts" xml:space="preserve">
<value>Posts</value>
</data>
<data name="FeedReplies" xml:space="preserve">
<value>Posts w/ Replies</value>
</data>
<data name="FeedMedia" xml:space="preserve">
<value>Media</value>
</data>
<data name="RetweetedByRun.Text" xml:space="preserve">
<value>Reposted by</value>
</data>
<data name="PostReplyButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Replies</value>
</data>
<data name="PostRetweetButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Repost</value>
</data>
<data name="PostLikeButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Like</value>
</data>
<data name="ReplyingToRun.Text" xml:space="preserve">
<value>Replying to</value>
</data>
</root>
Loading

0 comments on commit 92e2719

Please sign in to comment.