| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A .NET 10 command-line tool for translating PO/POT files using Google Translate, DeepL, or AI providers.
dotnet run --project .scripts/PoTranslator.Console -- \
--provider <provider> \
--lang <language-code> \
--po-source <source-directory> \
--po-dest <destination-directory>| Option | Required | Description |
|---|---|---|
| --provider | Yes | Translation provider (see below) |
| --lang | Yes | Target language code (e.g., fr, it, es, de) |
| --po-source | Yes | Directory containing source .po or .pot files |
| --po-dest | Yes | Directory where translated .po files will be saved |
| --api-key | No | API key (can also be set via environment variables) |
| --model | No | Override the default AI model |
| --credentials | No | Path to Google service account JSON file |
| --project-id | No | Google Cloud project ID |
Uses the Google Cloud Translation API v2 with service account credentials.
Setup:
Usage:
# Option 1: Pass credentials path
dotnet run -- --provider google-service-account --lang fr \
--credentials ./google-credentials.json \
--po-source ./source --po-dest ./output
# Option 2: Use environment variable
export GOOGLE_APPLICATION_CREDENTIALS="./google-credentials.json"
dotnet run -- --provider google-service-account --lang fr \
--po-source ./source --po-dest ./outputUses the Google Cloud Translation API v2 with a simple API key. Easier to set up than a service account.
Setup:
Usage:
# Option 1: Pass API key directly
dotnet run -- --provider google-api-key --lang fr \
--api-key YOUR_GOOGLE_API_KEY \
--po-source ./source --po-dest ./output
# Option 2: Use environment variable
export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"
dotnet run -- --provider google-api-key --lang fr \
--po-source ./source --po-dest ./outputUses the DeepL Translation API. The SDK automatically routes requests to the free (api-free.deepl.com) or pro (api.deepl.com) endpoint based on the key — free-tier keys end with :fx.
Setup:
Usage:
# Option 1: Pass API key directly
dotnet run -- --provider deepl --lang fr \
--api-key YOUR_DEEPL_API_KEY \
--po-source ./source --po-dest ./output
# Option 2: Use environment variable
export DEEPL_API_KEY="YOUR_DEEPL_API_KEY"
dotnet run -- --provider deepl --lang fr \
--po-source ./source --po-dest ./outputNote: DeepL requires specific language codes for some languages. For English use EN-US or EN-GB; for Portuguese use PT-BR or PT-PT; for Chinese use ZH-HANS or ZH-HANT.
Uses the OpenAI API directly. Default model: gpt-4.1-nano.
Setup:
Usage:
# Option 1: Pass API key directly
dotnet run -- --provider openai --lang fr \
--api-key YOUR_OPENAI_API_KEY \
--po-source ./source --po-dest ./output
# Option 2: Use environment variable
export OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
dotnet run -- --provider openai --lang fr \
--po-source ./source --po-dest ./output
# Option 3: Use a different model
dotnet run -- --provider openai --lang fr \
--model gpt-4.1 \
--po-source ./source --po-dest ./outputUses the Anthropic Messages API directly. Default model: claude-sonnet-4-5-20250514.
Setup:
Usage:
# Option 1: Pass API key directly
dotnet run -- --provider anthropic --lang fr \
--api-key YOUR_ANTHROPIC_API_KEY \
--po-source ./source --po-dest ./output
# Option 2: Use environment variable
export ANTHROPIC_API_KEY="YOUR_ANTHROPIC_API_KEY"
dotnet run -- --provider anthropic --lang fr \
--po-source ./source --po-dest ./output
# Option 3: Use a different model
dotnet run -- --provider anthropic --lang fr \
--model claude-haiku-4-5-20241022 \
--po-source ./source --po-dest ./outputUses GitHub Models, available to GitHub Copilot subscribers. Supports models from OpenAI, Anthropic, Google, and more. Default model: gpt-4.1-nano.
Setup:
Usage:
# Option 1: Pass token directly
dotnet run -- --provider github-models --lang fr \
--api-key YOUR_GITHUB_TOKEN \
--po-source ./source --po-dest ./output
# Option 2: Use environment variable
export GITHUB_TOKEN="YOUR_GITHUB_TOKEN"
dotnet run -- --provider github-models --lang fr \
--po-source ./source --po-dest ./output
# Option 3: Use a different model (e.g., Claude via GitHub Models)
dotnet run -- --provider github-models --lang fr \
--model claude-sonnet-4-5-20250514 \
--po-source ./source --po-dest ./outputUses OpenRouter as a unified gateway to 290+ models including Claude, GPT, Gemini, Grok, and more. Default model: anthropic/claude-sonnet-4-5-20250514.
Setup:
Usage:
# Option 1: Pass API key directly
dotnet run -- --provider openrouter --lang fr \
--api-key YOUR_OPENROUTER_API_KEY \
--po-source ./source --po-dest ./output
# Option 2: Use environment variable
export OPENROUTER_API_KEY="YOUR_OPENROUTER_API_KEY"
dotnet run -- --provider openrouter --lang fr \
--po-source ./source --po-dest ./output
# Option 3: Use a specific model (see https://openrouter.ai/models)
dotnet run -- --provider openrouter --lang fr \
--model google/gemini-2.5-flash \
--po-source ./source --po-dest ./outputAutomated scripts that extract PO files from the OrchardCore source tree and translate them in one step.
# Translate to French using Google service account (default)
./translate.ps1
# Translate to Italian using Anthropic Claude
./translate.ps1 -Provider anthropic -Lang it -ApiKey YOUR_KEY
# Translate using a specific model
./translate.ps1 -Provider openai -Lang es -ApiKey YOUR_KEY -Model gpt-4.1# Translate to French using Google service account (default)
./translate.sh
# Translate to Italian using Anthropic Claude
./translate.sh anthropic it YOUR_KEY
# Translate using a specific model
./translate.sh openai es YOUR_KEY gpt-4.1| Back | FazBrowse Home | New Git URL |