Skip to content
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

Fix invalid-$DISPLAY error being non-text #1906

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

nabijaczleweli
Copy link
Contributor

Given

nabijaczleweli@tarta:~$ DISPLAY=komputerek-x40.:0 gnucash
Run 'g --help' to see a full list of available command line options.
Error: could not initialise graphical user interface and option add-price-quotes was not set.
Perhaps you need to set the $DISPLAY environment variable?nabijaczleweli@tarta:~$
we can obviously see the error output isn't a text file.

Half-mechanically updated with

sed -i '/eed to set the $DISPLAY environmen/s/?/?\\n/' $(git grep -l 'eed to set the $DISPLAY environmen')

and then

vi $(git grep -l 'eed to set the $DISPLAY environmen')

@@ -296,7 +296,7 @@ main(int argc, char ** argv)
<< "\n"
// Translators: Do not translate $DISPLAY! It is an environment variable for X11
<< _("Error: could not initialize graphical user interface and option add-price-quotes was not set.\n"
"Perhaps you need to set the $DISPLAY environment variable?");
"Perhaps you need to set the $DISPLAY environment variable?\n");
Copy link

@zopsicle zopsicle Apr 6, 2024

Choose a reason for hiding this comment

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

why not just ?") << "\n"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

weird workaround instead of correct solution, breaks some existing translations

Copy link

Choose a reason for hiding this comment

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

ok

Copy link
Member

Choose a reason for hiding this comment

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

What's weird about @chloekek 's suggestion ? That's perfectly normal c++ and it avoids having to add coded newline characters in translations. Note how line 296 does exactly the same thing.

As for breaking existing translations, so does your proposal 😉 albeit the exact opposite set of translations. You even added fixes for them in your PR.

I'd be tempted to go with @chloekek 's suggestion.

Given
  nabijaczleweli@tarta:~$ DISPLAY=komputerek-x40.:0 gnucash
  Run 'g --help' to see a full list of available command line options.
  Error: could not initialise graphical user interface and option add-price-quotes was not set.
  Perhaps you need to set the $DISPLAY environment variable?nabijaczleweli@tarta:~$
we can obviously see the error output isn't a text file.
@nabijaczleweli
Copy link
Contributor Author

applied

@code-gnucash-org code-gnucash-org merged commit 0796a0e into Gnucash:stable Apr 12, 2024
4 checks passed
@fellen
Copy link
Member

fellen commented Apr 12, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants