diff --git a/TRANSLATION_STATUS.md b/TRANSLATION_STATUS.md new file mode 100644 index 0000000..7e21864 --- /dev/null +++ b/TRANSLATION_STATUS.md @@ -0,0 +1,101 @@ +# Multi-Language Translation Status + +## ✅ Completed (60% - Core Features) + +### Infrastructure +- [x] Language Context (`LanguageContext.tsx`) +- [x] Translation files (`locales/id.ts`, `locales/en.ts`) +- [x] Language toggle component (`LanguageToggle.tsx`) +- [x] Integration in App.tsx + +### Translated Components +- [x] **AppSidebar** - Navigation menu +- [x] **WalletDialog** - Add/Edit wallet form +- [x] **TransactionDialog** - Add/Edit transaction form +- [x] **Wallets Page** - Complete wallet management + +### Toast Messages +- [x] All toast notifications use Indonesian text +- [ ] Need to translate toast messages to use `t` hook + +## 🔄 Remaining (40% - 3 Pages) + +### Pages to Translate +1. **Overview.tsx** (~30 strings) + - Dashboard cards + - Recent transactions + - Charts + - Empty states + +2. **Transactions.tsx** (~25 strings) + - Transaction list + - Filters + - Stats cards + - Table headers + +3. **Profile.tsx** (~50 strings) + - Personal info + - Security settings + - 2FA options + - Danger zone + +## Implementation Guide + +### For Each Page: +1. Add `useLanguage` hook: + ```typescript + const { t } = useLanguage() + ``` + +2. Replace hardcoded strings: + ```typescript + // Before + + + // After + + ``` + +3. Test language switching + +## Translation Keys Structure + +```typescript +{ + common: { search, filter, add, edit, delete, ... }, + nav: { overview, transactions, wallets, profile }, + overview: { ... }, + transactions: { ... }, + wallets: { ... }, + profile: { ... }, +} +``` + +## Testing Checklist + +- [x] Language toggle works +- [x] Preference persists in localStorage +- [x] Sidebar navigation translated +- [x] Dialogs translated +- [x] Wallets page translated +- [ ] Overview page translated +- [ ] Transactions page translated +- [ ] Profile page translated +- [ ] All toast messages translated + +## Estimated Time to Complete + +- Overview page: ~15 minutes +- Transactions page: ~15 minutes +- Profile page: ~20 minutes +- Toast messages: ~10 minutes +- Testing: ~10 minutes + +**Total: ~70 minutes remaining** + +## Notes + +- Admin dashboard remains English-only (as requested) +- Default language: Indonesian (ID) +- Optional language: English (EN) +- Type-safe with full autocomplete support diff --git a/apps/web/src/components/pages/Overview.tsx b/apps/web/src/components/pages/Overview.tsx index 4f3b23b..d8bd89b 100644 --- a/apps/web/src/components/pages/Overview.tsx +++ b/apps/web/src/components/pages/Overview.tsx @@ -1,4 +1,5 @@ import { useState, useEffect, useMemo } from "react" +import { useLanguage } from "@/contexts/LanguageContext" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Badge } from "@/components/ui/badge" @@ -128,6 +129,7 @@ function formatYAxisValue(value: number): string { } export function Overview() { + const { t } = useLanguage() const [wallets, setWallets] = useState([]) const [transactions, setTransactions] = useState([]) const [exchangeRates, setExchangeRates] = useState>({}) @@ -571,11 +573,11 @@ export function Overview() {
@@ -586,7 +588,7 @@ export function Overview() {
- Total Balance + {t.overview.totalBalance} @@ -594,14 +596,14 @@ export function Overview() { {formatLargeNumber(totals.totalBalance, 'IDR')}

- Across {wallets.length} wallets + {t.overview.acrossWallets.replace('{count}', wallets.length.toString())}

- Total Income + {t.overview.totalIncome} @@ -609,14 +611,14 @@ export function Overview() { {formatLargeNumber(totals.totalIncome, 'IDR')}

- {getDateRangeLabel(dateRange, customStartDate, customEndDate)} income + {getDateRangeLabel(dateRange, customStartDate, customEndDate)} {t.overview.income}

- Total Expense + {t.overview.totalExpense} @@ -624,7 +626,7 @@ export function Overview() { {formatLargeNumber(totals.totalExpense, 'IDR')}

- {getDateRangeLabel(dateRange, customStartDate, customEndDate)} expense + {getDateRangeLabel(dateRange, customStartDate, customEndDate)} {t.overview.expense}

@@ -635,7 +637,7 @@ export function Overview() { {/* Wallet Breakdown */} - Wallet Breakdown + {t.overview.wallets} Balance distribution across wallets diff --git a/apps/web/src/components/pages/Transactions.tsx b/apps/web/src/components/pages/Transactions.tsx index fe80fca..482456e 100644 --- a/apps/web/src/components/pages/Transactions.tsx +++ b/apps/web/src/components/pages/Transactions.tsx @@ -1,6 +1,7 @@ import { useState, useEffect, useMemo } from "react" import { useSearchParams } from "react-router-dom" import { toast } from "sonner" +import { useLanguage } from "@/contexts/LanguageContext" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" @@ -64,6 +65,7 @@ interface Transaction { const API = "/api" export function Transactions() { + const { t } = useLanguage() const [searchParams] = useSearchParams() const [wallets, setWallets] = useState([]) const [transactions, setTransactions] = useState([]) @@ -264,7 +266,7 @@ export function Transactions() {
-

Transactions

+

{t.transactions.title}

View and manage all your transactions

@@ -276,7 +278,7 @@ export function Transactions() {
@@ -287,7 +289,7 @@ export function Transactions() { - Total Income + {t.transactions.stats.totalIncome} @@ -299,7 +301,7 @@ export function Transactions() { - Total Expense + {t.transactions.stats.totalExpense} @@ -311,7 +313,7 @@ export function Transactions() { - Net Amount + {t.transactions.stats.netAmount}
= 0 ? 'text-green-600' : 'text-red-600'}`}> @@ -326,7 +328,7 @@ export function Transactions() {
- Filters + {t.common.filter}