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
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
4006 | + strStatusBar = strRPC = "Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade."; 4007 | } 4008 | 4009 | + // try to i18n the string 4010 | + if (translate) 4011 | + strStatusBar = _(strStatusBar.c_str());
Does this even work after translation update? I assume this at least does not translate anymore when any of the stings get changed?
Why bother keeping?
We might want to keep the info string on the overview page i18n'ed while avoiding translation on RPC level (check the screen):
<img width="938" alt="bildschirmfoto 2015-11-30 um 14 45 39" src="https://cloud.githubusercontent.com/assets/178464/11473588/8e036990-9773-11e5-8180-be395c77789c.png">
Imo, you can't do this. The translations will go away.
You could try make translate in /src and make the screenshot again. I am assuming it will show English.
The translations will go away.
Hmm... what exactly do you mean with this?
If I'm right, strStatusBar = _(strStatusBar.c_str()); should translate the string if possible, and if not, keep the existing string. Future changes of the original string or of translations should not be a problem.
Or am I blind somewhere?
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.
@jonasschnelli Try
cd src
make translate
cd ..
make
src/qt/bitcoin-qt -regtest -lang=pl_PL&
screenshot
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.
I'd say just remove the translations of warnings/error messages completely.
just copy the message, or use a similar message.
+1
Concept ACK
Updated. Remove translations for GetWarnings() entirely. Will also remove the translation of the GUI warning string in the overview page.

3980 | @@ -3981,7 +3981,7 @@ std::string GetWarnings(const std::string& strFor) 3981 | string strRPC; 3982 | 3983 | if (!CLIENT_VERSION_IS_RELEASE) 3984 | - strStatusBar = _("This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"); 3985 | + strStatusBar = "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications";
It seems this is not copy-paste able in the qt client. I imagine those would be hard to translate for some users.
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: I think it's okay to show a beta warning in english. Also in very rare situations where a large fork has found, i think it's even better to show this in english. People will be concerned and might look up the error string somewhere (or past in on forumrs/IRC).
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.
But I do not agree with seeing an English sentence on the otherwise German application.
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. There are already translations so having them get lost is a bit of a waste. Going to submit an alternative solution for this in a bit.