Skip to content

feat(i18n): page titles and countries leaderboard table headers#749

Merged
escapedcat merged 3 commits intoteambtcmap:mainfrom
Nackoo2000:feat/i18n-page-titles-and-leaderboard
Feb 26, 2026
Merged

feat(i18n): page titles and countries leaderboard table headers#749
escapedcat merged 3 commits intoteambtcmap:mainfrom
Nackoo2000:feat/i18n-page-titles-and-leaderboard

Conversation

@Nackoo2000
Copy link
Contributor

@Nackoo2000 Nackoo2000 commented Feb 25, 2026

  • Add meta.* keys for page title suffixes (countries, addLocation, etc.)
  • Translate static page titles (Countries, Add Location, Communities, etc.)
  • Translate dynamic suffixes (Merchant, Country, Community, Supertagger)
  • Add og:title where missing, use name= for Twitter meta
  • Translate countries/communities leaderboard table headers (Position, Name, Total Locations, Verified Locations, Grade) via areaLeaderboard.* keys

Summary by CodeRabbit

  • New Features
    • Leaderboard headers and page titles throughout the application now display in your selected language.
    • Page metadata for social sharing and browser titles are now localized based on your language preference.

…ders

- Add meta.* keys for page title suffixes (countries, addLocation, etc.)
- Translate static page titles (Countries, Add Location, Communities, etc.)
- Translate dynamic suffixes (Merchant, Country, Community, Supertagger)
- Add og:title where missing, use name= for Twitter meta
- Translate countries/communities leaderboard table headers (Position, Name,
  Total Locations, Verified Locations, Grade) via areaLeaderboard.* keys

Made-with: Cursor
@netlify
Copy link

netlify bot commented Feb 25, 2026

👷 Deploy request for btcmap pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2605f34

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

This PR adds internationalization support to page metadata and leaderboard headers across multiple routes and components. Hard-coded strings in page titles, meta tags, and column headers are replaced with localized key lookups, with corresponding translation entries added to Bulgarian, English, and Portuguese-Brazilian locale files.

Changes

Cohort / File(s) Summary
Leaderboard Component Localization
src/components/leaderboard/AreaLeaderboard.svelte
Converted static column headers (Position, Name, Total Locations, Verified Locations, Grade) to i18n-backed functions using $_() lookups. Updated SortHeaderButton labels and ariaLabel props across mobile and desktop layouts to reference localized keys.
Locale File Translations
src/lib/i18n/locales/bg.json, src/lib/i18n/locales/en.json, src/lib/i18n/locales/pt-BR.json
Added new top-level meta object with keys for global labels (countries, countriesLeaderboard, addLocation, addCommunity, communityMap, communities, communitiesLeaderboard, merchant, country, community, supertagger). Extended areaLeaderboard section with new fields: name, totalLocations, verifiedLocations.
Route Page Metadata Localization
src/routes/add-location/+page.svelte, src/routes/communities/[section]/+page.svelte, src/routes/communities/add/+page.svelte, src/routes/communities/leaderboard/+page.svelte, src/routes/communities/map/+page.svelte, src/routes/community/[area]/[section]/+page.svelte, src/routes/countries/[section]/+page.svelte, src/routes/countries/leaderboard/+page.svelte, src/routes/country/[area]/[section]/+page.svelte, src/routes/merchant/[id]/+page.svelte, src/routes/tagger/[id]/+page.svelte
Added i18n import and replaced hard-coded title and social meta tag strings (title, og:title, twitter:title) with localized lookups using $_('meta.*') keys. No changes to routing or data fetching logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #677: Implements i18n usage patterns and adds locale keys that align with the localization work in this PR
  • #710: Directly related through modifications to AreaLeaderboard.svelte and matching areaLeaderboard locale key additions
  • #683: Overlaps in i18n support for add-location page and Portuguese-Brazilian locale file updates

Suggested labels

Review effort 3/5

Suggested reviewers

  • escapedcat
  • dadofsambonzuki

Poem

🐰 Hoppy strings now speak in tongues,
From hard-coded static lungs,
Meta tags bloom worldwide wide,
Bulgarian, English, Portuguese pride! 🌍
Locales dance where headers once stood still! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides a clear bullet-point summary of changes, addressing what was added/translated, but lacks the structured sections required by the template (issue reference, screenshots, context). Follow the template structure: explicitly state issue reference, add screenshots if applicable, and provide additional context explaining the localization scope and testing approach.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately summarizes the main changes: adding i18n support for page titles and leaderboard table headers.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/components/leaderboard/AreaLeaderboard.svelte (1)

