Multi-language Support (i18n)¶
Docker Pilot supports multiple languages to provide a localized experience for users worldwide.
Supported Languages¶
Currently supported languages:
- English (en) - Default language
- Português (Brasil) (pt-br) - Complete Portuguese translation
Automatic Language Detection¶
Docker Pilot automatically detects your system language on first run:
# System language detection (Linux/macOS)
echo $LANG
# pt_BR.UTF-8 → Portuguese (Brasil)
# en_US.UTF-8 → English
# Windows detection
echo $env:LANG
# Uses system locale settings
Language Selection¶
First Run¶
When you run Docker Pilot for the first time, you'll be prompted to select your language:
🌍 Welcome to Docker Pilot!
Please choose your language / Por favor, escolha seu idioma:
1. English
2. Português (Brasil)
Select option / Selecione a opção (1-2):
This selection is saved to your configuration file and remembered for future runs.
Changing Language¶
You can change the language at any time using several methods:
Method 1: Interactive Menu¶
- Start Docker Pilot:
docker-pilot
- Navigate to Advanced settings (option 15)
- Select Change language (option 1)
- Choose your preferred language
- The change takes effect immediately
Method 2: Configuration File¶
Edit your docker-pilot.config.json
:
Method 3: CLI Parameter¶
# Use Portuguese for this session
docker-pilot --lang pt-br
# Set language permanently
docker-pilot config --set language=pt-br
Method 4: Environment Variable¶
# Temporary (current session)
export DOCKER_PILOT_LANG=pt-br
docker-pilot
# Permanent (add to .bashrc/.zshrc)
echo 'export DOCKER_PILOT_LANG=pt-br' >> ~/.bashrc
Language Features¶
Complete Interface Translation¶
All user-facing text is translated:
- ✅ Interactive Menu: All menu options and messages
- ✅ CLI Commands: Help text, error messages, and output
- ✅ Status Messages: Success, error, and warning messages
- ✅ Configuration: Validation messages and prompts
- ✅ Plugin System: Plugin messages and errors
Context-Aware Translations¶
Translations include context-specific information:
// English
"Service {serviceName} started successfully"
"Starting {count} services..."
"Port {port} is already in use"
// Portuguese (Brasil)
"Serviço {serviceName} iniciado com sucesso"
"Iniciando {count} serviços..."
"Porta {port} já está em uso"
Docker Commands Remain in English¶
Docker-specific commands and output remain in English for consistency:
# These remain in English regardless of language
docker compose up
docker compose down
docker logs container_name
Examples by Language¶
English Interface¶
============================================================
🐳 Welcome to MyApp Docker Pilot v2.0! 🐳
============================================================
📁 Directory: /path/to/project
🔧 Services: web, api, database
====================================
🚀 Basic Commands
====================================
1. Quick setup (detect services)
2. Start all services
3. Stop all services
4. Restart all services
...
Choose your option:
Portuguese (Brasil) Interface¶
============================================================
🐳 Bem-vindo ao MyApp Docker Pilot v2.0! 🐳
============================================================
📁 Diretório: /path/to/project
🔧 Serviços: web, api, database
====================================
🚀 Comandos Básicos
====================================
1. Configuração rápida (detectar serviços)
2. Iniciar todos os serviços
3. Parar todos os serviços
4. Reiniciar todos os serviços
...
Digite sua escolha:
CLI Command Examples¶
English¶
$ docker-pilot up
✅ Starting services...
✅ Service web started successfully
✅ Service api started successfully
✅ Service database started successfully
🎉 All services started successfully!
$ docker-pilot status
📊 Current Service Status:
✅ web: running (healthy)
✅ api: running (healthy)
✅ database: running (healthy)
Portuguese (Brasil)¶
$ docker-pilot up
✅ Iniciando serviços...
✅ Serviço web iniciado com sucesso
✅ Serviço api iniciado com sucesso
✅ Serviço database iniciado com sucesso
🎉 Todos os serviços iniciados com sucesso!
$ docker-pilot status
📊 Status Atual dos Serviços:
✅ web: rodando (saudável)
✅ api: rodando (saudável)
✅ database: rodando (saudável)
Error Messages¶
Error messages are also translated:
English¶
❌ Error: Docker is not running
💡 Please start Docker and try again
❌ Error: Service 'web' not found
💡 Available services: api, database
⚠️ Warning: Port 8080 is already in use
💡 Consider using a different port
Portuguese (Brasil)¶
❌ Erro: Docker não está rodando
💡 Inicie o Docker e tente novamente
❌ Erro: Serviço 'web' não encontrado
💡 Serviços disponíveis: api, database
⚠️ Aviso: Porta 8080 já está em uso
💡 Considere usar uma porta diferente
Configuration Examples¶
Project Configuration¶
Your project's language setting is stored in docker-pilot.config.json
:
{
"projectName": "minha-aplicacao",
"language": "pt-br",
"dockerCompose": "docker compose",
"services": {
"web": {
"port": 8080,
"healthCheck": true
}
}
}
Global Configuration¶
You can set a global default language:
# Set global language preference
npm config set docker-pilot:language pt-br
# Or use environment variable
export DOCKER_PILOT_LANG=pt-br
Plugin Development¶
When developing plugins, use the i18n system:
// plugin.js
import { I18n } from "docker-pilot";
class MyPlugin {
constructor() {
this.i18n = new I18n();
}
execute() {
console.log(this.i18n.t('plugin.my_message'));
console.log(this.i18n.t('plugin.service_count', { count: 3 }));
}
}
Add translations to your plugin:
// translations.js
module.exports = {
en: {
'plugin.my_message': 'Plugin executed successfully',
'plugin.service_count': 'Found {count} services'
},
'pt-br': {
'plugin.my_message': 'Plugin executado com sucesso',
'plugin.service_count': 'Encontrados {count} serviços'
}
};
Language Detection Logic¶
Docker Pilot uses the following priority order for language detection:
- CLI Parameter:
--lang pt-br
- Environment Variable:
DOCKER_PILOT_LANG=pt-br
- Configuration File:
language: "pt-br"
- System Language:
$LANG
,$LANGUAGE
, or Windows locale - Default:
en
(English)
Contributing Translations¶
Adding a New Language¶
To add support for a new language:
- Fork the repository
- Add language code to supported languages in
src/utils/i18n.ts
- Create translation file with all required keys
- Test thoroughly with interactive menu and CLI
- Submit pull request with examples and documentation
Translation Guidelines¶
- Keep it natural: Translations should sound natural to native speakers
- Maintain context: Preserve the meaning and context of the original text
- Use consistent terminology: Keep Docker and technical terms consistent
- Test extensively: Test both interactive menu and CLI commands
- Include examples: Provide examples of the translated interface
Required Translation Keys¶
All translations must include these key categories:
docker.*
- Docker-related messagesmenu.*
- Interactive menu itemscommand.*
- Command names and descriptionsservice.*
- Service management messagescli.*
- CLI help and error messagesplugin.*
- Plugin system messagesvalidation.*
- Configuration validation messages
Troubleshooting¶
Language Not Changing¶
# Check current language
docker-pilot config --show | grep language
# Force language change
docker-pilot config --set language=pt-br
# Verify change
docker-pilot config --show | grep language
Mixed Language Output¶
If you see mixed languages:
- Check configuration: Ensure language is set correctly
- Clear cache: Some messages might be cached
- Restart terminal: Environment variables might need refresh
- Update Docker Pilot: Ensure you have the latest version
Missing Translations¶
If you see English text in non-English mode:
- Check version: Ensure you have the latest version
- Report issue: Missing translations should be reported
- Contribute: Help by contributing the missing translation
Best Practices¶
For Users¶
- Set language once: Configure your preferred language in the project
- Use consistent language: Keep the same language across your team
- Report issues: Help improve translations by reporting problems
For Teams¶
- Document language choice: Include language preference in project README
- Consistent environment: Use the same language across development, staging, and production
- Training: Ensure all team members know how to change language if needed
For Plugin Developers¶
- Use i18n system: Always use the translation system for user-facing messages
- Provide translations: Include translations for all supported languages
- Test multiple languages: Test your plugin in different languages
What's Next?¶
- 🎮 Learn about the Interactive Menu
- 🔧 Explore Configuration Files
- 🚀 Try Advanced Features
- 🤝 Contribute translations
Language Support
Docker Pilot's multi-language support makes it accessible to developers worldwide. The interface adapts to your language while keeping Docker commands standard for consistency across different environments.