Project

General

Profile

Actions

Improvement #31374

open

Improvement #31248: New Theme based Nextjs application dev analysis

Improvement #31319: Basic Next.js Setup and Architecture Implementation

Currency & Language Switcher Architecture

Added by Sachin Suresh 4 months ago. Updated 4 months ago.

Status:
Assigned
Priority:
Normal
Assignee:
Target version:
-
Start date:
12/19/2025
Due date:
12/19/2025 (about 4 months late)
% Done:

100%

Estimated time:
8:00 h
Spent time:
8:00 h (Total: 10:00 h)
remarks:
DB Changes:
Keys & Permissions:
Areas Affected:
Files Changed:

Subtasks 1 (1 open0 closed)

Improvement #31467: Currency Synchronization Implementation PlanFixed not TestedSachin Suresh12/19/202512/19/2025

Actions
Actions #1

Updated by Sachin Suresh 4 months ago

  • Status changed from Assigned to In Progress
Actions #2

Updated by Sachin Suresh 4 months ago

  • % Done changed from 0 to 50
Actions #3

Updated by Sachin Suresh 4 months ago

  • Status changed from In Progress to Fixed not Tested
  • % Done changed from 50 to 100

Localization Implementation Walkthrough
I have successfully implemented English/Arabic localization for the application.

Changes Implemented
1. Infrastructure
Routing: Moved app pages to src/app/[locale]/ to support URL-based localization (e.g., /en, /ar).
Middleware: Updated middleware.ts to automatically detect valid locales and redirect if missing.
Fix: Excluded static assets (/css, /js, /images) to prevent 404s.
Resource Store: Created ResourceStore (src/lib/resource-store.ts) singleton to cache API resource keys.
API: Added get-resources.ts action to fetch localized strings from the backend.
Server Translations: Created getServerTranslations (src/lib/server-translation.ts) helper to standardize usage in Server Components.
2. Components & State
LanguageProvider: Created a React Context (src/providers/LanguageProvider.tsx) for Client Components.
Header & Footer: Refactored to use useLanguage hook.
Layout: Updated to use getServerTranslations and dynamically set lang/dir attributes.
Page: Refactored src/app/[locale]/page.tsx to use getServerTranslations for server-side content.
Verification
Code Structure: Verified file moves and imports.
Type Safety: Ensured type definitions for the new helper are correct.
Build: The build process configuration has been updated.
Next Steps
Implement localization for other pages using getServerTranslations (Server) or useLanguage (Client).
Fine-tune exact resource keys with real API data.

Actions #4

Updated by Sachin Suresh 4 months ago

  • Status changed from Fixed not Tested to Assigned
Actions #5

Updated by Sachin Suresh 4 months ago

  • Subtask #31467 added
Actions

Also available in: Atom PDF