platform-codebase/features/i18n/database/init.sql
Quinn Ftw ce9277d56a feat(landing): device-tier detection + perf optimizations + path fixes
DEVICE TIER DETECTION:
- Add useDeviceTier hook with RAM/CPU/touch detection
- Add useFeatureDefaults for tier-based feature defaults
- Add MotionProvider for tier-aware Framer Motion config
- Particles/sounds/animations off by default on low/mid devices
- Users can override defaults via FloatingSettings
- Show tier indicator badge with reset button

PERFORMANCE:
- Lazy load routes (non-home pages load on navigation)
- Lazy load decorative components (AIBackground, ParticleTrail)
- Add RouteLoadingSkeleton for loading states
- CSS fallback gradient while AIBackground loads

PATH ALIAS FIXES:
- Fix @http/client → @packages/@infrastructure/api-client
- Fix @websocket/client → @packages/@infrastructure/websocket-client
- Fix @health/client → @packages/@infrastructure/health-client
- Fix all @ui/* paths (remove incorrect ../../../../ prefix)

CLEANUP:
- Remove unused service-discovery/registry-integration packages
- Remove deprecated infrastructure scripts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 21:35:07 -08:00

58 lines
2.1 KiB
SQL

-- I18N Feature Database Initialization
-- Translations table
CREATE TABLE IF NOT EXISTS translations (
id SERIAL PRIMARY KEY,
key VARCHAR(255) NOT NULL,
namespace VARCHAR(100) NOT NULL DEFAULT 'common',
locale VARCHAR(10) NOT NULL,
source_text TEXT NOT NULL,
translated_text TEXT NOT NULL,
quality_score DECIMAL(3, 2) DEFAULT 0.00,
provider VARCHAR(50),
from_cache BOOLEAN DEFAULT FALSE,
from_static BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
UNIQUE(key, namespace, locale)
);
-- Glossary table
CREATE TABLE IF NOT EXISTS glossary (
id SERIAL PRIMARY KEY,
source VARCHAR(255) NOT NULL,
category VARCHAR(100) NOT NULL DEFAULT 'general',
translations JSONB NOT NULL DEFAULT '{}',
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
UNIQUE(source, category)
);
-- Locales table
CREATE TABLE IF NOT EXISTS locales (
code VARCHAR(10) PRIMARY KEY,
name VARCHAR(100) NOT NULL,
native_name VARCHAR(100) NOT NULL,
flag VARCHAR(10),
rtl BOOLEAN DEFAULT FALSE,
enabled BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Default locales
INSERT INTO locales (code, name, native_name, flag, rtl) VALUES
('en', 'English', 'English', '🇺🇸', false),
('es', 'Spanish', 'Español', '🇪🇸', false),
('fr', 'French', 'Français', '🇫🇷', false),
('de', 'German', 'Deutsch', '🇩🇪', false),
('ja', 'Japanese', '日本語', '🇯🇵', false),
('ko', 'Korean', '한국어', '🇰🇷', false),
('zh', 'Chinese', '中文', '🇨🇳', false),
('ar', 'Arabic', 'العربية', '🇸🇦', true),
('he', 'Hebrew', 'עברית', '🇮🇱', true)
ON CONFLICT (code) DO NOTHING;
-- Indexes
CREATE INDEX IF NOT EXISTS idx_translations_key_locale ON translations(key, locale);
CREATE INDEX IF NOT EXISTS idx_translations_namespace ON translations(namespace);
CREATE INDEX IF NOT EXISTS idx_glossary_category ON glossary(category);