-
Notifications
You must be signed in to change notification settings - Fork 37.8k
[Qt] Don't translate warning messages #7134
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
[Qt] Don't translate warning messages #7134
Conversation
} | ||
|
||
// try to i18n the string | ||
if (translate) | ||
strStatusBar = _(strStatusBar.c_str()); |
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.
Does this even work after translation update? I assume this at least does not translate anymore when any of the stings get changed?
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.
Why bother keeping?
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.
Imo, you can't do this. The translations will go away.
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.
You could try make translate
in /src
and make the screenshot again. I am assuming it will show English.
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.
Ah. I get you point.
The missing _(<string>)
will prevent the python script from auto-extracting strings-that-require translation. Hmm... right. This is suboptimal.
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.
@jonasschnelli
Try
cd src
make translate
cd ..
make
src/qt/bitcoin-qt -regtest -lang=pl_PL&
screenshot
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.
Yes, you must only pass static strings into _(), otherwise the extraction won't work.
If you must do this, just copy the message, or use a similar message.
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.
I'd say just remove the translations of warnings/error messages completely.
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.
just copy the message, or use a similar message.
+1
Concept ACK |
be565df
to
86e905b
Compare
@@ -3981,7 +3981,7 @@ std::string GetWarnings(const std::string& strFor) | |||
string strRPC; | |||
|
|||
if (!CLIENT_VERSION_IS_RELEASE) | |||
strStatusBar = _("This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"); | |||
strStatusBar = "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"; |
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 seems this is not copy-paste able in the qt client. I imagine those would be hard to translate for some users.
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.
Good idea, let's make it copy/pastable then.
utACK Yeah, this is also better with regard to Google-ability of the errors |
Added a commit that makes the warnings label selectable (allow to copy text either with context menu or Ctrl-C). |
copy&paste: OK. Helps to solve the googlability problem. But I do not agree with seeing an English sentence on the otherwise German application. That calls for more issue coming from our users "This sentence is untranslated". NACK here. |
@paveljanik: |
Especially when some rare case happens, we should explain to user what happened :-) In his preferred language. In my previous life, I was a head of several localization teams and my experience says that having mixed languages in the UI is a way to hell. |
Well in that case this should be solved differently: the core should send a constant error code to the UI for known errors, and the UI converts this into a (translated) text. To be honest I think the whole GetWarnings() mechanism, with errors with priority levels that override each other in confusing ways, and are reported on the to-be-deprecated getinfo. is kind of crappy, see also #7130, so I wouldn't object to a deeper redesign. Edit: but that shouldn't block this pull, which solves a legitimate issue. It's strange to have locale-specific errors returned when the GUI is running and not when bitcoind does. These errors and warnings are, overall, pretty rare so I don't see it as a big problem to have them untranslated for a while. |
Well you know what, let's just duplicate the messages for now. |
See #7141 |
But keep translating them in the GUI. This - necessarily - requires duplication of a few messages. Alternative take on bitcoin#7134, that keeps the translations from being wiped. Also document GetWarnings() input argument. Fixes bitcoin#5895.
Translating RPC response-values seems to be a bad idea. This PR disabled translating of RPC responses when the GUI is enabled/running. The info message in the GUI overview page will no longer be translated.
Fixes #5895