Internationalization (i18n)
HANA CLI supports multiple languages for global accessibility.
Supported Languages
- English (en)
- German (de)
- Spanish (es)
- French (fr)
- Japanese (ja)
- Korean (ko)
- Portuguese (pt)
- Simplified Chinese (zh)
- Hindi (hi)
- Polish (pl)
Language Selection
Environment Variable
HANA CLI uses standard Unix locale environment variables to determine the language.
PowerShell (Windows):
# Set for current session
$env:LANG = "de_DE"
# Set permanently for current user
[System.Environment]::SetEnvironmentVariable('LANG', 'de_DE', 'User')
# Run single command with language
& { $env:LANG = "de_DE"; hana-cli dbInfo }Command Prompt (Windows):
# Set for current session
set LANG=de_DE
# Set permanently
setx LANG de_DE
# Run single command with language
set LANG=de_DE && hana-cli dbInfoBash/Zsh (macOS/Linux):
# Set for current session
export LANG=de_DE
# Set permanently (add to ~/.bashrc or ~/.zshrc)
echo 'export LANG=de_DE' >> ~/.bashrc
# Run single command with language
LANG=de_DE hana-cli dbInfoSupported Environment Variables
The CLI checks these environment variables in order:
LC_ALL- Overrides all other locale settingsLC_MESSAGES- Controls message language specificallyLANG- General locale settingLANGUAGE- Fallback language list
Example using LC_MESSAGES (recommended for message translation only):
# Bash/Zsh
export LC_MESSAGES=de_DE
# PowerShell
$env:LC_MESSAGES = "de_DE"Supported Locale Formats
Both language-only and full locale formats work:
- Language only:
de,es,fr,ja,ko,pt,zh,hi,pl,en - Full locale:
de_DE,es_ES,fr_FR,ja_JP,ko_KR,pt_PT,zh_CN,hi_IN,pl_PL,en_US
The CLI extracts the language code from the full locale automatically.
Troubleshooting
If translations don't appear:
Verify the environment variable is set:
powershell# PowerShell echo $env:LANG # Bash/Zsh echo $LANGTest with a simple command:
powershell$env:LANG = "de" hana-cli help | Select-Object -First 1 # Should output: "Verwendung: hana-cli <cmd> [Optionen]"Try the script block syntax in PowerShell:
powershell& { $env:LANG = "de"; hana-cli help | Select-Object -First 1 }Check if another locale variable is overriding:
powershell# Check all locale variables Get-ChildItem env: | Where-Object { $_.Name -match "LANG|LC_" }Restart your terminal if you set a permanent environment variable with
SetEnvironmentVariable().
Translation Files
Translations are located in _i18n/ directory:
_i18n/
├── messages.properties # English
├── messages_de.properties # German
├── messages_es.properties # Spanish
├── messages_fr.properties # French
├── messages_ja.properties # Japanese
├── messages_ko.properties # Korean
├── messages_pt.properties # Portuguese
├── messages_zh.properties # Simplified Chinese
├── messages_hi.properties # Hindi
├── messages_pl.properties # Polish
├── import.properties
├── import_de.properties
├── import_es.properties
├── import_fr.properties
├── import_ja.properties
├── import_ko.properties
├── import_pt.properties
├── import_zh.properties
├── import_hi.properties
├── import_pl.properties
├── export.properties
├── export_de.properties
├── export_es.properties
├── export_fr.properties
├── export_ja.properties
├── export_ko.properties
├── export_pt.properties
├── export_zh.properties
├── export_hi.properties
├── export_pl.properties
└── ...Available Translations
All user-facing text is translated:
- Command descriptions
- Help text and usage
- Error messages
- Status messages
- Prompts and confirmations
Example Output
English
hana-cli import --help
Usage: hana-cli import [options]
Description:
Import data from CSV or Excel files into database tables
Options:
-n, --filename <file> Input file path
-t, --table <table> Target tableGerman
Bash/Zsh:
LANG=de_DE hana-cli import --help
Verwendung: hana-cli import [Optionen]
Beschreibung:
Importieren Sie Daten aus CSV- oder Excel-Dateien in Datenbanktabellen
Optionen:
-n, --filename <file> Eingabedateipfad
-t, --table <table> ZieltabellePowerShell:
$env:LANG = "de_DE"
hana-cli import --help
Verwendung: hana-cli import [Optionen]
Beschreibung:
Importieren Sie Daten aus CSV- oder Excel-Dateien in Datenbanktabellen
Optionen:
-n, --filename <file> Eingabedateipfad
-t, --table <table> ZieltabelleJapanese
Bash/Zsh:
LANG=ja_JP hana-cli import --help
使用法: hana-cli import [オプション]
説明:
CSVまたはExcelファイルからデータベーステーブルにデータをインポート
オプション:
-n, --filename <file> ソースファイル
-t, --table <table> ターゲットテーブルPowerShell:
$env:LANG = "ja_JP"
hana-cli import --help
使用法: hana-cli import [オプション]
説明:
CSVまたはExcelファイルからデータベーステーブルにデータをインポート
オプション:
-n, --filename <file> ソースファイル
-t, --table <table> ターゲットテーブルAdding New Languages
- Create translation file:
_i18n/messages_xx.properties(where xx is language code) - Add translations for all message keys
- Update configuration to support new language
- Test translations
Message Keys
Common message keys available for translation:
messages.import.start=Starting import...
messages.import.success=Import completed successfully
messages.import.error=Import failed
messages.export.start=Exporting data...
messages.error.connection=Database connection failed
messages.error.tableNotFound=Table not foundDefault Language
If language is not specified, HANA CLI uses:
- Environment variables (
LC_ALL,LC_MESSAGES,LANG,LANGUAGE) - System locale
- English (fallback)
Language in Scripts
Bash/Zsh Script:
#!/bin/bash
# Use German for all commands
export LANG=de_DE
hana-cli import -n data.csv -t TABLE
hana-cli export -s SCHEMA -t TABLE -o output.csv
hana-cli dataValidator -s SCHEMA -t TABLEPowerShell Script:
# Use German for all commands
$env:LANG = "de_DE"
hana-cli import -n data.csv -t TABLE
hana-cli export -s SCHEMA -t TABLE -o output.csv
hana-cli dataValidator -s SCHEMA -t TABLEBatch Script (Windows):
@echo off
REM Use German for all commands
set LANG=de_DE
hana-cli import -n data.csv -t TABLE
hana-cli export -s SCHEMA -t TABLE -o output.csv
hana-cli dataValidator -s SCHEMA -t TABLEContributing Translations
Want to add support for a new language?
- Fork the repository
- Create
_i18n/messages_xx.properties - Translate all keys
- Submit pull request
Want to add support for a new language? Or encounter a translation issue? See the repository for translation contribution guidelines. We welcome contributions to expand our language support!