Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1# Translation Strings Policy3This document provides guidelines for internationalization of the Bitcoin Core software.5## How to translate?7To mark a message as translatable9- In GUI source code (under `src/qt`): use `tr("...")`11- In non-GUI source code (under `src`): use `_("...")`13No internationalization is used for e.g. developer scripts outside `src`.15## Strings to be translated17On a high level, these strings are to be translated:19- GUI strings, anything that appears in a dialog or window21### GUI strings23Do not translate technical or extremely rare errors.24Anything else that appears to the user in the GUI is to be translated. This includes labels, menu items, button texts, tooltips and window titles.25This includes messages passed to the GUI through the UI interface through `InitMessage`, `ThreadSafeMessageBox` or `ShowProgress`.27## General recommendations29### Avoid unnecessary translation strings31Try not to burden translators with translating messages that are e.g. slight variations of other messages.32In the GUI, avoid the use of text where an icon or symbol will do.33Make sure that placeholder texts in forms do not end up in the list of strings to be translated (use `<string notr="true">`).35### Make translated strings understandable37Try to write translation strings in an understandable way, for both the user and the translator. Avoid overly technical or detailed messages.39### Do not translate internal errors41Do not translate internal errors, log messages, or messages that appear on the RPC interface. If an error is to be shown to the user,42use a translatable generic message, then log the detailed message to the log. E.g., "A fatal internal error occurred, see debug.log for details".43This helps troubleshooting; if the error is the same for everyone, the likelihood is increased that it can be found using a search engine.45### Avoid fragments47Avoid dividing up a message into fragments. Translators see every string separately, so they may misunderstand the context if the messages are not self-contained.49### Avoid HTML in translation strings51There have been difficulties with the use of HTML in translation strings; translators should not be able to accidentally affect the formatting of messages.52This may sometimes be at conflict with the recommendation in the previous section.54### Plurals56Plurals can be complex in some languages. A quote from the gettext documentation:58In Polish we use e.g. plik (file) this way:591 plik,602,3,4 pliki,615-21 pliko'w,6222-24 pliki,6325-31 pliko'w64and so on66In Qt code, use tr's third argument for optional plurality. For example:68tr("%n hour(s)","",secs/HOUR_IN_SECONDS);69tr("%n day(s)","",secs/DAY_IN_SECONDS);70tr("%n week(s)","",secs/WEEK_IN_SECONDS);72This adds `<numerusform>`s to the respective `.ts` file, which can be translated separately depending on the language. In English, this is simply:74<message numerus="yes">75<source>%n active connection(s) to Bitcoin network</source>76<translation>77<numerusform>%n active connection to Bitcoin network</numerusform>78<numerusform>%n active connections to Bitcoin network</numerusform>79</translation>80</message>82Where possible, try to avoid embedding numbers into the flow of the string at all. E.g.,84WARNING: check your network connection, %d blocks received in the last %d hours (%d expected)86versus88WARNING: check your network connection, less blocks (%d) were received in the last %n hours than expected (%d).90The second example reduces the number of pluralized words that translators have to handle from three to one, at no cost to comprehensibility of the sentence.92### String freezes94During a string freeze (often before a major release), no translation strings are to be added, modified or removed.96This can be checked by building the `translate` target with `cmake` ([instructions](translation_process.md)), then verifying that `bitcoin_en.ts` remains unchanged.
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.