Skip to content

[Web][Backend] EN/TR i18n (consolidated): backend lang preference + error localization + full web translation sweep#583

Open
mustafa-5493 wants to merge 104 commits into
mainfrom
feature/language
Open

[Web][Backend] EN/TR i18n (consolidated): backend lang preference + error localization + full web translation sweep#583
mustafa-5493 wants to merge 104 commits into
mainfrom
feature/language

Conversation

@mustafa-5493

@mustafa-5493 mustafa-5493 commented May 11, 2026

Copy link
Copy Markdown
Contributor

📝 Description

Full-stack EN/TR i18n, consolidated from 10 stacked PRs into one branch for unified review. Closes #291, #292, #505, #546, #548, #550, #553, #557, #560, #562, #564, #574.

Backend

  • Language enum + preferredLanguage column on RegisteredUser (default EN, V6 Flyway migration)
  • Owner-only PUT /api/users/{id}/profile/language; field exposed in UserProfileDTO (self-view only, same privacy gate as email)
  • MessageSource + AcceptHeaderLocaleResolver; EN + TR message bundles for user-facing errors

Web

  • i18next + react-i18next + browser-language detector
  • LanguageSwitcher (EN/TR pill) in the navbar at every breakpoint; persists to backend on login, falls back to localStorage for guests
  • Accept-Language forwarded by apiFetch and every raw fetch (avatar / media / fix-request / routes)
  • Translation sweep across Navbar, NotificationDropdown, MapSearchBar, Login, Signup, Home, OnboardingTutorial, Profile + UserProfile + AvatarUploader + RoutingPreferencesSection + CustomPresetEditorModal + MyReports + MyReportDetailModal + UserSearch, Feed + FeedLocationPickerModal + MapFilters + ReportObjectsList, ReportPanel + CreateReportPanel + CreateFixRequestPanel + ObjectTutorialModal, Leaderboard page + nav link, toasts, errors, aria-labels
  • localizeObjectType(t, cfg) helper so object/issue/measurement labels switch from EN defaults
  • Report titles rebuilt at render time from translated parts

Atomic commit history preserved , best reviewed via the Commits tab, not the whole diff.

📊 Type of Change

  • New feature

✅ Acceptance Criteria

  • EN/TR pill flips every translated surface
  • Persists via PUT /api/users/{id}/profile/language, restores from /api/users/me.preferredLanguage on login
  • Guests get browser-language detection + localStorage
  • Backend errors localize via Accept-Language
  • Visible on mobile
  • 474 frontend tests pass; backend tests pass

🧪 How to Test

  1. docker compose -f docker-compose.local.yml --env-file backend/.env up -d --build --force-recreate backend
  2. cd frontend && npm run dev, log in
  3. Click EN/TR in the navbar → UI flips
  4. Reload → choice sticks
  5. Log out, log in on a fresh profile → preference restores from backend
  6. Trigger an auth error in TR → message comes back localized

⏱️ Estimated Review Time

15 min (commit-by-commit)

[Web] Translate last hardcoded toast message (closes #557)
…ader

[Web] Send Accept-Language header so backend can localize errors (closes #562)
[Backend] Localize validation + error messages (EN/TR) (closes #560)
@mustafa-5493 mustafa-5493 changed the title [Full-stack] EN/TR i18n (consolidated): backend lang preference + error localization + full web translation sweep [Web][Backend] EN/TR i18n (consolidated): backend lang preference + error localization + full web translation sweep May 11, 2026
@mustafa-5493 mustafa-5493 added enhancement New feature or request frontend Visual features backend Features related to API's and internal implementations. labels May 11, 2026
@mustafa-5493 mustafa-5493 self-assigned this May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Features related to API's and internal implementations. enhancement New feature or request frontend Visual features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend][Backend] Support for Language Translations (English / Turkish)

1 participant