-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Remove names from translatable strings #20404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 👍 |
@@ -4041,7 +4041,7 @@ std::shared_ptr<CWallet> CWallet::Create(interfaces::Chain& chain, const std::st | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: blockchain vs block chain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't optech
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
@@ -1416,16 +1420,16 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA | |||
} | |||
strSubVersion = FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, uacomments); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we combine these (like ResolveErrMsg
)?
@@ -1197,7 +1201,7 @@ bool AppInitParameterInteraction(const ArgsManager& args) | |||
nMaxTipAge = args.GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE); | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
combine
@@ -2961,7 +2961,7 @@ bool CWallet::CreateTransactionInternal( | |||
nFeeNeeded = GetMinimumFee(*this, nBytes, coin_control, &feeCalc); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First one should probably be translated...
@@ -3935,7 +3935,7 @@ std::shared_ptr<CWallet> CWallet::Create(interfaces::Chain& chain, const std::st | |||
if (gArgs.IsArgSet("-discardfee")) { | |||
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", "")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message seems reusable
@@ -4041,7 +4041,7 @@ std::shared_ptr<CWallet> CWallet::Create(interfaces::Chain& chain, const std::st | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't optech
🐙 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 :)