Lingo.dev + .yaml (Data)
Lingo.dev CLI translates YAML files while preserving structure, data types, and formatting for configuration and content management. The CLI maintains exact YAML hierarchy and indentation, processes only string values while preserving numbers and booleans, keeps developer documentation comments intact, ensures YAML anchors and aliases work correctly, and follows YAML 1.2 specification exactly.
Quick Setup
Configure for YAML files with locale-based naming:
{
"locale": {
"source": "en",
"targets": ["es", "fr", "de"]
},
"buckets": {
"yaml": {
"include": ["config/[locale].yaml"]
}
}
}
Reminder: [locale]
is a placeholder that should remain in the config literally, as it's replaced with the actual locale during CLI run.
Translate YAML Content
npx lingo.dev@latest i18n
Preserves YAML structure, data types, comments, and formatting while translating string values.
Structure Preservation
Nested Configuration
app:
name: "My Application"
description: "A powerful tool for productivity"
features:
- "Real-time collaboration"
- "Advanced search"
- "Custom themes"
database:
host: "localhost"
port: 5432
String values get translated while technical configuration remains unchanged.
Mixed Data Types
user_interface:
welcome_message: "Welcome to our platform!"
max_items: 100
enable_notifications: true
created_at: 2024-01-15T10:30:00Z
Only translatable strings are processed; numbers, booleans, and dates stay intact.
Advanced Features
Comment Preservation
# Application configuration
app:
# User-facing strings
title: "Dashboard"
tagline: "Manage your projects efficiently"
# Technical settings (not translated)
version: "1.2.0"
Comments remain exactly as written in the source file.
Anchor and Reference Support
defaults: &defaults
timeout: 30
retries: 3
production:
<<: *defaults
message: "Production environment ready"
YAML anchors and references are preserved during translation.
Advanced Configuration
Multiple YAML Files
"yaml": {
"include": [
"config/[locale].yaml",
"content/[locale]/*.yml"
]
}
Lock Technical Keys
"yaml": {
"include": ["config/[locale].yaml"],
"lockedKeys": ["database", "api/endpoint", "version"]
}