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

Use unknown label for undefined countries #3060

Merged

Conversation

eremannisto
Copy link
Contributor

Improve handling of unknown countries in WorldMap component

Changes

  • Replace undefined text with localized Unknown label for countries that don't exist in countryNames
  • Utilizes existing labels.unknown translation key, maintaining consistency across languages

Before
When hovering over an unmapped country code, the tooltip would show: undefined: 0 visitors
before

After
When hovering over an unmapped country code, the tooltip now shows: Unknown: 0 visitors (or equivalent in the user's selected language)
after
after-fi

Technical Details

  • Modified handleHover function in WorldMap.tsx to use fallback value
  • Leverages existing translation infrastructure
  • No new translation keys needed

Testing

  • Hover over known countries: displays correct country name
  • Hover over unknown country codes: displays localized Unknown text
  • Tested with different language settings to ensure proper translation

Copy link

vercel bot commented Nov 19, 2024

@eremannisto is attempting to deploy a commit to the umami-software Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@mikecao mikecao left a comment

Choose a reason for hiding this comment

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

💯

@mikecao mikecao merged commit cd72fca into umami-software:dev Nov 20, 2024
0 of 5 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.

2 participants