feat(i18n): localize event location country names#17925
Merged
Conversation
Add i18n-iso-countries package and country translation utilities to geography.ts. Event locations on community events pages and homepage now display translated country names (e.g., "Denver, USA" -> "Denver, アメリカ合衆国"). - getCountryTranslation(): reusable country name lookup - localizeLocation(): parses "City, Country" and translates - Updated EventCard, ContinentTabs, and homepage events - City names remain in Latin script (country-only MVP) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
pettinarip
approved these changes
Apr 16, 2026
Member
pettinarip
left a comment
There was a problem hiding this comment.
@wackerow looks good. Found that there are some places that we are not applying this localization
/community/events/ when you search an event, the cards don't get localized

and
# Conflicts: # app/[locale]/page.tsx # pnpm-lock.yaml
Member
|
Thanks! On it |
Pre-translate the event location field at the server level (in mapEventTranslations and getMeetupGroups) rather than calling localizeLocation inside client components. Client-side i18n-iso-countries needs locale data registered, which would bloat the bundle. Doing translation server-side keeps client components dumb and keeps the bundle lean. Fixes untranslated locations on /community/events/ search results and /community/events/meetups/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
…thereum-org-website into location-translations
External event data sometimes uses "Remote" instead of "Online" for virtual events. Normalize both to the same isOnline flag so they render with the same translated "Online" tag in the UI. - Added isOnlineLocation() helper with a set of sentinel values - Used in fetchEvents, parseLocationToContinent, localizeLocation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
# Conflicts: # app/[locale]/page.tsx
wackerow
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
i18n-iso-countriespackage to translate country names in event locations into the user's localegetCountryTranslation()utility for use anywhere in the repoHow it works
getCountryTranslation(country, locale)-- accepts informal English country names ("USA", "United States", "Hong Kong SAR"), returns localized name viai18n-iso-countrieslocalizeLocation(location, locale)-- parses "City, Country" strings, translates the country portion, reassemblesChanges
src/lib/utils/geography.ts-- newgetCountryTranslation()andlocalizeLocation()functionsapp/[locale]/community/events/_components/EventCard.tsx-- grid and highlight variantsapp/[locale]/community/events/_components/ContinentTabs.tsx-- table viewapp/[locale]/page.tsx-- homepage event cardspackage.json-- addedi18n-iso-countries(MIT, 1.6M weekly downloads)Test plan
/community/events/on a non-English locale (e.g.,/ja/community/events/) -- country names should be translatedReviewed by Claude Opus 4.6