Skip to content

Conversation

@AlirezaNikkhah1375
Copy link

🌐 Interactive Language Selector & Localization Improvements

This PR introduces a comprehensive language selection system and fixes critical localization issues for better user experience across different languages.

✨ New Features

  • Interactive Language Selector: Added a beautiful dropdown language selector in the preloader screen

    • Supports 10 languages: Auto-detect, English, French, German, Persian, Portuguese, Portuguese (BR), Spanish, Traditional Chinese, and Turkish
    • Modern UI with flag emojis, hover effects, and smooth animations
    • Positioned in the top-right corner for easy access
    • Auto-detects user's browser language by default
  • Enhanced Localization System: Improved the initializeTextStrings() function to handle forced language selection

    • Better fallback mechanisms for unsupported languages
    • Dynamic text updates when language is changed

🐛 Bug Fixes

  • Fixed undefined textStrings on local development: Resolved critical issue where textStrings was undefined during local development, causing crashes
  • Improved language detection: Better handling of browser language codes and regional variants

🎨 UI/UX Improvements

  • Modern Design: Clean, accessible language selector with:

    • Subtle drop shadows and gradients
    • Smooth hover animations
    • Professional styling that matches the game's aesthetic
    • Responsive design that works on different screen sizes
  • Better User Experience:

    • Instant language switching without page reload
    • Visual feedback on selection
    • Clear language identification with flags and native names

🔧 Technical Details

Files Modified:

  • js/scenes/Scene_Preloader.js (+251 lines): Complete language selector implementation
  • js/textStrings.js (+46 lines): Enhanced localization function with forced language support

Key Implementation Features:

  • PIXI.js-based UI components for seamless integration
  • Event-driven language switching
  • Memory-efficient dropdown management
  • Cross-platform compatibility (mouse and touch events)

🧪 Testing

  • Tested across multiple browsers and devices
  • Verified language switching functionality
  • Confirmed no performance impact on game loading
  • Validated accessibility features

📱 Compatibility

  • Works on desktop and mobile devices
  • Compatible with all existing language translations
  • Maintains backward compatibility with existing localization system
  • No breaking changes to existing functionality

This enhancement significantly improves the accessibility and user experience for international players while maintaining the game's performance and aesthetic integrity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants