Skip to content

Add a link to reload the error page on wiki overlay #31376

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

CloneWith
Copy link
Contributor

@CloneWith CloneWith commented Jan 1, 2025

Most of the errors encountered in the wiki overlay are about poor network and request timeout. So we may want to reload the current page when an error page is displayed.

At the same time I noticed that when changing the in-game language while we are on the error page, the overlay would stick to error page because of the set value of path. In this PR I use a variable to store the path of the last available (request succeeded) page, with which we can bring users back.

@CloneWith CloneWith changed the title Wiki/refresh Add a link to reload the error page on wiki overlay Jan 1, 2025
Comment on lines 183 to 184
$"{WikiOverlayStrings.PageErrorDescription(originalPath)}\n\n"
+ $"{WikiOverlayStrings.ReloadPageLink(originalPath)}\n{WikiOverlayStrings.ReturnToMainPageLink(INDEX_PATH)}"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't interpolate localisable strings like this. It defeats the entire point of localisable strings as they get ToString()ed if you do it like this. Use LocaisableString.Format() or LocalisableString.Interpolate() instead.

Copy link
Contributor Author

@CloneWith CloneWith Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WikiArticlePage doesn't support markdown input with LocalisableString, making it unable to display localised error content.
An possible solution is to use a TextFlowContainer or something like this, but I think it's going too far with this PR and needs some discussion. I'll complete the format part here.

@bdach
Copy link
Collaborator

bdach commented Feb 25, 2025

Merge conflicts here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants