Skip to content

Add localisation support to LatencyCertifierScreen#37240

Open
diquoks wants to merge 2 commits intoppy:masterfrom
diquoks:localisation/latency-certifier
Open

Add localisation support to LatencyCertifierScreen#37240
diquoks wants to merge 2 commits intoppy:masterfrom
diquoks:localisation/latency-certifier

Conversation

@diquoks
Copy link
Copy Markdown
Contributor

@diquoks diquoks commented Apr 8, 2026

No description provided.

@diquoks
Copy link
Copy Markdown
Contributor Author

diquoks commented Apr 8, 2026

strings' keys are a bit awkward, will fix later

Copy link
Copy Markdown
Contributor Author

@diquoks diquoks left a comment

Choose a reason for hiding this comment

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

some side notes

also tidied up the style a bit: changed letter case and placed the missing punctuation marks at the ends of sentences

Comment on lines +69 to +77
/// <summary>
/// "Polling: {0} Hz | Monitor: {1:N0} Hz | Exclusive: {2}"
/// </summary>
public static LocalisableString StatusTextMonitor(int pollingRate, float refreshRate, LocalisableString exclusiveStatus) => new TranslatableString(getKey(@"status_text_monitor"), @"Polling: {0} Hz | Monitor: {1:N0} Hz | Exclusive: {2}", pollingRate, refreshRate, exclusiveStatus);

/// <summary>
/// "Input: {0} Hz | Update: {1} Hz | Draw: {2} Hz"
/// </summary>
public static LocalisableString StatusTextRendering(double inputRate, double updateRate, double drawRate) => new TranslatableString(getKey(@"status_text_rendering"), @"Input: {0} Hz | Update: {1} Hz | Draw: {2} Hz", inputRate, updateRate, drawRate);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added separators (" | ") for more readability

Comment on lines +64 to +67
/// <summary>
/// "To complete certification, the difficulty level will now decrease until you can get {0} rounds correct in a row!"
/// </summary>
public static LocalisableString StatusTextCertification(int roundsCount) => new TranslatableString(getKey(@"status_text_certification"), @"To complete certification, the difficulty level will now decrease until you can get {0} rounds correct in a row!", roundsCount);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

now this line string also using a constant by analogy with ButtonCertifyTooltipConfirm

Comment on lines +32 to +40
/// <summary>
/// "Use the arrow keys or Z/X/F/J to control the display."
/// </summary>
public static LocalisableString ExplanatoryTextControlDisplay => new TranslatableString(getKey(@"explanatory_text_control_display"), @"Use the arrow keys or Z/X/F/J to control the display.");

/// <summary>
/// "Tab key to change focus. Space to change display mode."
/// </summary>
public static LocalisableString ExplanatoryTextDisplayMode => new TranslatableString(getKey(@"explanatory_text_display_mode"), @"Tab key to change focus. Space to change display mode.");
Copy link
Copy Markdown
Contributor Author

@diquoks diquoks Apr 8, 2026

Choose a reason for hiding this comment

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

i think these strings should be reworked, since, for example, you can press absolutely any keys to initiate a hit

i also don't like how "Tab key" & "Space" are used here, but i can't suggest anything better

idk

Comment on lines +17 to +20
/// <summary>
/// "Approach Rate"
/// </summary>
public static LocalisableString ApproachRate => new TranslatableString(getKey(@"approach_rate"), @"Approach Rate");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

SongSelectStrings.ApproachRate can be used instead, not sure

Comment on lines +94 to +97
/// <summary>
/// "Retry"
/// </summary>
public static LocalisableString ButtonRetryText => new TranslatableString(getKey(@"button_retry_text"), @"Retry");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

GameplayMenuOverlayStrings.Retry can be used instead, not sure

Comment on lines +241 to +256
currentLanguage.BindValueChanged(_ =>
// schedule required because `LocalisationManager` won't have new language set correctly yet.
Schedule(() =>
{
explanatoryText.Clear();

explanatoryText.AddParagraph(LatencyCertifierStrings.ExplanatoryTextWelcome);
explanatoryText.NewParagraph();

const string url = @"https://github.com/ppy/osu/wiki/Latency-and-unlimited-frame-rates#methodology";
var formattedSource = MessageFormatter.FormatText(localisation.GetLocalisedString(LatencyCertifierStrings.ExplanatoryTextMethodology(url)));

explanatoryText.AddLinks(formattedSource.Text, formattedSource.Links);
explanatoryText.AddParagraph(LatencyCertifierStrings.ExplanatoryTextControlDisplay);
explanatoryText.AddParagraph(LatencyCertifierStrings.ExplanatoryTextDisplayMode);
}), true);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

localised by the analogy with

currentLanguage.BindValueChanged(_ =>
// schedule required because `LocalisationManager` won't have new language set correctly yet.
Schedule(() =>
{
linkContainer.Clear();
linkContainer.NewLine();
const string url = @"https://opentabletdriver.net/Wiki/FAQ/General";
var formattedSource = MessageFormatter.FormatText(localisation.GetLocalisedString(TabletSettingsStrings.NoTabletDetectedDescription(url)));
linkContainer.AddLinks(formattedSource.Text, formattedSource.Links);
}), true);

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant