mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 00:03:08 +08:00
Localise wiki overlay error strings
This commit is contained in:
parent
fa0d2f4af2
commit
43b9e537bf
30
osu.Game/Localisation/WikiOverlayStrings.cs
Normal file
30
osu.Game/Localisation/WikiOverlayStrings.cs
Normal file
@ -0,0 +1,30 @@
|
||||
// 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 class WikiOverlayStrings
|
||||
{
|
||||
private const string prefix = @"osu.Game.Resources.Localisation.WikiOverlayStrings";
|
||||
|
||||
/// <summary>
|
||||
/// "Something went wrong when trying to fetch page "{0}"."
|
||||
/// </summary>
|
||||
public static LocalisableString PageErrorDescription(string path) =>
|
||||
new TranslatableString(getKey(@"page_error_description"), @"Something went wrong when trying to fetch page ""{0}"".", path);
|
||||
|
||||
/// <summary>
|
||||
/// "[Reload this page]({0})."
|
||||
/// </summary>
|
||||
public static LocalisableString ReloadPageLink(string url) => new TranslatableString(getKey(@"reload_page_link"), @"[Reload this page]({0}).", url);
|
||||
|
||||
/// <summary>
|
||||
/// "[Return to the main page]({0})."
|
||||
/// </summary>
|
||||
public static LocalisableString ReturnToMainPageLink(string url) => new TranslatableString(getKey(@"return_to_main_page_link"), @"[Return to the main page]({0}).", url);
|
||||
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
}
|
@ -24,7 +24,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
private readonly Bindable<string> path = new Bindable<string>(INDEX_PATH);
|
||||
private readonly Bindable<APIWikiPage?> wikiData = new Bindable<APIWikiPage?>();
|
||||
private readonly IBindable<Language> language = new Bindable<Language>();
|
||||
private readonly Bindable<Language> language = new Bindable<Language>();
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; } = null!;
|
||||
@ -177,7 +177,8 @@ namespace osu.Game.Overlays
|
||||
path.Value = "error";
|
||||
|
||||
LoadDisplay(articlePage = new WikiArticlePage($@"{api.WebsiteRootUrl}/wiki/",
|
||||
$"Something went wrong when trying to fetch page \"{originalPath}\".\n\n[Return to the main page]({INDEX_PATH})."));
|
||||
$"{WikiOverlayStrings.PageErrorDescription(originalPath)}\n\n"
|
||||
+ $"{WikiOverlayStrings.ReloadPageLink(originalPath)}\n{WikiOverlayStrings.ReturnToMainPageLink(INDEX_PATH)}"));
|
||||
}
|
||||
|
||||
private void showParentPage()
|
||||
|
Loading…
Reference in New Issue
Block a user