bin/
├── i18n/
│ ├── en.php # English (default)
│ ├── es.php # Spanish
│ ├── pt.php # Portuguese
│ ├── it.php # Italian
│ ├── fr.php # French
│ ├── de.php # German
│ ├── loader.php # Translation loader for PHP
│ ├── translations.sh # Translation loader for Bash
│ ├── en.sh # English translations for Bash
│ └── es.sh # Spanish translations for Bash
├── generate-composer-require.sh
└── process-updates.php
# Language for output messages
# Supported: 31 languages (see CONFIGURATION.md for complete list)
# If not set, will auto-detect from system (LANG, LC_ALL, LC_MESSAGES)
# Default: en (English)
language: es-
Read from YAML (priority 1)
- If
language: esis in YAML, use Spanish
- If
-
Detect from system (priority 2)
- Read
LC_MESSAGES,LC_ALL,LANG - Extract language code (e.g.,
es_ES.UTF-8→es)
- Read
-
Fallback (priority 3)
- If not detected or not supported →
en(English)
- If not detected or not supported →
- Function
detectLanguage(): Detects system language - Function
loadTranslations($lang): Loads PHP translation file - Function
t($key, $params = []): Translates message - Each
i18n/XX.phpfile returns associative array
- Function
detect_language(): Detects system language - Function
load_translations($lang): Loads translations from file - Function
t($key): Translates message - Separate files:
i18n/en.sh,i18n/es.sh, etc.
<?php
return [
'no_packages_update' => 'No hay paquetes para actualizar',
'all_up_to_date' => 'todos los paquetes están actualizados',
'suggested_commands' => 'Comandos sugeridos:',
// ... more translations
];declare -A TRANSLATIONS_ES=(
['no_packages_update']='No hay paquetes para actualizar'
['all_up_to_date']='todos los paquetes están actualizados'
['suggested_commands']='Comandos sugeridos:'
# ... more translations
)- Main output messages
- Debug messages (DEBUG: ...)
- Labels and descriptions
- Informative messages
- Error messages
- Debug messages
- Help text