✅ Production Ready

Centralized Localization System

Multi-language support with real-time updates, multi-layer caching, and comprehensive management

System Statistics

10
Languages Supported
79+
Localization Keys
107
Unit Tests
81.1%
Code Coverage

What is the Localization System?

The HelixTrack Localization system is a dedicated microservice that provides centralized, scalable internationalization (i18n) for all HelixTrack applications. It uses HTTP/3 QUIC for optimal performance, PostgreSQL with SQL Cipher encryption for data storage, and multi-layer caching for lightning-fast translations.

🌍

10 Languages

Support for English, German, French, Spanish, Portuguese, Russian, Chinese, Japanese, Arabic (RTL), and Hebrew (RTL)

Real-Time Updates

WebSocket integration for instant translation updates across all clients without page refresh

🔄

Multi-Layer Caching

In-memory LRU cache + localStorage/Redis for optimal performance and reduced database load

📦

Catalog Versioning

Automatic version tracking with cache invalidation ensures clients always have the latest translations

🔒

Encrypted Storage

PostgreSQL with SQL Cipher encryption protects your localization data at rest

🎯

Variable Interpolation

Dynamic content with {variable} placeholders for personalized messages

Supported Languages

🇬🇧
English (en)
100% Complete
🇩🇪
German (de)
100% Complete
🇫🇷
French (fr)
100% Complete
🇪🇸
Spanish (es)
Ready to translate
🇵🇹
Portuguese (pt)
Ready to translate
🇷🇺
Russian (ru)
Ready to translate
🇨🇳
Chinese (zh)
Ready to translate
🇯🇵
Japanese (ja)
Ready to translate
🇸🇦
Arabic (ar)
RTL Support
🇮🇱
Hebrew (he)
RTL Support

System Architecture

Multi-Layer Localization Architecture

Layer 1: Clients (Web, Desktop, Mobile)

localStorage Cache: 1-hour TTL, automatic versioning
WebSocket Connection: Real-time update notifications
Fallback: Automatic fallback to default language (en)

Layer 2: Localization Service (HTTP/3 QUIC)

Port: 8085-8095 (auto-selection)
Protocol: HTTP/3 with TLS 1.3
In-Memory Cache: LRU cache for frequently accessed translations
Redis Cache: Optional distributed cache layer

Layer 3: Database (PostgreSQL + SQL Cipher)

Tables: 6 (languages, localization_keys, localizations, etc.)
Encryption: SQL Cipher for data at rest
Seed Data: Automatic population from JSON files on startup

Platform Integration

🌐

Web Client (Angular)

Full integration with WebSocket, caching, and automatic updates

✅ Complete
💻

Desktop Client (Tauri)

Native integration with offline support and sync

📋 Ready
📱

Android Client (Kotlin)

Native Android integration with HTTP/3 via Cronet

📋 Ready
🍎

iOS Client (Swift)

Native iOS integration with URLSession HTTP/3

📋 Ready
⚙️

Core Backend (Go)

Error message localization and response formatting

✅ Complete
🔧

Admin UI

Comprehensive management interface for translations

✅ Complete

Web Client Integration Example (TypeScript)

// Inject the localization service
constructor(private l10n: LocalizationService) {}

// Load catalog for a language
await this.l10n.loadCatalog('en');

// Translate a key
const message = this.l10n.t('error.invalid_request');

// Translate with variable interpolation
const greeting = this.l10n.t('app.welcome_user', { name: 'John' });
// Returns: "Welcome, John!"

// Batch translation
const messages = this.l10n.translateBatch([
  'error.success',
  'common.ok',
  'common.cancel'
]);

// Change language (triggers catalog reload)
await this.l10n.setLanguage('de');

// WebSocket events are automatically handled
// Catalog updates trigger cache refresh

Core Backend Integration Example (Go)

// Fetch complete catalog
catalog, err := locService.GetCatalog(ctx, "en")

// Translate single key
message, err := locService.Localize(ctx, "error.invalid_request", "en")

// Batch translation
keys := []string{"error.success", "common.ok"}
messages, err := locService.LocalizeBatch(ctx, keys, "en")

// Create localized error response
response := models.NewLocalizedErrorResponse(
    models.ErrorCodeInvalidRequest,
    "en",
    localizedMessage,
)
// Response includes both default and localized error messages

Android Integration Example (Kotlin + Cronet)

// Initialize HTTP/3 client with Cronet
val engine = CronetEngine.Builder(context)
    .enableHttp3(true)
    .build()

// Fetch localization catalog
val request = UrlRequest.Builder(
    "https://localization:8085/v1/catalog/en",
    callback,
    executor,
    engine
).build()

request.start()

// Handle response with translations
override fun onSucceeded(request: UrlRequest, info: UrlResponseInfo) {
    val catalog = parseCatalog(responseData)
    cacheManager.saveCatalog(catalog)
}

API Endpoints

Public Endpoints

# Health check
GET  /health

# Get complete catalog for a language
GET  /v1/catalog/:language

# Get single localization
GET  /v1/localize/:key?language=en

# Batch localization
POST /v1/localize/batch
{
  "keys": ["error.success", "common.ok"],
  "language": "en"
}

# List all languages
GET  /v1/languages

Admin Endpoints (Require Admin Role)

# Language Management
POST   /v1/admin/languages        # Create language
PUT    /v1/admin/languages/:id    # Update language
DELETE /v1/admin/languages/:id    # Delete language

# Localization Management
POST   /v1/admin/localizations    # Create/update localization
POST   /v1/admin/import           # Import (JSON, CSV, XLIFF)
GET    /v1/admin/export           # Export (JSON, CSV, XLIFF)

# Statistics
GET    /v1/admin/stats            # Get service statistics

WebSocket Events

// Connect to WebSocket
ws://localization:8085/ws

// Event types received:
- catalog_updated              // Catalog version changed
- localization_created         // New translation added
- localization_updated         // Translation modified
- localization_deleted         // Translation removed
- language_created             // New language added
- language_updated             // Language updated
- language_deleted             // Language removed
- batch_operation_completed    // Batch import/update done

Localization Key Categories

The system includes 79+ localization keys organized into 8 categories:

Error Messages (32)

Complete error code mapping from Core backend (ErrorCodeInvalidRequest, ErrorCodeMissingJWT, etc.)

Common UI (11)

Shared UI elements (OK, Cancel, Save, Delete, Confirm, etc.)

Navigation (8)

Navigation menu items (Dashboard, Projects, Tickets, Settings, etc.)

Authentication (6)

Login, logout, registration, password reset messages

Dashboard (4)

Dashboard-specific strings (widgets, charts, summaries)

Project (4)

Project management strings (create, update, archive)

Ticket (7)

Ticket-related strings (create, assign, comment, close)

Settings (5)

Settings and preferences strings

Management Tools & Scripts

Admin UI Module

The Web Client includes a comprehensive admin module for managing localizations:

CLI Scripts

# Populate database from seed data (JSON files)
./seed-data/populate-from-seed.sh

# Export database to seed format (for backups)
./seed-data/export-to-seed.sh

# Periodic automated backups
./seed-data/periodic-backup.sh
# Backups saved to: backups/hourly/, backups/daily/, backups/weekly/

Deployment & Configuration

Docker Deployment

# Start Localization service with Docker Compose
cd Core/Services/Localization
docker-compose up -d

# Services started:
# - Localization Service (port 8085, HTTP/3 QUIC)
# - PostgreSQL (port 5432)
# - Redis (optional, port 6379)

# Check service health
curl https://localhost:8085/health

# View logs
docker-compose logs -f localization

Configuration File (config.json)

{
  "server": {
    "port": 8085,
    "https": true,
    "cert_file": "/path/to/cert.pem",
    "key_file": "/path/to/key.pem"
  },
  "database": {
    "type": "postgresql",
    "host": "localhost",
    "port": 5432,
    "name": "localization_db",
    "user": "localization_user",
    "cipher_key": "your-encryption-key"
  },
  "cache": {
    "redis_enabled": true,
    "redis_address": "localhost:6379",
    "memory_cache_size": 1000
  },
  "seed_data": {
    "auto_populate": true,
    "seed_directory": "./seed-data"
  }
}

Ready to Get Started?

Explore the complete documentation and start using the Localization system today

User Manual Client Integration Guide