# Translating BTCPay Server
# Why translations matter
Translating BTCPay Server makes it usable for merchants who don't read English, and makes checkout easier for their customers.
# How translations work
Translations are distributed as language packs. Each pack is a JSON file in the translations folder of the btcpayserver-translator (opens new window) repository, one file per language.
Each entry maps the English text to its translation:
"Create invoice": "Créer une facture",
"Invoice {0} has been archived.": "La facture {0} a été archivée.",
The English text is the key. BTCPay Server looks up the text it is about to display and shows the translation if the pack has one. If a string is missing from the pack, the English text is shown instead.
Packs are first generated with machine translation and then corrected by native speakers. We urge native speaker to manage translations for their language on BTCPay Server.
# Full and checkout-only packs
There are two kinds of packs:
- Full packs cover the whole interface: store and server settings, checkout and public pages such as payment requests and pull payments.
- Checkout-only packs cover the invoice checkout page. They are used for languages that do not have a full pack yet. Other pages show in English.
The list of available packs is in the manifest (opens new window) and in Server Settings > Translations on any BTCPay Server instance.
Help wanted
Most packs do not have a maintainer yet, and every checkout-only pack needs native speakers to grow it into a full pack. If you speak one of these languages and can review translations, see Maintaining a language.
# Language codes and text direction
Each pack has one language code, written in the standard BCP 47 (opens new window) form, for example fr-FR, pt-BR, zh-CN or ar. Regional variants of the same language are separate packs, such as pt-BR (Brazil) and pt-PT (Portugal).
BTCPay Server uses the code and text direction of the active pack to set the page language. Browsers and screen readers use this to pronounce the text correctly and to offer translation. Right-to-left languages such as Arabic, Hebrew and Persian are marked in the manifest, and pages using them are displayed right to left.
# Correcting a pack on your own server
Server administrators can correct any installed pack locally without waiting for a change upstream. These corrections are called overrides. They stay in place when the pack is updated. See Backend Translations for installing, selecting and correcting languages on a server.
# Fixing a translation
Corrections that are useful to everyone should be sent to the btcpayserver-translator repository as a pull request.
# From BTCPay Server
If you corrected a string under Server Settings > Translations > Edit > Overrides, select Contribute on GitHub. This opens the language's pack file on GitHub, where you can submit the same correction.
# From GitHub
- Open and fork the translation repository (opens new window).
- Open the translations folder (opens new window) and select the file for your language, for example
french.json. - Find the English text and change the translation next to it.
- Commit your change to a new branch and open a pull request. Describe what you changed.
No tools need to be installed.
# Rules for editing a pack
Do not change the English text. It is the key BTCPay Server uses to find the translation.
Keep placeholders such as
{0}and{1}. They are replaced with values like an invoice ID or an amount. Place them where your language needs them, but do not translate, renumber or remove them."Invoice {0} has been archived.": "La facture {0} a été archivée.", "Invoice {0} has been archived.": "{0} の請求書がアーカイブされました。",Keep HTML tags such as
<code>,<strong>and links around the matching words.Keep product and network names as they are: BTCPay Server, Bitcoin, Lightning, LNURL.
Keep the JSON valid. Escape quotes inside a translation as
\".Do not add, remove or rename entries by hand, except
_maintainer(see below). The list of entries is kept in sync with BTCPay Server by the translator tool.Do not edit
manifest.json. It is regenerated after merge.Do not reorder entries. The translator tool sorts them.
# Maintaining a language
Each pack can have a maintainer who speaks the language and reviews changes to it. Maintainers are listed in the first entries of the pack:
"_maintainer": "yourname|https://github.com/yourname",
"_source": "https://github.com/yourname/your-translation-project",
_maintainer is your name or GitHub handle, a |, and a link to your profile. _source is optional and points to where the translation originally came from. Entries starting with _ are not translations and are kept when the pack is updated.
To maintain a pack that has no maintainer, open a pull request that adds a _maintainer entry. As a maintainer you are asked to review pull requests for your language and to check new strings after each pack update.
# Requesting a language
If your language is not available, or only has a checkout-only pack, open an issue (opens new window) in the btcpayserver-translator repository. Say whether you can review the translation.
# When changes reach servers
- A pull request changing a pack is merged.
- The manifest is regenerated automatically. It lists every pack with its language code, text direction, maintainer and a checksum of the file.
- BTCPay Server checks the manifest periodically. When a pack it has installed has changed, Server Settings > Translations shows an Update button.
No BTCPay Server release is required.
# Updating packs with the translator
New BTCPay Server releases add and remove strings. Packs are kept in sync with the translator command-line tool in the btcpayserver-translator repository. This section is for maintainers and developers. Fixing a translation does not require it.
# Requirements
- The .NET SDK (opens new window).
- An OpenRouter (opens new window) API key, set as
OPENROUTER_API_KEYin a.envfile. See the translator README (opens new window). - A local BTCPay Server running in development mode. Some strings, such as those of the email and webhook features, are only known to a running server. Updating without one would remove them from the packs.
# Updating
Run commands from the Translator folder. Use the address your local BTCPay Server runs on:
# Update one language
dotnet run -- update --language fr-FR --btcpay-url https://localhost:14142
# Update several languages
dotnet run -- batch-update --languages fr-FR es-ES de-DE --btcpay-url https://localhost:14142 --continue-on-error
# Update every pack
dotnet run -- update-all --btcpay-url https://localhost:14142 --continue-on-error
Updating translates strings that are new in BTCPay Server, removes strings that no longer exist and keeps everything else, including _maintainer and _source. Language codes must be given in full, for example fr-FR rather than fr. dotnet run -- list-languages shows the supported codes.
A string can fail to translate, for example when the result loses a placeholder or an HTML tag. Failed strings are left out of the pack and listed in the output. Running the update again retries them.
# Before opening a pull request
dotnet run -- validate-packs
This checks every pack for invalid JSON, missing placeholders, broken HTML and invalid maintainer entries. Fix any new issues it reports.
Then review the changes. In each pack, the number of removed strings should match the strings removed from BTCPay Server. Commit only the files in translations. Do not run generate-manifest.
The first update of a pack after the tool started sorting entries reorders the whole file. This happens once.
# Get help, ask questions
If you have any questions about translating, join the #Translations channel (opens new window) on Mattermost.
← Design Miscellaneous →