Skip to content

Conversation

jonasschnelli
Copy link
Contributor

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

}

// try to i18n the string
if (translate)
strStatusBar = _(strStatusBar.c_str());
Copy link
Member

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bother keeping?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to keep the info string on the overview page i18n'ed while avoiding translation on RPC level (check the screen):

bildschirmfoto 2015-11-30 um 14 45 39

Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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

@maflcko
Copy link
Member

maflcko commented Nov 30, 2015

Concept ACK

@jonasschnelli jonasschnelli changed the title [Qt] Don't translate GetWarnings() for RPC responses [Qt] Don't translate GetWarnings() Nov 30, 2015
@jonasschnelli jonasschnelli changed the title [Qt] Don't translate GetWarnings() [Qt] Don't translate warning messages Nov 30, 2015
@jonasschnelli
Copy link
Contributor Author

Updated. Remove translations for GetWarnings() entirely. Will also remove the translation of the GUI warning string in the overview page.

bildschirmfoto-2015-11-30-um-16 56 01

@@ -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";
Copy link
Member

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.

Copy link
Member

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.

@laanwj
Copy link
Member

laanwj commented Nov 30, 2015

utACK Yeah, this is also better with regard to Google-ability of the errors

@jonasschnelli
Copy link
Contributor Author

Added a commit that makes the warnings label selectable (allow to copy text either with context menu or Ctrl-C).

@paveljanik
Copy link
Contributor

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.

@jonasschnelli
Copy link
Contributor Author

@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).

@paveljanik
Copy link
Contributor

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.

@laanwj
Copy link
Member

laanwj commented Dec 1, 2015

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.

@laanwj
Copy link
Member

laanwj commented Dec 1, 2015

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.

@laanwj
Copy link
Member

laanwj commented Dec 1, 2015

See #7141

@laanwj laanwj closed this Dec 1, 2015
laanwj added a commit to laanwj/bitcoin that referenced this pull request Dec 1, 2015
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.
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Localization bug w/ unicode in debug console
4 participants