1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 03:22:54 +08:00

Optimize code style

Co-authored-by: frenzibyte <frenzibyte@gmail.com>
Co-authored-by: bdach <dach.bartlomiej@gmail.com>
This commit is contained in:
kj415j45 2021-07-18 00:28:32 +08:00
parent 51742da89a
commit 1b4bff0d9f
4 changed files with 8 additions and 52 deletions

View File

@ -9,16 +9,6 @@ namespace osu.Game.Localisation
{ {
private const string prefix = @"osu.Game.Resources.Localisation.News"; private const string prefix = @"osu.Game.Resources.Localisation.News";
/// <summary>
/// "frontpage"
/// </summary>
public static LocalisableString FrontPageString => new TranslatableString(getKey(@"front_page"), @"frontpage");
/// <summary>
/// "news"
/// </summary>
public static LocalisableString HeaderTitle => new TranslatableString(getKey(@"header_title"), @"news");
/// <summary> /// <summary>
/// "join the real-time discussion" /// "join the real-time discussion"
/// </summary> /// </summary>

View File

@ -1,29 +0,0 @@
// 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 WikiStrings
{
private const string prefix = @"osu.Game.Resources.Localisation.Wiki";
/// <summary>
/// "index"
/// </summary>
public static LocalisableString IndexPageString => new TranslatableString(getKey(@"index_page"), @"index");
/// <summary>
/// "wiki"
/// </summary>
public static LocalisableString HeaderTitle => new TranslatableString(getKey(@"header_title"), @"wiki");
/// <summary>
/// "knowledge base"
/// </summary>
public static LocalisableString HeaderDescription => new TranslatableString(getKey(@"header_description"), @"knowledge base");
private static string getKey(string key) => $"{prefix}:{key}";
}
}

View File

@ -5,16 +5,13 @@ using System;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Localisation; using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.News namespace osu.Game.Overlays.News
{ {
public class NewsHeader : BreadcrumbControlOverlayHeader public class NewsHeader : BreadcrumbControlOverlayHeader
{ {
public static LocalisableString FrontPageString => NewsStrings.FrontPageString; public LocalisableString FrontPageString => osu.Game.Resources.Localisation.Web.NewsStrings.IndexTitleInfo;
public static LocalisableString HeaderTitle => NewsStrings.HeaderTitle;
public static LocalisableString HeaderDescription => NewsStrings.HeaderDescription;
public Action ShowFrontPage; public Action ShowFrontPage;
private readonly Bindable<string> article = new Bindable<string>(); private readonly Bindable<string> article = new Bindable<string>();
@ -65,8 +62,8 @@ namespace osu.Game.Overlays.News
{ {
public NewsHeaderTitle() public NewsHeaderTitle()
{ {
Title = HeaderTitle; Title = LayoutStrings.MenuHomeNewsIndex;
Description = HeaderDescription; Description = osu.Game.Localisation.NewsStrings.HeaderDescription;
IconTexture = "Icons/Hexacons/news"; IconTexture = "Icons/Hexacons/news";
} }
} }

View File

@ -6,17 +6,15 @@ using System.Linq;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Localisation;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Wiki namespace osu.Game.Overlays.Wiki
{ {
public class WikiHeader : BreadcrumbControlOverlayHeader public class WikiHeader : BreadcrumbControlOverlayHeader
{ {
private const string index_path = "Main_Page"; private const string index_path = "Main_Page";
public static LocalisableString IndexPageString => WikiStrings.IndexPageString; public LocalisableString IndexPageString => LayoutStrings.HeaderHelpIndex;
public static LocalisableString HeaderTitle => WikiStrings.HeaderTitle;
public static LocalisableString HeaderDescription => WikiStrings.HeaderDescription;
public readonly Bindable<APIWikiPage> WikiPageData = new Bindable<APIWikiPage>(); public readonly Bindable<APIWikiPage> WikiPageData = new Bindable<APIWikiPage>();
@ -77,8 +75,8 @@ namespace osu.Game.Overlays.Wiki
{ {
public WikiHeaderTitle() public WikiHeaderTitle()
{ {
Title = HeaderTitle; Title = LayoutStrings.MenuHelpGetWiki;
Description = HeaderDescription; Description = PageTitleStrings.MainWikiControllerDefault;
IconTexture = "Icons/Hexacons/wiki"; IconTexture = "Icons/Hexacons/wiki";
} }
} }