Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localize/ise FluentHub #244

Merged
merged 12 commits into from
Sep 4, 2022
12 changes: 3 additions & 9 deletions src/FluentHub.Uwp/Helpers/NumberNormalizerHelper.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FluentHub.Uwp.Helpers
namespace FluentHub.Uwp.Helpers
{
public static class NumberNormalizerHelper
{
Expand All @@ -13,9 +7,9 @@ public static class NumberNormalizerHelper
private const int Billion = 1000000000;

/// <summary>
/// This method convert number (greater then 999) to readable form, like 25.5k, 1.2m, 2.4b
/// This method converts numbers (greater then 999) to a readable form, such as 25.5k, 1.2m, 2.4b
/// </summary>
/// <param name="number">Positive integer value which more then 999</param>
/// <param name="number">Positive integer value that is more than 999</param>
/// <returns>String value of normalized number (e.g. 25.5k)</returns>
public static string NormalizeNumber(int number)
{
Expand Down
193 changes: 176 additions & 17 deletions src/FluentHub.Uwp/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -59,46 +59,46 @@
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<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: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: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: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: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: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:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
Expand All @@ -117,6 +117,36 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AccountSettingsButton.Text" xml:space="preserve">
<value>Account Settings</value>
</data>
<data name="AppearancePageColorBlock.Title" xml:space="preserve">
<value>Choose your color</value>
</data>
<data name="AppearancePageGeneralHeader.Text" xml:space="preserve">
<value>General</value>
</data>
<data name="AppearancePageHeader.Text" xml:space="preserve">
<value>Appearance</value>
</data>
<data name="AppearancePageLocaleBlock.Title" xml:space="preserve">
<value>Language</value>
</data>
<data name="AppearancePageLocaleHeader.Text" xml:space="preserve">
<value>Language</value>
</data>
<data name="AppearancePageThemeBlock.Title" xml:space="preserve">
<value>Custom themes</value>
</data>
<data name="FeatureNotAvailable.Text" xml:space="preserve">
<value>Not available yet.</value>
</data>
<data name="FeedsPageHeader.Text" xml:space="preserve">
<value>Activity</value>
</data>
<data name="FeedsPageNoRecentActivityBody.Text" xml:space="preserve">
<value>No recent activity.</value>
</data>
<data name="FifthStepToAuthorize.Text" xml:space="preserve">
<value>Proceed to the FluentHub application.</value>
</data>
Expand All @@ -126,6 +156,27 @@
<data name="ForthStepToAuthorize.Text" xml:space="preserve">
<value>Click "Open FluentHub DEV";</value>
</data>
<data name="GoBackButton.TooltipService.Tooltip" xml:space="preserve">
<value>Back</value>
</data>
<data name="GoForwardButton.TooltipService.Tooltip" xml:space="preserve">
<value>Forward</value>
</data>
<data name="HomePageFavoritesHeader.Text" xml:space="preserve">
<value>Favorites</value>
</data>
<data name="HomePageFavoritesNotAvailableBody.Text" xml:space="preserve">
<value>No favorite items available.</value>
</data>
<data name="HomePageGeneralHeader.Text" xml:space="preserve">
<value>Work</value>
</data>
<data name="HomePageHeader.Text" xml:space="preserve">
<value>Home</value>
</data>
<data name="HomePageRecentActivityHeader.Text" xml:space="preserve">
<value>Recent</value>
</data>
<data name="IntroDocumentationLink.Content" xml:space="preserve">
<value>Documentation</value>
</data>
Expand All @@ -135,10 +186,118 @@
<data name="LoginWithGitHub.Content" xml:space="preserve">
<value>Login with GitHub</value>
</data>
<data name="NewMutation.Text" xml:space="preserve">
<value>New</value>
</data>
<data name="NewMutationOrganizationButton.Text" xml:space="preserve">
<value>New organization</value>
</data>
<data name="NewMutationRepoButton.Text" xml:space="preserve">
<value>New repository</value>
</data>
<data name="NotificationsPageFilterByReasonAssigned.Text" xml:space="preserve">
<value>📋 Assigned</value>
</data>
<data name="NotificationsPageFilterByReasonDone.Text" xml:space="preserve">
<value>Done</value>
</data>
<data name="NotificationsPageFilterByReasonFlyoutBody.Text" xml:space="preserve">
<value>Filter by:</value>
</data>
<data name="NotificationsPageFilterByReasonInbox.Text" xml:space="preserve">
<value>Inbox</value>
</data>
<data name="NotificationsPageFilterByReasonMentioned.Text" xml:space="preserve">
<value>✉️ Mentioned</value>
</data>
<data name="NotificationsPageFilterByReasonMentionedTeam.Text" xml:space="preserve">
<value>📧 Team Mentioned</value>
</data>
<data name="NotificationsPageFilterByReasonParticipating.Text" xml:space="preserve">
<value>🤝‍ Participating</value>
</data>
<data name="NotificationsPageFilterByReasonReview.Text" xml:space="preserve">
<value>👀 Review Requested</value>
</data>
<data name="NotificationsPageFilterByReasonSaved.Text" xml:space="preserve">
<value>Saved</value>
</data>
<data name="NotificationsPageGroupByViewFlyoutBody.Text" xml:space="preserve">
<value>Group by:</value>
</data>
<data name="NotificationsPageGroupByViewNone.Text" xml:space="preserve">
<value>None</value>
</data>
<data name="NotificationsPageGroupByViewPrimaryDate.Text" xml:space="preserve">
<value>Date</value>
</data>
<data name="NotificationsPageGroupByViewRepository.Text" xml:space="preserve">
<value>Repository</value>
</data>
<data name="NotificationsPageHeader.Text" xml:space="preserve">
<value>Notifications</value>
</data>
<data name="NotificationsPageNoRecentNotificationsBody.Text" xml:space="preserve">
<value>No recent notifications.</value>
</data>
<data name="NotificationsPageSearchBar.PlaceholderText" xml:space="preserve">
<value>Search notifications</value>
</data>
<data name="NotificationsPageUnreadToggle.Content" xml:space="preserve">
<value>Unread</value>
</data>
<data name="RefreshBody.Text" xml:space="preserve">
<value>Refresh</value>
</data>
<data name="RepositoriesListHeader.Text" xml:space="preserve">
<value>Repositories</value>
</data>
<data name="SearchBar.PlaceholderText" xml:space="preserve">
<value>Search</value>
</data>
<data name="SearchBarButton.TooltipService.Tooltip" xml:space="preserve">
<value>Search</value>
</data>
<data name="SecondStepToAuthorize.Text" xml:space="preserve">
<value>If you are in administration of one or more organizations, please give FluentHub access to them;</value>
</data>
<data name="SettingsButton.Text" xml:space="preserve">
<value>Settings</value>
</data>
<data name="SettingsFeedbackButton.Content" xml:space="preserve">
<value>Feedback</value>
</data>
<data name="SettingsGetHelpButton.Content" xml:space="preserve">
<value>Get help</value>
</data>
<data name="SignOutButton.Text" xml:space="preserve">
<value>Sign Out</value>
</data>
<data name="SwitchAccountFlyoutSub.Text" xml:space="preserve">
<value>Switch account</value>
</data>
<data name="ThirdStepToAuthorize.Text" xml:space="preserve">
<value>Click "Authorize FluentHub";</value>
</data>
<data name="UserDiscussionsButton.Text" xml:space="preserve">
<value>Your discussions</value>
</data>
<data name="UserIssuesButton.Text" xml:space="preserve">
<value>Your issues</value>
</data>
<data name="UserOrganizationsButton.Text" xml:space="preserve">
<value>Your organizations</value>
</data>
<data name="UserProfileButton.Text" xml:space="preserve">
<value>Your profile</value>
</data>
<data name="UserPullRequestsButton.Text" xml:space="preserve">
<value>Your pull requests</value>
</data>
<data name="UserRepositoriesButton.Text" xml:space="preserve">
<value>Your repositories</value>
</data>
<data name="UserStarsButton.Text" xml:space="preserve">
<value>Your stars</value>
</data>
</root>
34 changes: 21 additions & 13 deletions src/FluentHub.Uwp/Views/AppSettings/AppearancePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="using:FluentHub.Uwp.Helpers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:overview="using:FluentHub.Uwp.UserControls.Overview"
xmlns:uc="using:FluentHub.Uwp.UserControls"
Expand Down Expand Up @@ -32,46 +33,57 @@
</Grid.RowDefinitions>

<TextBlock
x:Name="AppearancePageHeader"
Margin="0,0,0,20"
Style="{StaticResource TitleTextBlockStyle}"
Text="Appearance" />
Text="{helpers:ResourceString Name=AppearancePageHeader/Text}" />

<StackPanel Grid.Row="1">

<TextBlock
x:Name="AppearancePageGeneralHeader"
Margin="0,16,0,8"
Style="{StaticResource BodyStrongTextBlockStyle}"
Text="General" />
Text="{helpers:ResourceString Name=AppearancePageGeneralHeader/Text}" />

<StackPanel Spacing="4">

<uc:SettingsBlockControl Title="FluentHub color" IsClickable="False">
<uc:SettingsBlockControl x:Name="AppearancePageColorBlock" Title="{helpers:ResourceString Name=AppearancePageColorBlock/Title}" IsClickable="False">
<uc:SettingsBlockControl.Icon>
<FontIcon Glyph="&#xE790;" />
</uc:SettingsBlockControl.Icon>

<ComboBox ItemsSource="{x:Bind ViewModel.Themes}" SelectedIndex="{x:Bind ViewModel.SelectedThemeIndex, Mode=TwoWay}" />
</uc:SettingsBlockControl>

<uc:SettingsBlockControl Title="Custom themes" IsClickable="False">
<uc:SettingsBlockControl x:Name="AppearancePageThemeBlock" Title="{helpers:ResourceString Name=AppearancePageThemeBlock/Title}" IsClickable="False">
<uc:SettingsBlockControl.Icon>
<FontIcon Glyph="&#xE771;" />
</uc:SettingsBlockControl.Icon>

<uc:SettingsBlockControl.ExpandableContent>
<Grid Margin="16">
<TextBlock Text="Here's various custom themes" />
<TextBlock x:Name="AppearancePageThemeBlockBody" Text="{helpers:ResourceString Name=FeatureNotAvailable/Text}" />
</Grid>
</uc:SettingsBlockControl.ExpandableContent>
</uc:SettingsBlockControl>

<uc:SettingsBlockControl Title="Language" IsClickable="False">
</StackPanel>

<TextBlock
x:Name="AppearancePageLocaleHeader"
Margin="0,16,0,8"
Style="{StaticResource BodyStrongTextBlockStyle}"
Text="{helpers:ResourceString Name=AppearancePageLocaleHeader/Text}" />

<StackPanel Spacing="4">
<uc:SettingsBlockControl x:Name="AppearancePageLocaleBlock" Title="{helpers:ResourceString Name=AppearancePageLocaleBlock/Title}" IsClickable="False">
<uc:SettingsBlockControl.Icon>
<FontIcon Glyph="&#xF2B7;" />
</uc:SettingsBlockControl.Icon>
<ComboBox ItemsSource="{x:Bind ViewModel.DefaultLanguages}" SelectedIndex="{x:Bind ViewModel.SelectedLanguageIndex, Mode=TwoWay}" />
</uc:SettingsBlockControl>

</StackPanel>

</StackPanel>
Expand All @@ -83,15 +95,11 @@
Spacing="4">
<StackPanel Orientation="Horizontal" Spacing="8">
<FontIcon FontSize="14" Glyph="&#xE9CE;" />
<TextBlock Style="{StaticResource BodyTextBlockStyle}">
<Hyperlink NavigateUri="https://github.com/FluentHub/FluentHub#-contact">Get help</Hyperlink>
</TextBlock>
<HyperlinkButton x:Name="AppearancePageGetHelpButton" NavigateUri="https://github.com/FluentHub/FluentHub#-contact" Content="{helpers:ResourceString Name=SettingsGetHelpButton/Content}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<FontIcon FontSize="14" Glyph="&#xED15;" />
<TextBlock Style="{StaticResource BodyTextBlockStyle}">
<Hyperlink NavigateUri="https://github.com/FluentHub/FluentHub#-feedback">Give feedback</Hyperlink>
</TextBlock>
<HyperlinkButton x:Name="AppearancePageFeedbackButton" NavigateUri="https://github.com/FluentHub/FluentHub#-feedback" Content="{helpers:ResourceString Name=SettingsFeedbackButton/Content}"/>
</StackPanel>
</StackPanel>
</Grid>
Expand Down
Loading