Document translator, translates excel and powerpoint.
1.0K
Document Translator - An Azure-powered web application that translates Excel spreadsheets and PowerPoint presentations between languages while preserving formatting, animations, and structure.
Supported Formats:
# Pull the latest image
docker pull jtenorio/document-translator:latest
# Run with your Azure Translator API key
docker run -d -p 8080:8080 \
-e TranslationSettings__ApiKey="YOUR_AZURE_TRANSLATOR_API_KEY" \
--name document-translator \
jtenorio/document-translator:latest
Access the application at http://localhost:8080
Upload Excel (.xlsx, .xls) or PowerPoint (.pptx) files for translation!
Create a docker-compose.yml file:
version: '3.8'
services:
document-translator:
image: jtenorio/document-translator:latest
container_name: document-translator
restart: unless-stopped
ports:
- "8080:8080"
environment:
- TranslationSettings__ApiKey=${TRANSLATOR_API_KEY}
- TranslationSettings__Region=eastus2
- TranslationSettings__SourceLanguage=auto
- TranslationSettings__TargetLanguage=en
Create a .env file:
TRANSLATOR_API_KEY=your-azure-translator-api-key-here
Run:
docker compose up -d
Configure the application using environment variables:
| Variable | Required | Default | Description |
|---|---|---|---|
TranslationSettings__ApiKey | ? Yes | - | Azure Translator API key |
TranslationSettings__Region | No | eastus2 | Azure region (e.g., eastus2, westus2) |
TranslationSettings__SourceLanguage | No | auto | Source language code (e.g., es, en, fr, or auto for auto-detect) |
TranslationSettings__TargetLanguage | No | en | Target language code (e.g., en, es, de) |
TranslationSettings__BatchSize | No | 100 | Cells/paragraphs per API call (optimize for performance) |
TranslationSettings__BatchDelayMilliseconds | No | 100 | Delay between batches (ms) |
AllowedHosts | No | * | Allowed host headers (semicolon-separated) |
ASPNETCORE_ENVIRONMENT | No | Production | Environment (Production/Development) |
To specify proper nouns that should not be translated, use a JSON array:
docker run -d -p 8080:8080 \
-e TranslationSettings__ApiKey="YOUR_API_KEY" \
-e TranslationSettings__ProperNouns__0="Carlos" \
-e TranslationSettings__ProperNouns__1="Maria" \
-e TranslationSettings__ProperNouns__2="YourCompanyName" \
jtenorio/document-translator:latest
Supported languages include:
auto - Auto-detect (source language only)en - Englishes - Spanishfr - Frenchde - Germanit - Italianpt - Portugueseja - Japaneseko - Koreanzh-Hans - Chinese (Simplified)zh-Hant - Chinese (Traditional)ar - Arabicru - Russianhi - Hindinl - Dutchpl - Polishtr - Turkishvi - Vietnameseth - ThaiSee Azure Translator Language Support for the complete list.
For production deployments, use a reverse proxy (Nginx, Apache, Traefik) for HTTPS termination and load balancing.
Enable reverse proxy mode when deploying behind a proxy:
version: '3.8'
services:
document-translator:
image: jtenorio/document-translator:latest
container_name: document-translator
restart: unless-stopped
environment:
- TranslationSettings__ApiKey=${TRANSLATOR_API_KEY}
- ReverseProxy__Enabled=true
- ReverseProxy__KnownNetworks=172.17.0.0/16
- AllowedHosts=yourdomain.com;*.yourdomain.com
networks:
- backend
expose:
- "8080"
nginx:
image: nginx:alpine
container_name: nginx-proxy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
networks:
- backend
depends_on:
- document-translator
networks:
backend:
driver: bridge
| Variable | Default | Description |
|---|---|---|
ReverseProxy__Enabled | false | Enable reverse proxy mode |
ReverseProxy__KnownNetworks | (empty) | Trusted proxy networks (CIDR notation, comma-separated) |
ReverseProxy__KnownProxies | (empty) | Trusted proxy IPs (comma-separated) |
ReverseProxy__ForwardLimit | 1 | Number of proxies to trust |
ReverseProxy__ForwardedForHeaderName | X-Forwarded-For | Header name for client IP |
Create nginx.conf:
upstream document_translator {
server document-translator:8080;
}
server {
listen 443 ssl http2;
server_name translate.yourdomain.com;
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
location / {
proxy_pass http://document_translator;
proxy_http_version 1.1;
# Required for Blazor Server SignalR
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Forwarded headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
# Timeouts for long translations
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
# File upload support
client_max_body_size 50M;
}
}
server {
listen 80;
server_name translate.yourdomain.com;
return 301 https://$server_name$request_uri;
}
When ReverseProxy__Enabled=true:
Important: Only trust proxies you control!
Always specify trusted proxies in production:
ReverseProxy__KnownNetworks=172.17.0.0/16
Set AllowedHosts to your domain:
AllowedHosts=yourdomain.com;*.yourdomain.com
Never expose port 8080 publicly - Only to the proxy
Use HTTPS at the proxy - Free with Let's Encrypt
docker run -d -p 3000:8080 \
-e TranslationSettings__ApiKey="YOUR_API_KEY" \
jtenorio/document-translator:latest
Access at http://localhost:3000
docker run -d -p 8080:8080 \
-v $(pwd)/logs:/app/logs \
-e TranslationSettings__ApiKey="YOUR_API_KEY" \
jtenorio/document-translator:latest
docker run -d -p 8080:8080 \
-e TranslationSettings__ApiKey="YOUR_API_KEY" \
-e ASPNETCORE_ENVIRONMENT=Development \
jtenorio/document-translator:latest
jtenorio/document-translatormcr.microsoft.com/dotnet/runtime-deps:8.0-alpinelatest - Latest stable release (v2.0+ with PowerPoint support)2.0.0 - Version 2.0 (PowerPoint support added)2.0 - Major.minor version1.0.0 - Version 1.0 (Excel only - deprecated)# Pull specific version
docker pull jtenorio/document-translator:2.0.0
# Pull latest (recommended)
docker pull jtenorio/document-translator:latest
The image includes a built-in health check:
# Check container health
docker inspect --format='{{.State.Health.Status}}' document-translator
Manual health check:
curl http://localhost:8080/
# View all logs
docker logs document-translator
# Follow logs in real-time
docker logs -f document-translator
# View last 100 lines
docker logs --tail 100 document-translator
Cause: Missing or invalid API key
Solution: Verify the TranslationSettings__ApiKey environment variable
docker logs document-translator
Solution: Check if container is running
docker ps
docker port document-translator
Cause: Invalid API key or region
Solution: Verify your Azure Translator credentials
# Test with correct region
docker run -d -p 8080:8080 \
-e TranslationSettings__ApiKey="YOUR_API_KEY" \
-e TranslationSettings__Region="eastus2" \
jtenorio/document-translator:latest
Cause: File too large
Solution: Increase reverse proxy body size limit (if using proxy)
# In nginx.conf
client_max_body_size 50M;
# Pull latest image
docker pull jtenorio/document-translator:latest
# Stop and remove old container
docker stop document-translator
docker rm document-translator
# Run new version
docker run -d -p 8080:8080 \
-e TranslationSettings__ApiKey="YOUR_API_KEY" \
--name document-translator \
jtenorio/document-translator:latest
# Pull latest and restart
docker compose pull
docker compose up -d
Never hardcode API keys in configuration files:
# Good - use environment variables
docker run -d -p 8080:8080 \
-e TranslationSettings__ApiKey="${TRANSLATOR_API_KEY}" \
jtenorio/document-translator:latest
# Docker Compose with network isolation
services:
document-translator:
image: jtenorio/document-translator:latest
networks:
- internal
expose:
- "8080" # Don't publish to host
For production, use Docker secrets or external secret management:
# Using Docker secrets
docker secret create translator_api_key api_key.txt
docker service create \
--secret translator_api_key \
-e TranslationSettings__ApiKey_File=/run/secrets/translator_api_key \
jtenorio/document-translator:latest
# Check for updates regularly
docker pull jtenorio/document-translator:latest
See the GitHub repository for license information.
Made with .NET by Darth Seldon | Because even the Dark Side needs multilingual documents!
Content type
Image
Digest
sha256:edba1adff…
Size
116.9 MB
Last updated
11 months ago
docker pull jtenorio/document-translator