# WooNooW i18n Implementation Guide This document tracks the internationalization implementation status across all WooNooW files. ## ✅ Completed Files ### Backend (PHP) - ✅ `includes/Api/OrdersController.php` - All validation and error messages - ✅ `includes/Core/Mail/MailQueue.php` - Error logging only (no user-facing strings) - ✅ `includes/Core/Mail/WooEmailOverride.php` - No user-facing strings ### Frontend (TypeScript/React) - ✅ `admin-spa/src/lib/errorHandling.ts` - All error messages - ✅ `admin-spa/src/lib/i18n.ts` - Translation utility (NEW) - ✅ `admin-spa/src/components/ErrorCard.tsx` - All UI strings - ✅ `admin-spa/src/routes/Orders/New.tsx` - All UI strings - ✅ `admin-spa/src/routes/Orders/Edit.tsx` - All UI strings - ✅ `admin-spa/src/routes/Orders/Detail.tsx` - All UI strings - ✅ `admin-spa/src/routes/Orders/index.tsx` - All UI strings - ✅ `admin-spa/src/routes/Orders/partials/OrderForm.tsx` - All UI strings - ✅ `admin-spa/src/routes/Dashboard.tsx` - All UI strings - ✅ `admin-spa/src/routes/Coupons/index.tsx` - All UI strings - ✅ `admin-spa/src/routes/Coupons/New.tsx` - All UI strings - ✅ `admin-spa/src/routes/Customers/index.tsx` - All UI strings - ✅ `admin-spa/src/routes/Settings/TabPage.tsx` - All UI strings - ✅ `admin-spa/src/components/CommandPalette.tsx` - All UI strings - ✅ `admin-spa/src/components/filters/DateRange.tsx` - All UI strings - ✅ `admin-spa/src/components/filters/OrderBy.tsx` - All UI strings - ✅ `admin-spa/src/App.tsx` - All navigation labels - ✅ `includes/Api/CheckoutController.php` - All error messages ## 🔄 Files Requiring Translation ### Medium Priority (Admin/System) #### PHP Files - ✅ `includes/Admin/Menu.php` - No user-facing strings (menu collector only) - ✅ `includes/Admin/Rest/MenuController.php` - No user-facing strings (API only) - ✅ `includes/Admin/Rest/SettingsController.php` - No user-facing strings (API only) - ✅ `includes/Api/CheckoutController.php` - Error messages translated - ✅ `includes/Compat/MenuProvider.php` - No user-facing strings (menu snapshot only) ### Low Priority (Internal/Technical) - UI components (button, input, select, etc.) - No user-facing strings - Hooks and utilities - Technical only ## 📝 Translation Pattern Reference ### Backend (PHP) ```php // Simple translation __( 'Text to translate', 'woonoow' ) // With sprintf sprintf( __( 'Order #%s created', 'woonoow' ), $order_number ) // With translator comment /* translators: %s: field name */ sprintf( __( '%s is required', 'woonoow' ), $field_name ) ``` ### Frontend (TypeScript/React) ```typescript import { __, sprintf } from '@/lib/i18n'; // Simple translation __('Text to translate') // With sprintf sprintf(__('Order #%s created'), orderNumber) // In JSX