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

[Bug] Localization Key is missing #3305

Closed
tinygrox opened this issue Jul 25, 2024 · 2 comments · Fixed by #3363
Closed

[Bug] Localization Key is missing #3305

tinygrox opened this issue Jul 25, 2024 · 2 comments · Fixed by #3363

Comments

@tinygrox
Copy link

tinygrox commented Jul 25, 2024

these need to be localized:

if (caster?.Map == null || !targ.Cell.InBounds(caster.Map) || !root.InBounds(caster.Map))
{
report = "Out of bounds";
return false;
}

if (targ.Thing != null && targ.Thing == caster)
{
if (!verbProps.targetParams.canTargetSelf)
{
report = "Can't target self";
return false;
}
return true;
}

if (Projectile.projectile.flyOverhead)
{
RoofDef roofDef = caster.Map.roofGrid.RoofAt(targ.Cell);
if (roofDef != null && roofDef.isThickRoof)
{
report = "Blocked by roof";
return false;
}
}

if (!current.AllowVerbCast(this) && !(current.TryGetComp<CompShield>() != null && isTurretOperator))
{
report = "Shooting disallowed by " + current.LabelShort;
return false;
}

if (!TryFindCEShootLineFromTo(root, targ, out shootLine))
{
float lengthHorizontalSquared = (root - targ.Cell).LengthHorizontalSquared;
if (lengthHorizontalSquared > EffectiveRange * EffectiveRange)
{
report = "Out of range";
}
else if (lengthHorizontalSquared < verbProps.minRange * verbProps.minRange)
{
report = "Within minimum range";
}
else
{
report = "No line of sight";
}
return false;
}

@N7Huntsman
Copy link
Contributor

@tinygrox I have opened #3363 to add translation keys for the lines you've pointed out. Please let me know if you come across any others that need addressed.

@tinygrox
Copy link
Author

@N7Huntsman sry for the late response! I've been caught up playing Black Myth: Wukong lately and didn't check GitHub.
Here are some other lines that need translation:

defaultLabel = "Targeted area: " + targetMode,

When you come across lines that involve parameters, it's better to use methods with parameters for localization. For example:

"Shooting disallowed by " + current.LabelShort;

Instead of:

"CE_BlockedShield".Translate() + current.LabelShort;

It would be better to use:

"CE_BlockedShield".Translate(current.LabelShort);

This allows translators to have more flexibility in their translations.

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

Successfully merging a pull request may close this issue.

2 participants