1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 15:22:55 +08:00

Localise registration window

This commit is contained in:
ansel 2023-01-16 21:31:01 +03:00
parent ff5a12fcb4
commit 4c341db33f
4 changed files with 94 additions and 16 deletions

View File

@ -0,0 +1,77 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Localisation;
namespace osu.Game.Localisation
{
public static class AccountCreationStrings
{
private const string prefix = @"osu.Game.Resources.Localisation.AccountCreation";
/// <summary>
/// "New Player Registration"
/// </summary>
public static LocalisableString NewPlayerRegistration => new TranslatableString(getKey(@"new_player_registration"), @"New Player Registration");
/// <summary>
/// "let&#39;s get you started"
/// </summary>
public static LocalisableString LetsGetYouStarted => new TranslatableString(getKey(@"lets_get_you_started"), @"let's get you started");
/// <summary>
/// "Let&#39;s create an account!"
/// </summary>
public static LocalisableString LetsCreateAnAccount => new TranslatableString(getKey(@"lets_create_an_account"), @"Let's create an account!");
/// <summary>
/// "Help, I can&#39;t access my account!"
/// </summary>
public static LocalisableString HelpICantAccess => new TranslatableString(getKey(@"help_icant_access"), @"Help, I can't access my account!");
/// <summary>
/// "I understand. This account isn&#39;t for me."
/// </summary>
public static LocalisableString AccountIsntForMe => new TranslatableString(getKey(@"account_isnt_for_me"), @"I understand. This account isn't for me.");
/// <summary>
/// "email address"
/// </summary>
public static LocalisableString EmailAddress => new TranslatableString(getKey(@"email_address"), @"email address");
/// <summary>
/// "This will be your public presence. No profanity, no impersonation. Avoid exposing your own personal details, too!"
/// </summary>
public static LocalisableString ThisWillBeYourPublic => new TranslatableString(getKey(@"this_will_be_your_public"),
@"This will be your public presence. No profanity, no impersonation. Avoid exposing your own personal details, too!");
/// <summary>
/// "Will be used for notifications, account verification and in the case you forget your password. No spam, ever."
/// </summary>
public static LocalisableString EmailUsage =>
new TranslatableString(getKey(@"email_usage"), @"Will be used for notifications, account verification and in the case you forget your password. No spam, ever.");
/// <summary>
/// " Make sure to get it right!"
/// </summary>
public static LocalisableString MakeSureToGetIt => new TranslatableString(getKey(@"make_sure_to_get_it"), @" Make sure to get it right!");
/// <summary>
/// "At least "
/// </summary>
public static LocalisableString BeforeCharactersLong => new TranslatableString(getKey(@"before_characters_long"), @"At least ");
/// <summary>
/// "8 characters long"
/// </summary>
public static LocalisableString CharactersLong => new TranslatableString(getKey(@"characters_long"), @"8 characters long");
/// <summary>
/// ". Choose something long but also something you will remember, like a line from your favourite song."
/// </summary>
public static LocalisableString AfterCharactersLong =>
new TranslatableString(getKey(@"after_characters_long"), @". Choose something long but also something you will remember, like a line from your favourite song.");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -17,6 +17,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Online.API;
using osu.Game.Overlays.Settings;
using osu.Game.Resources.Localisation.Web;
@ -71,7 +72,7 @@ namespace osu.Game.Overlays.AccountCreation
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Font = OsuFont.GetFont(size: 20),
Text = "Let's create an account!",
Text = AccountCreationStrings.LetsCreateAnAccount
},
usernameTextBox = new OsuTextBox
{
@ -86,7 +87,7 @@ namespace osu.Game.Overlays.AccountCreation
},
emailTextBox = new OsuTextBox
{
PlaceholderText = "email address",
PlaceholderText = AccountCreationStrings.EmailAddress,
RelativeSizeAxes = Axes.X,
TabbableContentContainer = this
},
@ -118,7 +119,7 @@ namespace osu.Game.Overlays.AccountCreation
AutoSizeAxes = Axes.Y,
Child = new SettingsButton
{
Text = "Register",
Text = LoginPanelStrings.Register,
Margin = new MarginPadding { Vertical = 20 },
Action = performRegistration
}
@ -132,14 +133,14 @@ namespace osu.Game.Overlays.AccountCreation
textboxes = new[] { usernameTextBox, emailTextBox, passwordTextBox };
usernameDescription.AddText("This will be your public presence. No profanity, no impersonation. Avoid exposing your own personal details, too!");
usernameDescription.AddText(AccountCreationStrings.ThisWillBeYourPublic);
emailAddressDescription.AddText("Will be used for notifications, account verification and in the case you forget your password. No spam, ever.");
emailAddressDescription.AddText(" Make sure to get it right!", cp => cp.Font = cp.Font.With(Typeface.Torus, weight: FontWeight.Bold));
emailAddressDescription.AddText(AccountCreationStrings.EmailUsage);
emailAddressDescription.AddText(AccountCreationStrings.MakeSureToGetIt, cp => cp.Font = cp.Font.With(Typeface.Torus, weight: FontWeight.Bold));
passwordDescription.AddText("At least ");
characterCheckText = passwordDescription.AddText("8 characters long");
passwordDescription.AddText(". Choose something long but also something you will remember, like a line from your favourite song.");
passwordDescription.AddText(AccountCreationStrings.BeforeCharactersLong);
characterCheckText = passwordDescription.AddText(AccountCreationStrings.CharactersLong);
passwordDescription.AddText(AccountCreationStrings.AfterCharactersLong);
passwordTextBox.Current.BindValueChanged(_ => updateCharacterCheckTextColour(), true);
characterCheckText.DrawablePartsRecreated += _ => updateCharacterCheckTextColour();

View File

@ -17,6 +17,7 @@ using osu.Game.Overlays.Settings;
using osu.Game.Screens.Menu;
using osuTK;
using osuTK.Graphics;
using osu.Game.Localisation;
namespace osu.Game.Overlays.AccountCreation
{
@ -101,13 +102,13 @@ namespace osu.Game.Overlays.AccountCreation
},
new SettingsButton
{
Text = "Help, I can't access my account!",
Text = AccountCreationStrings.HelpICantAccess,
Margin = new MarginPadding { Top = 50 },
Action = () => game?.OpenUrlExternally(help_centre_url)
},
new DangerousSettingsButton
{
Text = "I understand. This account isn't for me.",
Text = AccountCreationStrings.AccountIsntForMe,
Action = () => this.Push(new ScreenEntry())
},
furtherAssistance = new LinkFlowContainer(cp => cp.Font = cp.Font.With(size: 12))

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -12,6 +10,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Settings;
using osu.Game.Screens.Menu;
using osuTK;
using osu.Game.Localisation;
namespace osu.Game.Overlays.AccountCreation
{
@ -46,18 +45,18 @@ namespace osu.Game.Overlays.AccountCreation
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Font = OsuFont.GetFont(size: 24, weight: FontWeight.Light),
Text = "New Player Registration",
Text = AccountCreationStrings.NewPlayerRegistration,
},
new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Font = OsuFont.GetFont(size: 12),
Text = "let's get you started",
Text = AccountCreationStrings.LetsGetYouStarted,
},
new SettingsButton
{
Text = "Let's create an account!",
Text = AccountCreationStrings.LetsCreateAnAccount,
Margin = new MarginPadding { Vertical = 120 },
Action = () => this.Push(new ScreenWarning())
}