Localisation & Translations
Overview
How Translation Works
Translatable Properties
Component
Translatable Properties
Basic Configuration
Step 1: Enable Locales in Symfony
Step 2: Configure Locale Placeholder
Step 3: Use the pwa() Twig Function
Step 4: Create Translation Files
Translation File Formats
YAML Format (Recommended)
XLIFF Format
PHP Format
JSON Format
Complete Use Cases
Use Case 1: Multilingual E-Commerce App
Use Case 2: Global News App with RTL Support
Use Case 3: SaaS Platform with Region-Specific Content
Generated Manifest Files
Translation Workflow
1. Extract Translation Keys
2. Translate Content
3. Validate Translations
4. Clear Cache
Testing Translations
1. Test Manifest Generation
2. Validate Manifest Content
3. Test in Browser
4. Lighthouse Audit
Best Practices
1. Use Meaningful Translation Keys
2. Keep Brand Names Consistent
3. Provide Fallbacks
4. Use Translation Parameters for Dynamic Content
5. Keep Translations Synchronized
6. Test All Locales
Common Issues
1. Translations Not Applied
2. Wrong Locale Manifest Served
3. Missing Translations for Specific Locale
4. Special Characters Not Displaying
5. RTL Languages Not Working
Migration Guide
Migrating from Non-Translated Setup
Migration Steps
Troubleshooting Checklist
Related Documentation
Resources
Last updated
Was this helpful?