🌐
UI/UX

Multi-Language System

Admin Settings

Database-driven translations with AI-powered auto-translate

Overview

Complete internationalization system. All strings use T::t() helper for translation lookup. Supports manual translations, Google Translate, OpenAI, Anthropic Claude, and DeepL for automatic translation.

Design Considerations

UX patterns and visual design notes for this feature:

  • RTL languages need layout consideration
  • German text is ~30% longer than English
  • Flag emojis are cute but not accessible
  • Language switcher placement affects discoverability

Key Benefits

What makes this feature stand out:

  • AI-powered auto-translation
  • 5 translation providers supported
  • Database-cached for performance
  • URL-based language switching (/en/, /sl/)
Technical Note

T::t() wraps Yii::t() with database fallback and auto-translate. Uses codemix/yii2-localeurls for URL patterns. Translations stored in translation table.

Helpers
T
Models
TranslationLanguage
Database Tables
translationlanguage

Configuration

Config Relationship Legend
DB overrides params.php🔗 DB related setting📋 DB stores value only
params.php Configuration

Config path: params['translations']

params['translations']['enableAutoTranslate'] => trueparams['translations']['defaultProvider'] => 'google'params['translations']['showInHeader'] => trueparams['translations']['showFloating'] => trueparams['translations']['widget']['header']['type'] => 'dropdown'
Database Settings (system_setting table)
KeyTypeDescriptionRelation
default_languagestringDefault language code (en, sl)
Note: AI provider API keys (OpenAI, Anthropic) must be in .env file. See params['openai'] and params['anthropic'] sections.