Localization Configuration
Configure multi-language support for your global audience
Localization Configuration
Configure multi-language support to reach a global audience with your Vyral platform.
Built-in Language Support
Vyral includes a comprehensive localization system - just add language code and translate from admin panel:
Western European:
- English (EN) - Default
- Spanish (ES) - Español
- French (FR) - Français
- German (DE) - Deutsch
- Portuguese (PT) - Português
- Italian (IT) - Italiano
- Dutch (NL) - Nederlands
- Swedish (SV) - Svenska
- Norwegian (NO) - Norsk
- Danish (DA) - Dansk
- Polish (PL) - Polski
Asia-Pacific:
- Chinese Simplified (ZH) - 简体中文
- Japanese (JA) - 日本語
- Korean (KO) - 한국어
- Indonesian (ID) - Bahasa Indonesia
- Thai (TH) - ภาษาไทย
- Vietnamese (VI) - Tiếng Việt
- Hindi (HI) - हिन्दी
- Bengali (BN) - বাংলা
- Malay (MS) - Bahasa Melayu
Middle Eastern & Others:
- Arabic (AR) - العربية
- Hebrew (HE) - עברית
- Persian (FA) - فارسی
- Turkish (TR) - Türkçe
- Russian (RU) - Русский
- Greek (EL) - Ελληνικά
- Ukrainian (UK) - Українська
Just add any 2-letter language code in admin panel
Configuration Setup
Enable and configure localization in your environment:
# Localization Configuration
ENABLE_LOCALIZATION=true
DEFAULT_LANGUAGE=en
AVAILABLE_LANGUAGES=en,es,fr,de,pt,it,nl,ru,zh,ja,ko,ar
AUTO_DETECT_LANGUAGE=true
RTL_LANGUAGES=ar,he,fa
TRANSLATION_PATH=./language
Add these settings to your backend .env
file:
Configuration Options
Setting | Description | Example |
---|---|---|
ENABLE_LOCALIZATION | Enable/disable multi-language support | true |
DEFAULT_LANGUAGE | Fallback language when user preference unavailable | en |
AVAILABLE_LANGUAGES | Comma-separated list of supported languages | en,es,fr |
AUTO_DETECT_LANGUAGE | Detect language from browser settings | true |
RTL_LANGUAGES | Languages requiring right-to-left layout | ar,he,fa |
Translation File Structure
Translation files are organized in a hierarchical JSON structure:
regular/language/
├── en.json # English (default)
├── es.json # Spanish
├── fr.json # French
├── de.json # German
├── pt.json # Portuguese
├── it.json # Italian
├── nl.json # Dutch
├── ru.json # Russian
├── zh.json # Chinese
├── ja.json # Japanese
├── ko.json # Korean
└── ar.json # Arabic
Translation File Format
Each language file follows this structure:
{
"common": {
"welcome": "Welcome",
"login": "Login",
"logout": "Logout",
"save": "Save",
"cancel": "Cancel",
"delete": "Delete",
"edit": "Edit"
},
"navigation": {
"home": "Home",
"messages": "Messages",
"profile": "Profile",
"settings": "Settings",
"explore": "Explore"
},
"auth": {
"sign_in": "Sign In",
"sign_up": "Sign Up",
"forgot_password": "Forgot Password",
"reset_password": "Reset Password"
},
"monetization": {
"gift": "Send Gift",
"tip": "Send Tip",
"subscribe": "Subscribe",
"coins": "Coins",
"earnings": "Earnings"
}
}
Simple Translation Workflow
The localization system is designed for maximum simplicity - no complex tools or technical knowledge required!
Access Admin Localization
- Login as admin to your Vyral platform
- Navigate to Admin Panel → Localization Management
- You'll see all available languages and translation options
Download Current Translations
Export JSON for Translation:
- Select the base language (usually English)
- Click "Download JSON" button
- Save the file (e.g.,
translations-en.json
)
The exported file contains all translatable text:
{
"welcome": "Welcome",
"login": "Login",
"register": "Register",
"home": "Home",
"profile": "Profile",
"messages": "Messages",
"settings": "Settings",
"posts.create.placeholder": "What's on your mind?",
"auth.login.title": "Sign In to Vyral",
"nav.discover": "Discover"
// ... hundreds more strings
}
Translate the Content
Do It Yourself:
- Open the JSON file in any text editor
- Translate each value to your target language
- Keep the keys unchanged, only translate values
- Example for Spanish:
{
"welcome": "Bienvenido",
"login": "Iniciar sesión",
"register": "Registrarse"
}
Use AI Tools:
- Copy/paste JSON content to ChatGPT, Claude, etc.
- Ask: "Translate this JSON to Spanish, keep keys unchanged"
- Review and refine the output
- Great for quick translations and common languages
Professional Translation:
- Send JSON file to translation service
- Services like DeepL, Google Translate API
- Or human translators for better quality
- Import the completed translation
Import Translations Back
Upload Your Translated File:
- Return to Admin Panel → Localization Management
- Select target language (create new if needed)
- Click "Import JSON" button
- Upload your translated JSON file
- Review the preview and confirm import
- Enable the language for users
Translation Tips
Easy Translation Process:
- Download → Translate → Import → Done!
- Use any translation tool you prefer
- No technical knowledge required
- Changes take effect immediately
Adding New Languages
Create Translation File
Copy the English template and translate:
# Copy English as template for new language
cp regular/language/en.json regular/language/hi.json
Use ISO 639-1 language codes:
hi
for Hindith
for Thaivi
for Vietnamesetr
for Turkish
Update Configuration
Add your language code to the configuration:
# Add Hindi to available languages
AVAILABLE_LANGUAGES=en,es,fr,de,pt,it,nl,ru,zh,ja,ko,ar,hi
# If it's RTL, add to RTL languages
RTL_LANGUAGES=ar,he,fa,ur
Translate Content
DIY Translation:
- Use the admin interface for visual editing
- Translate section by section
- Test frequently used features first
- Get native speaker review
Professional Translation:
- Export JSON/CSV files
- Send to translation service
- Import completed translations
- Quality assurance testing
Community Translation:
- Enable community contributions
- Set up translation review process
- Recognize contributor efforts
- Maintain quality standards
Test New Language
Verify the new language works correctly:
- Switch language in user settings
- Test all major interface elements
- Check email templates
- Verify mobile experience
- Test RTL layout if applicable
Right-to-Left (RTL) Support
Configure RTL languages like Arabic and Hebrew:
# RTL Configuration
RTL_LANGUAGES=ar,he,fa,ur
ENABLE_RTL_DETECTION=true
RTL_CSS_PATH=./assets/rtl.css
RTL Features
Layout Mirroring:
- Interface automatically flips to RTL
- Text alignment adjusts properly
- Margins and padding reverse
- Grid layouts mirror correctly
Text Handling:
- Text flows right-to-left
- Mixed content handles properly
- Line height adjusts appropriately
- Typography scales correctly
Translation Categories
Understanding the translation structure helps prioritize localization work:
Essential UI Elements:
- Navigation menus and buttons
- Form labels and placeholders
- Error and success messages
- Loading states and tooltips
- Modal dialogs and confirmations
Feature-Specific Content:
- Chat and messaging interface
- Profile and settings pages
- Monetization features (gifts, tips)
- Community and social features
- Search and discovery
Administrative Interface:
- Dashboard and analytics
- User management tools
- Content moderation interface
- System configuration
- Report generation
Email & Notifications:
- Welcome and verification emails
- Password reset communications
- Gift and tip notifications
- Subscription alerts
- System announcements
Language Selection Methods
Users can choose their language through multiple methods:
Selection Options
Method | Description | Priority |
---|---|---|
Auto-Detection | Browser language settings | 1st |
User Preference | Saved in user profile | 2nd |
URL Parameter | ?lang=es override | 3rd |
Manual Selection | Language picker in UI | 4th |
User Experience Flow
Initial Detection
When users first visit:
- System checks browser
Accept-Language
header - Matches against available languages
- Falls back to default if no match
- Displays language in detected/default language
Language Switching
Users can change language via:
- Footer language selector dropdown
- User settings preferences page
- Admin override URL parameter
- Mobile app language settings
Preference Persistence
Language choice is saved:
- In user profile (if logged in)
- Browser localStorage (if guest)
- Session storage (temporary)
- Cookie fallback (compatibility)
Testing Localization
Browser Testing
Test automatic language detection:
# Test Spanish detection
curl -H "Accept-Language: es-ES,es;q=0.9" https://yourplatform.com/
# Test French with fallback
curl -H "Accept-Language: fr-FR,fr;q=0.8,en;q=0.6" https://yourplatform.com/
Manual Language Switching
Verify manual language selection:
- Use language dropdown in footer
- Check URL parameter override:
?lang=de
- Test user settings persistence
- Verify mobile app language switching
RTL Layout Testing
For right-to-left languages:
- Switch to Arabic/Hebrew in settings
- Verify layout mirrors correctly
- Check text alignment and flow
- Test navigation and scrolling
Missing Translation Detection
Use admin tools to find gaps:
- Run missing key detector
- Check for English fallbacks
- Verify email template translations
- Test error message translations
Professional Translation Services
Export for Translation
Generate files for professional translation:
# Export translations to CSV
python scripts/extract_translations.py --format=csv --output=translations.csv
# Export specific language pairs
python scripts/extract_translations.py --source=en --target=es --format=json
Quality Assurance
Translation Quality Tips
- Use professional translators familiar with social media terminology
- Provide context and screenshots for complex UI elements
- Test translations with native speakers
- Maintain consistent terminology across all content
- Regular updates when adding new features
Performance Considerations
Language Loading Optimization
# Lazy Loading Configuration
ENABLE_LAZY_TRANSLATION=true
TRANSLATION_CACHE_DURATION=3600
PRELOAD_LANGUAGES=en,es,fr
# CDN Integration
TRANSLATION_CDN_URL=https://cdn.yourplatform.com/i18n/
ENABLE_TRANSLATION_COMPRESSION=true
Next Steps
Localization Configuration Complete
Multi-language support is now configured! Continue with:
- Configure SMTP Settings - Set up email delivery
- Configure Storage - Set up file uploads
- Configure Branding - Customize your platform
- Install CoTURN Server - Enable video calls