ZPL2PDF supports 8 languages with automatic detection and multiple configuration methods.
- 🇺🇸 English (en-US) - Default
- 🇧🇷 Portuguese (pt-BR)
- 🇪🇸 Spanish (es-ES)
- 🇫🇷 French (fr-FR)
- 🇩🇪 German (de-DE)
- 🇮🇹 Italian (it-IT)
- 🇯🇵 Japanese (ja-JP)
- 🇨🇳 Chinese Simplified (zh-CN)
The system uses the following priority order to detect the language:
1. --language parameter (temporary, only for that execution)
↓
2. ZPL2PDF_LANGUAGE environment variable (persistent)
↓
3. zpl2pdf.json configuration file (persistent)
↓
4. Operating system automatic detection (default)
Use for testing or specific executions:
# Windows
ZPL2PDF.exe --language es-ES status
ZPL2PDF.exe --language fr-FR -help
# Linux/macOS
./ZPL2PDF --language de-DE statusAdvantages:
- ✅ Quick for testing
- ✅ Doesn't change permanent configuration
Disadvantages:
- ❌ Must specify in each command
- ❌ Doesn't persist between executions
PowerShell (temporary - current session only):
$env:ZPL2PDF_LANGUAGE = "es-ES"PowerShell (permanent - for user):
[System.Environment]::SetEnvironmentVariable("ZPL2PDF_LANGUAGE", "es-ES", "User")CMD (permanent):
setx ZPL2PDF_LANGUAGE "es-ES"Temporary (current session only):
export ZPL2PDF_LANGUAGE="es-ES"Permanent (add to ~/.bashrc or ~/.zshrc):
echo 'export ZPL2PDF_LANGUAGE="es-ES"' >> ~/.bashrc
source ~/.bashrcPermanent (system-wide - /etc/profile.d/):
sudo echo 'export ZPL2PDF_LANGUAGE="es-ES"' > /etc/profile.d/zpl2pdf.sh
sudo chmod +x /etc/profile.d/zpl2pdf.shAdvantages:
- ✅ Works on Windows, Linux, and macOS
- ✅ Persistent across executions
- ✅ Easy to configure via scripts
- ✅ Ideal for installers (Inno Setup, .deb, .rpm)
- ✅ Perfect for Docker/Containers
- ✅ Corporate environments (Windows GPO)
Disadvantages:
⚠️ Requires logout/login or terminal restart (permanent)
| System | Location |
|---|---|
| Windows | C:\Program Files\ZPL2PDF\zpl2pdf.json |
| Linux | /opt/zpl2pdf/zpl2pdf.json or ~/.config/zpl2pdf/zpl2pdf.json |
| macOS | /Applications/ZPL2PDF/zpl2pdf.json |
{
"language": "es-ES",
"defaultListenFolder": "C:\\Users\\user\\Documents\\ZPL2PDF Auto Converter",
"labelWidth": 7.5,
"labelHeight": 15,
"unit": "in",
"dpi": 203,
"logLevel": "Info",
"retryDelay": 2000,
"maxRetries": 3
}Advantages:
- ✅ Persistent configuration
- ✅ Portable (can copy with executable)
- ✅ Easy to edit (any text editor)
- ✅ Can be versioned (git)
Disadvantages:
⚠️ May need administrator permissions (Windows/Program Files)⚠️ Less flexible than environment variable for scripts
If none of the above options are configured, the system automatically detects:
- Uses
CultureInfo.CurrentUICulture - Example: Portuguese system →
pt-BR
- Reads
LANGandLC_ALLenvironment variables - Example:
LANG=pt_BR.UTF-8→pt-BR
Advantages:
- ✅ Works automatically
- ✅ No configuration needed
Disadvantages:
⚠️ May not detect correctly in some cases⚠️ No manual control
You can configure the language automatically during installation:
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
LangCode: String;
begin
if CurStep = ssPostInstall then
begin
// Map installer language
case ActiveLanguage of
'english': LangCode := 'en-US';
'portuguese': LangCode := 'pt-BR';
'spanish': LangCode := 'es-ES';
'french': LangCode := 'fr-FR';
'german': LangCode := 'de-DE';
'italian': LangCode := 'it-IT';
else
LangCode := 'en-US';
end;
// Option 1: Set environment variable (RECOMMENDED)
RegWriteStringValue(HKCU, 'Environment', 'ZPL2PDF_LANGUAGE', LangCode);
// Option 2: Create configuration file in %APPDATA%
// (code to create zpl2pdf.json in user's AppData folder)
end;
end;Post-install script:
#!/bin/bash
# /var/lib/dpkg/info/zpl2pdf.postinst
# Detect system language
SYSTEM_LANG=$(echo $LANG | cut -d. -f1 | tr '_' '-')
# Create global configuration
echo "export ZPL2PDF_LANGUAGE=\"$SYSTEM_LANG\"" > /etc/profile.d/zpl2pdf.sh
chmod +x /etc/profile.d/zpl2pdf.sh%post
# Detect system language
SYSTEM_LANG=$(echo $LANG | cut -d. -f1 | tr '_' '-')
# Create global configuration
echo "export ZPL2PDF_LANGUAGE=\"$SYSTEM_LANG\"" > /etc/profile.d/zpl2pdf.sh
chmod +x /etc/profile.d/zpl2pdf.shFROM mcr.microsoft.com/dotnet/runtime:9.0
# Set container language
ENV ZPL2PDF_LANGUAGE=pt-BR
COPY --from=build /app/publish /app
WORKDIR /app
ENTRYPOINT ["/app/ZPL2PDF"]Docker Compose Example:
version: '3.8'
services:
zpl2pdf:
image: zpl2pdf:latest
environment:
- ZPL2PDF_LANGUAGE=es-ES # Set to Spanish
volumes:
- ./watch:/app/watch
- ./output:/app/output| Method | Cross-Platform | Persistent | Priority | Installer | Scripts | Docker |
|---|---|---|---|---|---|---|
--language |
✅ | ❌ | 1 (Highest) | ❌ | ✅ | ✅ |
| Env Variable | ✅ | ✅ | 2 | ✅ | ✅ | ✅ |
| Config File | ✅ | ✅ | 3 | ✅ | ||
| Auto-detect | ✅ | ✅ | 4 (Lowest) | ✅ | ✅ | ✅ |
- ✅ Environment variable via installer (Inno Setup)
- ✅ Easy to change through Control Panel
- ✅
--languageparameter for quick testing - ✅ Environment variable for development
- ✅ Environment variable via GPO (Windows)
- ✅ Environment variable via scripts (Linux)
- ✅ Environment variable in Dockerfile
- ✅ Easy to configure via
docker-compose.yml
# Even with environment variable set, parameter takes priority
$env:ZPL2PDF_LANGUAGE = "pt-BR"
ZPL2PDF.exe --language es-ES status
# Result: Message in Spanish$env:ZPL2PDF_LANGUAGE = "fr-FR"
ZPL2PDF.exe status
# Result: Message in French// zpl2pdf.json
{
"language": "de-DE"
}ZPL2PDF.exe status
# Result: Message in German (if no environment variable is set)# Without any configuration, uses system language
ZPL2PDF.exe status
# Result: Message in Windows/Linux system languageA: Use the command setx ZPL2PDF_LANGUAGE "es-ES" in CMD or configure through Control Panel.
A: Yes! Use export ZPL2PDF_LANGUAGE="pt-BR" and add to ~/.bashrc to make it permanent.
A: No. Environment variable has higher priority than configuration file.
A: Yes! Use the --language parameter for temporary override:
ZPL2PDF.exe --language en-US status
ZPL2PDF.exe --language es-ES -helpA: We recommend setting the user environment variable during installation, based on the language chosen by the user in the installer.
A: The system will fall back to the next priority level. If all fail, it defaults to English (en-US).
A: Yes! Add a new Messages.{culture}.resx file in the Resources/ folder with translations, and the language will be automatically supported.
Solution:
- Windows: Close and reopen terminal/command prompt
- Linux: Run
source ~/.bashrcor open a new terminal
Solution:
- Verify that
zpl2pdf.jsonfile is in the same folder as the executable - Verify that JSON is valid (no syntax errors)
- Check if there's an environment variable set (has higher priority)
Solution:
- On Windows: Use PowerShell or terminal with UTF-8 support
- Configure terminal encoding:
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 - On Linux: Ensure locale is properly configured:
sudo dpkg-reconfigure locales
Solution:
- Install proper fonts that support CJK characters
- Windows: Usually works by default
- Linux: Install
fonts-noto-cjkor similar package
Each user can have their own language preference:
# User 1 (Portuguese)
User1> setx ZPL2PDF_LANGUAGE "pt-BR"
# User 2 (Spanish)
User2> setx ZPL2PDF_LANGUAGE "es-ES"Set language for automated builds:
# GitHub Actions
- name: Test in Spanish
env:
ZPL2PDF_LANGUAGE: es-ES
run: ./ZPL2PDF statusapiVersion: apps/v1
kind: Deployment
metadata:
name: zpl2pdf
spec:
template:
spec:
containers:
- name: zpl2pdf
image: zpl2pdf:latest
env:
- name: ZPL2PDF_LANGUAGE
value: "fr-FR"To add a new language:
-
Create resource file:
- Copy
Resources/Messages.en.resx - Rename to
Messages.{culture}.resx(e.g.,Messages.nl-NL.resxfor Dutch)
- Copy
-
Translate strings:
- Open the new
.resxfile - Translate all
<value>tags - Keep parameter placeholders (e.g.,
{0},{1})
- Open the new
-
Add to supported cultures:
- Edit
src/Shared/Localization/LocalizationManager.cs - Add culture code to
IsCultureSupportedmethod
- Edit
-
Test:
ZPL2PDF.exe --language nl-NL status
-
Preserve formatting:
- Keep
{0},{1}parameter placeholders in the same position - Example:
"File processed: {0}"→"Archivo procesado: {0}"
- Keep
-
Keep command names:
- Don't translate:
start,stop,status,run - These are command keywords
- Don't translate:
-
Preserve special characters:
- Keep:
\n,\r,\t(line breaks, tabs) - Example:
"Line 1\nLine 2"→"Línea 1\nLínea 2"
- Keep:
-
Test your translations:
ZPL2PDF.exe --language YOUR-CULTURE -help
- README.md - General documentation
- README.pt.md - Portuguese documentation
- CONTRIBUTING.md - Contribution guide
- Resources/ - Translation files (.resx)
We welcome translations to new languages! To contribute:
- Fork the repository
- Create a new
Messages.{culture}.resxfile - Translate all strings
- Test thoroughly
- Submit a Pull Request
See CONTRIBUTING.md for detailed guidelines.
If you have questions or issues with language configuration:
- 📖 Check this documentation first
- 🐛 Open an issue on GitHub
- 💬 Join our community discussions
Last Updated: January 2025
Version: 2.0.0