Multi Language
Skill Profile
(Select at least one profile to enable specific modules)
Overview
Multi-language support enables applications to serve content in multiple languages, allowing users to choose their preferred language and providing localized experiences. Effective multi-language support includes language detection, switching, content management, and locale-aware formatting.
Why This Matters
Core Concepts
User Request → Language Detection → Load Translations → Render in Language
↓
Language Preference (Browser/User Setting)
↓
Translation Files (en.json, th.json, etc.)
↓
Localized Content
Inputs / Outputs / Contracts
- Inputs:
- <e.g., env vars, request payload, file paths, schema>
- Entry Conditions:
- <Pre-requisites: e.g., Repo initialized, DB running, specific branch checked out>
- Outputs:
- <e.g., artifacts (PR diff, docs, tests, dashboard JSON)>
- Artifacts Required (Deliverables):
- <e.g., Code Diff, Unit Tests, Migration Script, API Docs>
- Acceptance Evidence:
- <e.g., Test Report (screenshot/log), Benchmark Result, Security Scan Report>
- Success Criteria:
- <e.g., p95 < 300ms, coverage ≥ 80%>
Skill Composition
- Depends on: None
- Compatible with: None
- Conflicts with: None
- Related Skills: None
Quick Start
Assumptions / Constraints / Non-goals
- Assumptions:
- Development environment is properly configured
- Required dependencies are available
- Team has basic understanding of domain
- Constraints:
- Must follow existing codebase conventions
- Time and resource limitations
- Compatibility requirements
- Non-goals:
- This skill does not cover edge cases outside scope
- Not a replacement for formal training
Compatibility & Prerequisites
- Supported Versions:
- Python 3.8+
- Node.js 16+
- Modern browsers (Chrome, Firefox, Safari, Edge)
- Required AI Tools:
- Code editor (VS Code recommended)
- Testing framework appropriate for language
- Version control (Git)
- Dependencies:
- Language-specific package manager
- Build tools
- Testing libraries
- Environment Setup:
.env.example keys: API_KEY, DATABASE_URL (no values)
Test Scenario Matrix (QA Strategy)
| Type |
Focus Area |
Required Scenarios / Mocks |
| Unit |
Core Logic |
Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
| Integration |
DB / API |
All external API calls or database connections must be mocked during unit tests |
| E2E |
User Journey |
Critical user flows to test |
| Performance |
Latency / Load |
Benchmark requirements |
| Security |
Vuln / Auth |
SAST/DAST or dependency audit |
| Frontend |
UX / A11y |
Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
Technical Guardrails & Security Threat Model
1. Security & Privacy (Threat Model)
- Top Threats: Injection attacks, authentication bypass, data exposure
2. Performance & Resources
3. Architecture & Scalability
4. Observability & Reliability
Agent Directives & Error Recovery
(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)
- Thinking Process: Analyze root cause before fixing. Do not brute-force.
- Fallback Strategy: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.
- Self-Review: Check against Guardrails & Anti-patterns before finalizing.
- Output Constraints: Output ONLY the modified code block. Do not explain unless asked.
Definition of Done (DoD) Checklist
Anti-patterns
Reference Links & Examples
- Internal documentation and examples
- Official documentation and best practices
- Community resources and discussions
Versioning & Changelog
- Version: 1.0.0
- Changelog:
- 2026-02-22: Initial version with complete template structure
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: multi-language3description: Multi-language support enables applications to serve content in multiple Use when this capability is needed.4---56# Multi Language78## Skill Profile9*(Select at least one profile to enable specific modules)*10- [ ] **DevOps**11- [x] **Backend**12- [ ] **Frontend**13- [ ] **AI-RAG**14- [ ] **Security Critical**1516## Overview17Multi-language support enables applications to serve content in multiple languages, allowing users to choose their preferred language and providing localized experiences. Effective multi-language support includes language detection, switching, content management, and locale-aware formatting.1819## Why This Matters20- **<Benefit>**: <short explanation>21- **<Benefit>**: <short explanation>22- **<Benefit>**: <short explanation>2324## Core Concepts25```26User Request → Language Detection → Load Translations → Render in Language27 ↓28Language Preference (Browser/User Setting)29 ↓30Translation Files (en.json, th.json, etc.)31 ↓32Localized Content33```3435## Inputs / Outputs / Contracts36* **Inputs**:37 - <e.g., env vars, request payload, file paths, schema>38* **Entry Conditions**:39 - <Pre-requisites: e.g., Repo initialized, DB running, specific branch checked out>40* **Outputs**:41 - <e.g., artifacts (PR diff, docs, tests, dashboard JSON)>42* **Artifacts Required (Deliverables)**:43 - <e.g., Code Diff, Unit Tests, Migration Script, API Docs>44* **Acceptance Evidence**:45 - <e.g., Test Report (screenshot/log), Benchmark Result, Security Scan Report>46* **Success Criteria**:47 - <e.g., p95 < 300ms, coverage ≥ 80%>4849## Skill Composition50* **Depends on**: None51* **Compatible with**: None52* **Conflicts with**: None53* **Related Skills**: None5455## Quick Start56#5758## Assumptions / Constraints / Non-goals5960* **Assumptions**:61 - Development environment is properly configured62 - Required dependencies are available63 - Team has basic understanding of domain64* **Constraints**:65 - Must follow existing codebase conventions66 - Time and resource limitations67 - Compatibility requirements68* **Non-goals**:69 - This skill does not cover edge cases outside scope70 - Not a replacement for formal training717273## Compatibility & Prerequisites7475* **Supported Versions**:76 - Python 3.8+77 - Node.js 16+78 - Modern browsers (Chrome, Firefox, Safari, Edge)79* **Required AI Tools**:80 - Code editor (VS Code recommended)81 - Testing framework appropriate for language82 - Version control (Git)83* **Dependencies**:84 - Language-specific package manager85 - Build tools86 - Testing libraries87* **Environment Setup**:88 - `.env.example` keys: `API_KEY`, `DATABASE_URL` (no values)899091## Test Scenario Matrix (QA Strategy)9293| Type | Focus Area | Required Scenarios / Mocks |94| :--- | :--- | :--- |95| **Unit** | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |96| **Integration** | DB / API | All external API calls or database connections must be mocked during unit tests |97| **E2E** | User Journey | Critical user flows to test |98| **Performance** | Latency / Load | Benchmark requirements |99| **Security** | Vuln / Auth | SAST/DAST or dependency audit |100| **Frontend** | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |101102103## Technical Guardrails & Security Threat Model104105### 1. Security & Privacy (Threat Model)106* **Top Threats**: Injection attacks, authentication bypass, data exposure107- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII108- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager109- [ ] **Authorization**: Validate user permissions before state changes110111### 2. Performance & Resources112- [ ] **Execution Efficiency**: Consider time complexity for algorithms113- [ ] **Memory Management**: Use streams/pagination for large data114- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks115116### 3. Architecture & Scalability117- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection118- [ ] **Modularity**: Decouple logic from UI/Frameworks119120### 4. Observability & Reliability121- [ ] **Logging Standards**: Structured JSON, include trace IDs `request_id`122- [ ] **Metrics**: Track `error_rate`, `latency`, `queue_depth`123- [ ] **Error Handling**: Standardized error codes, no bare except124- [ ] **Observability Artifacts**:125 - **Log Fields**: timestamp, level, message, request_id126 - **Metrics**: request_count, error_count, response_time127 - **Dashboards/Alerts**: High Error Rate > 5%128129130## Agent Directives & Error Recovery131*(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)*132133- **Thinking Process**: Analyze root cause before fixing. Do not brute-force.134- **Fallback Strategy**: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.135- **Self-Review**: Check against Guardrails & Anti-patterns before finalizing.136- **Output Constraints**: Output ONLY the modified code block. Do not explain unless asked.137138139## Definition of Done (DoD) Checklist140141- [ ] Tests passed + coverage met142- [ ] Lint/Typecheck passed143- [ ] Logging/Metrics/Trace implemented144- [ ] Security checks passed145- [ ] Documentation/Changelog updated146- [ ] Accessibility/Performance requirements met (if frontend)147148149## Anti-patterns150#151152## Reference Links & Examples153154* Internal documentation and examples155* Official documentation and best practices156* Community resources and discussions157158159## Versioning & Changelog160161* **Version**: 1.0.0162* **Changelog**:163 - 2026-02-22: Initial version with complete template structure164165---166> Converted and distributed by [TomeVault](https://tomevault.io/claim/amnadtaowsoam) — claim your Tome and manage your conversions.167<!-- tomevault:4.0:skill_md:2026-04-13 -->