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

Update traceroute list naming #993

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

bjpetit
Copy link
Contributor

@bjpetit bjpetit commented Nov 15, 2024

What changed?

This change updates the naming of traceroute entries based on the number of hops towards and back.

  • Instead of 0 hops, direct will be shown
  • Pluralization of hop is handled in all cases
  • If the hops out and back are the same, "x Hops" would be shown
  • If the hops out and back are different, "x Hops Towards y Hops Back" will be shown

Why did it change?

This makes the description of traceroute items a bit more consistent.

How is this tested?

Ran through numerous permutations of traceroutes to ensure the naming was correct.

Screenshots/Videos (when applicable)

2638AD05-2B60-4C0E-AF55-9873586870F0_1_201_a

Checklist

  • My code adheres to the project's coding and style guidelines.
  • I have conducted a self-review of my code.
  • I have commented my code, particularly in complex areas.
  • I have made corresponding changes to the documentation.
  • I have tested the change to ensure that it works as intended.

} else if route.response && route.hopsTowards == 1 {
Text("\(route.time?.formatted() ?? "unknown".localized) - 1 Hop")
} else if route.response && route.hopsTowards == route.hopsBack {
let hopLabel = route.hopsTowards == 1 ? "Hop" : "Hops"
Copy link
Contributor

Choose a reason for hiding this comment

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

Question.
Shouldn't this also have .localized?

== 1 ? "Hop".localized : "Hops".localized

Thanks up front!

Copy link
Contributor Author

@bjpetit bjpetit Dec 19, 2024

Choose a reason for hiding this comment

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

Thanks for the note. Yes, this also led me down a path to utilize the swift localization for pluralizing.

@bjpetit bjpetit force-pushed the traceroute-list-name-cleanup branch from b124e1c to 5bb8d3e Compare December 19, 2024 16:09
@garthvh garthvh changed the base branch from main to 2.5.13 December 20, 2024 06:36
@garthvh garthvh changed the base branch from 2.5.13 to main December 20, 2024 06:37
@garthvh garthvh changed the base branch from main to 2.5.13 December 20, 2024 06:37
@garthvh garthvh merged commit 2f37438 into meshtastic:2.5.13 Dec 20, 2024
1 of 2 checks passed
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 this pull request may close these issues.

3 participants