374-384: Consider using the same “Locations” keys on mobile sorting headers for consistency.

Mobile currently uses areaLeaderboard.total / areaLeaderboard.verified, while desktop headers use totalLocations / verifiedLocations.

💡 Suggested patch
-								label={$_(`areaLeaderboard.total`)}
+								label={$_(`areaLeaderboard.totalLocations`)}
@@
-								label={$_(`areaLeaderboard.verified`)}
+								label={$_(`areaLeaderboard.verifiedLocations`)}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/leaderboard/AreaLeaderboard.svelte` around lines 374 - 384,
The mobile sort header labels in the SortHeaderButton components (columns
accessed via $table?.getColumn('total') and
$table?.getColumn('upToDateElements')) use translation keys
$_(`areaLeaderboard.total`) and $_(`areaLeaderboard.verified`) which are
inconsistent with desktop; update both the label and ariaLabel usages to use the
same desktop keys ($_(`areaLeaderboard.totalLocations`) and
$_(`areaLeaderboard.verifiedLocations`)) so mobile and desktop sorting headers
are consistent (change both label and ariaLabel for the two SortHeaderButton
instances).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/routes/community/`[area]/[section]/+page.svelte:
- Around line 21-24: The social and page title meta tags (the <title>, og:title,
and twitter:title lines using the name variable and $_('meta.community'))
currently render "BTC Map Community"; update those templates so when name is
present they still prepend "name - " and ensure there is a separator before the
translated suffix by inserting " - " between "BTC Map" and $_('meta.community')
(i.e., use the same conditional name ? name + ' - ' : '' prefix and change the
suffix from "BTC Map {$_('meta.community')}" to "BTC Map -
{$_('meta.community')}") so all three tags produce "Name - BTC Map - Community"
or "BTC Map - Community" consistently.

In `@src/routes/country/`[area]/[section]/+page.svelte:
- Around line 38-41: The head metadata currently uses data.name (in the <title>,
og:title and twitter:title) which bypasses the localized display string; update
those three places to use countryDisplayName instead of data.name so the page
title and social meta tags reflect the localized name (replace occurrences of
data.name + ' - ' with countryDisplayName + ' - ' in the title, og:title and
twitter:title).

---

Nitpick comments:
In `@src/components/leaderboard/AreaLeaderboard.svelte`:
- Around line 374-384: The mobile sort header labels in the SortHeaderButton
components (columns accessed via $table?.getColumn('total') and
$table?.getColumn('upToDateElements')) use translation keys
$_(`areaLeaderboard.total`) and $_(`areaLeaderboard.verified`) which are
inconsistent with desktop; update both the label and ariaLabel usages to use the
same desktop keys ($_(`areaLeaderboard.totalLocations`) and
$_(`areaLeaderboard.verifiedLocations`)) so mobile and desktop sorting headers
are consistent (change both label and ariaLabel for the two SortHeaderButton
instances).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a4ce17 and 7bc1493.

📒 Files selected for processing (15)
  • src/components/leaderboard/AreaLeaderboard.svelte
  • src/lib/i18n/locales/bg.json
  • src/lib/i18n/locales/en.json
  • src/lib/i18n/locales/pt-BR.json
  • src/routes/add-location/+page.svelte
  • src/routes/communities/[section]/+page.svelte
  • src/routes/communities/add/+page.svelte
  • src/routes/communities/leaderboard/+page.svelte
  • src/routes/communities/map/+page.svelte
  • src/routes/community/[area]/[section]/+page.svelte
  • src/routes/countries/[section]/+page.svelte
  • src/routes/countries/leaderboard/+page.svelte
  • src/routes/country/[area]/[section]/+page.svelte
  • src/routes/merchant/[id]/+page.svelte
  • src/routes/tagger/[id]/+page.svelte

@escapedcat escapedcat changed the title feat(i18n): translate page titles and countries leaderboard table headers feat(i18n): page titles and countries leaderboard table headers Feb 26, 2026
@escapedcat escapedcat merged commit def6211 into teambtcmap:main Feb 26, 2026
8 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