Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
添加Contributor类
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichiamane committed Oct 29, 2019
1 parent ae0f4e8 commit 0015080
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 0 deletions.
57 changes: 57 additions & 0 deletions PixivFSUWP/Data/Contributor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Data.Json;

namespace PixivFSUWP.Data
{
public enum Contribution
{
doc, translation, code, bug, idea, unknown
}

public class Contributor
{
public string AvatarUrl { get; set; }
public string DisplayName { get; set; }
public string Account { get; set; }
public string ProfileUrl { get; set; }
public List<Contribution> Contributions { get; set; }

//由字符串返回Contribution枚举
private static Contribution stringToContribution(string source)
{
switch (source)
{
case "doc":
return Contribution.doc;
case "translation":
return Contribution.translation;
case "code":
return Contribution.code;
case "bug":
return Contribution.bug;
case "ideas":
return Contribution.idea;
default:
return Contribution.unknown;
}
}

public static Contributor FromJsonValue(JsonObject Source)
{
Contributor toret = new Contributor();
toret.Account = Source["login"].TryGetString();
toret.DisplayName = Source["name"].TryGetString();
toret.AvatarUrl = Source["avatar_url"].TryGetString();
toret.ProfileUrl = Source["profile"].TryGetString();
toret.Contributions = new List<Contribution>();
var contributions = Source["contributions"].GetArray();
foreach (var contribution in contributions)
toret.Contributions.Add(stringToContribution(contribution.TryGetString()));
return toret;
}
}
}
15 changes: 15 additions & 0 deletions PixivFSUWP/MultilingualResources/PixivFSUWP.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,21 @@
<target state="translated">Recalculating...</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="Contributors.Text" translate="yes" xml:space="preserve">
<source>Contributors</source>
<target state="new">Contributors</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
<trans-unit id="Developers.Text" translate="yes" xml:space="preserve">
<source>Developers</source>
<target state="new">Developers</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
<trans-unit id="MainDeveloper.Text" translate="yes" xml:space="preserve">
<source>Main developer</source>
<target state="new">Main developer</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
</group>
</body>
</file>
Expand Down
15 changes: 15 additions & 0 deletions PixivFSUWP/MultilingualResources/PixivFSUWP.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,21 @@
<target state="translated">重新计算中...</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="Contributors.Text" translate="yes" xml:space="preserve">
<source>Contributors</source>
<target state="new">Contributors</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
<trans-unit id="Developers.Text" translate="yes" xml:space="preserve">
<source>Developers</source>
<target state="new">Developers</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
<trans-unit id="MainDeveloper.Text" translate="yes" xml:space="preserve">
<source>Main developer</source>
<target state="new">Main developer</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
</group>
</body>
</file>
Expand Down
15 changes: 15 additions & 0 deletions PixivFSUWP/MultilingualResources/PixivFSUWP.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,21 @@
<target state="translated">重新计算中...</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="Contributors.Text" translate="yes" xml:space="preserve">
<source>Contributors</source>
<target state="new">Contributors</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
<trans-unit id="Developers.Text" translate="yes" xml:space="preserve">
<source>Developers</source>
<target state="new">Developers</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
<trans-unit id="MainDeveloper.Text" translate="yes" xml:space="preserve">
<source>Main developer</source>
<target state="new">Main developer</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
</group>
</body>
</file>
Expand Down
1 change: 1 addition & 0 deletions PixivFSUWP/PixivFSUWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
<Compile Include="Data\BookmarkIllustsCollection.cs" />
<Compile Include="Data\CommentAvatarLoader.cs" />
<Compile Include="Data\CommentsCollection.cs" />
<Compile Include="Data\Contributor.cs" />
<Compile Include="Data\CurrentUser.cs" />
<Compile Include="Data\FollowingIllustsCollection.cs" />
<Compile Include="Data\IllustCommentItem.cs" />
Expand Down
6 changes: 6 additions & 0 deletions PixivFSUWP/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
BorderThickness="1.5" Margin="15,5,15,0" x:Uid="DeleteInvalid"
Width="170" x:Name="btnDelInvalid" Click="btnDelInvalid_Click"/>
</StackPanel>
<!--作者和参与者-->
<StackPanel Margin="0,10">
<TextBlock Margin="15,0,15,0" FontSize="18" FontWeight="Bold" x:Uid="Developers"/>
<TextBlock Margin="15,10,15,0" x:Uid="MainDeveloper"/>
<TextBlock Margin="15,10,15,0" x:Uid="Contributors"/>
</StackPanel>
<StackPanel Margin="0,10">
<TextBlock Margin="15,0,15,0" FontSize="18" FontWeight="Bold" x:Uid="VersionInfo"/>
<TextBlock Margin="15,10,15,0" x:Name="txtVersion"/>
Expand Down
12 changes: 12 additions & 0 deletions PixivFSUWP/Strings/en/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@
<value>Comments</value>
<comment>PlainText</comment>
</data>
<data name="Contributors.Text" xml:space="preserve">
<value>Contributors</value>
<comment>TextBlock</comment>
</data>
<data name="CreatingTimelinePlain" xml:space="preserve">
<value>Generating Windows® Timeline™</value>
<comment>PlainText</comment>
Expand Down Expand Up @@ -225,6 +229,10 @@
<value>Detail</value>
<comment>PlainText</comment>
</data>
<data name="Developers.Text" xml:space="preserve">
<value>Developers</value>
<comment>TextBlock</comment>
</data>
<data name="DownloadingUgoiraPlain" xml:space="preserve">
<value>Downloading ugoira</value>
<comment>PlainText</comment>
Expand Down Expand Up @@ -345,6 +353,10 @@
<value>*This will log you out on all your Windows devices</value>
<comment>TextBlock</comment>
</data>
<data name="MainDeveloper.Text" xml:space="preserve">
<value>Main developer</value>
<comment>TextBlock</comment>
</data>
<data name="MalePlain" xml:space="preserve">
<value>Male</value>
<comment>PlainText</comment>
Expand Down

0 comments on commit 0015080

Please sign in to comment.