Skip to content
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

Incorrect Translation Display for "CannotPickUp" #3384

Open
tinygrox opened this issue Sep 1, 2024 · 0 comments
Open

Incorrect Translation Display for "CannotPickUp" #3384

tinygrox opened this issue Sep 1, 2024 · 0 comments

Comments

@tinygrox
Copy link

tinygrox commented Sep 1, 2024

Currently, the translation key is called without passing the required parameter, leading to incorrect display of the text.

the current implementation:

{
opts.Add(new FloatMenuOption("CannotPickUp".Translate() + " " + item.LabelShort + " (" + "NoPath".Translate() + ")", null));
}

result in the display string being: Cannot pick up {1_labelShort} Steel (no path)
The expected and correct display should be: Cannot pick up Steel (no path)

To fix this issue, the code should be modified to pass the item.LabelShort as a parameter to the Translate() method, like:

opts.Add(new FloatMenuOption("CannotPickUp".Translate(item.LabelShort) + " (" + "NoPath".Translate() + ")", null)); 

Reference

In the Core/Languages/English/Keyed/FloatMenu.xml file, the translation key for CannotPickUp is defined as:

<CannotPickUp>Cannot pick up {1_labelShort}</CannotPickUp>

This definition clearly expects a parameter to replace the {1_labelShort} placeholder. Without providing this parameter, the placeholder is displayed literally, which is not the desired outcome.

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

No branches or pull requests

1 participant