Remove names from translatable strings#20404
Conversation
Command line option name must not be a part of the translatable string, as it is untranslatable by its nature.
RPC name must not be a part of the translatable string, as it is untranslatable by its nature.
Added requirement to do not translate names.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
ACK c20e3db Good idea 👍 |
|
|
||
| if (rescan_height != block_height) { | ||
| error = _("Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)"); | ||
| error = strprintf(_("Prune: last wallet synchronisation goes beyond pruned data. You need to %s (download the whole block chain again in case of pruned node)."), "-reindex"); |
There was a problem hiding this comment.
nit: blockchain vs block chain
There was a problem hiding this comment.
|
If we want to avoid this in the future, would a linter be appropriate? |
|
I understand the idea but… Doesn't this make it much harder for translators to understand what is being translated? A lot of context information goes missing by replacing these with placeholders. |
luke-jr
left a comment
There was a problem hiding this comment.
Concept ACK
Doesn't this make it much harder for translators to understand what is being translated? A lot of context information goes missing by replacing these with placeholders.
Qt lets you specify an additional string seen only by translators for context. Does Transifex support that? Can we add it to our utils too?
| if (strSubVersion.size() > MAX_SUBVERSION_LENGTH) { | ||
| return InitError(strprintf(_("Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments."), | ||
| strSubVersion.size(), MAX_SUBVERSION_LENGTH)); | ||
| return InitError(strprintf(_("Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of %s."), |
There was a problem hiding this comment.
| return InitError(strprintf(_("Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of %s."), | |
| return InitError(strprintf(_("Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of %s options."), |
|
|
||
| The following tokens must not be parts of the strings are to be translated: | ||
| - command line option names | ||
| - RPC names |
There was a problem hiding this comment.
| - RPC names | |
| - RPC method and parameter names |
| return InitError(strprintf(_("Prune mode is incompatible with %s."), "-txindex")); | ||
| } | ||
| if (!g_enabled_filter_types.empty()) { | ||
| return InitError(_("Prune mode is incompatible with -blockfilterindex.")); | ||
| return InitError(strprintf(_("Prune mode is incompatible with %s."), "-blockfilterindex")); |
There was a problem hiding this comment.
Should we combine these (like ResolveErrMsg)?
|
|
||
| if (args.IsArgSet("-proxy") && args.GetArg("-proxy", "").empty()) { | ||
| return InitError(_("No proxy server specified. Use -proxy=<ip> or -proxy=<ip:port>.")); | ||
| return InitError(strprintf(_("No proxy server specified. Use %s or %s."), "-proxy=<ip>", "-proxy=<ip:port>")); |
There was a problem hiding this comment.
It might make sense to translate the =<ip:port> parts?
| return InitError(strprintf(_("Invalid %s address or hostname: '%s'"), "-proxy", proxyArg)); | ||
| } | ||
|
|
||
| proxyType addrProxy = proxyType(proxyAddr, proxyRandomize); | ||
| if (!addrProxy.IsValid()) | ||
| return InitError(strprintf(_("Invalid -proxy address or hostname: '%s'"), proxyArg)); | ||
| if (!addrProxy.IsValid()) { | ||
| return InitError(strprintf(_("Invalid %s address or hostname: '%s'"), "-proxy", proxyArg)); |
There was a problem hiding this comment.
Another candidate for combining
| return InitError(strprintf(_("Invalid %s address or hostname: '%s'"), "-onion", onionArg)); | ||
| } | ||
| proxyType addrOnion = proxyType(onionProxy, proxyRandomize); | ||
| if (!addrOnion.IsValid()) | ||
| return InitError(strprintf(_("Invalid -onion address or hostname: '%s'"), onionArg)); | ||
| if (!addrOnion.IsValid()) { | ||
| return InitError(strprintf(_("Invalid %s address or hostname: '%s'"), "-onion", onionArg)); |
| if (feeCalc.reason == FeeReason::FALLBACK && !m_allow_fallback_fee) { | ||
| // eventually allow a fallback fee | ||
| error = _("Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee."); | ||
| error = strprintf(_("Fee estimation failed. %s is disabled. Wait a few blocks or enable %s."), "-fallbackfee", "-fallbackfee"); |
There was a problem hiding this comment.
First one should probably be translated...
| CAmount nFeePerK = 0; | ||
| if (!ParseMoney(gArgs.GetArg("-discardfee", ""), nFeePerK)) { | ||
| error = strprintf(_("Invalid amount for -discardfee=<amount>: '%s'"), gArgs.GetArg("-discardfee", "")); | ||
| error = strprintf(_("Invalid amount for %s=<amount>: '%s'"), "-discardfee", gArgs.GetArg("-discardfee", "")); |
|
|
||
| if (rescan_height != block_height) { | ||
| error = _("Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)"); | ||
| error = strprintf(_("Prune: last wallet synchronisation goes beyond pruned data. You need to %s (download the whole block chain again in case of pruned node)."), "-reindex"); |
|
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
I understand your concerns. Yes, translators will lose some part of context with this approach. Line 1200 in 7d8a10a just spotted the following translation:
Does answering those questions resolve translators' lack of context? |
Not really—in the sense that it's not a scalable approach, and also many will not ask and just assume something (often wrongly). |
Qt files are not mentioned, unfortunately. |
|
Closing for now. Leaving up for grabs. |

This PR removes the following tokens from translatable strings:
All of them are untranslatable by their nature.
The Translation Strings Policy updated accordingly.
This was done while reviewing #20401. Good to get it just after 0.21 branch off :)