Project

General

Profile

Actions

Improvement #31373

open

Improvement #31248: New Theme based Nextjs application dev analysis

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

implemented English/Arabic localization for the application

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

Status:
Fixed not Tested
Priority:
Normal
Assignee:
Target version:
-
Start date:
12/17/2025
Due date:
12/17/2025 (about 4 months late)
% Done:

100%

Estimated time:
4:00 h
Spent time:
remarks:
DB Changes:
Keys & Permissions:
Areas Affected:
Files Changed:
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

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

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.

Actions

Also available in: Atom PDF