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

An unhandled exception has occurred! on cheatsheet #994

Closed
Mte90 opened this issue Jan 14, 2022 · 4 comments
Closed

An unhandled exception has occurred! on cheatsheet #994

Mte90 opened this issue Jan 14, 2022 · 4 comments
Labels
Milestone

Comments

@Mte90
Copy link
Contributor

Mte90 commented Jan 14, 2022

Traceback (most recent call last):
  File "/usr/share/manuskript/manuskript/ui/cheatSheet.py", line 162, in linkHovered
    QToolTip.showText(QCursor.pos(), Ref.tooltip(link))
  File "/usr/share/manuskript/manuskript/models/references.py", line 519, in tooltip
    return qApp.translate("references", "World: <b>{name}</b>{path}").format(
KeyError: 'nome'
CRITICAL> An unhandled exception has occurred!
Traceback (most recent call last):
  File "/usr/share/manuskript/manuskript/ui/cheatSheet.py", line 162, in linkHovered
    QToolTip.showText(QCursor.pos(), Ref.tooltip(link))
  File "/usr/share/manuskript/manuskript/models/references.py", line 519, in tooltip
    return qApp.translate("references", "World: <b>{name}</b>{path}").format(
KeyError: 'nome'

I am using manuskript in italian and nome means name maybe there are some localization issues?

@Mte90
Copy link
Contributor Author

Mte90 commented Jan 14, 2022

The issue is in the Italian localization:
immagine

I already fixed the issue on weblate :-)

@Mte90
Copy link
Contributor Author

Mte90 commented Jan 14, 2022

Italian localization downloaded and qm file generated and now is not crashing anymore.
With the next update I guess that the issue will gone (I checked also for similar issues in italian and I didn't found anything else).

@TheJackiMonster
Copy link
Collaborator

Maybe we should add some exception handling around the Qt translate() call. It's very unfortunate that Qt handles a lot of things just by throwing exceptions during runtime. ^^'

Thank you for looking into it and providing a fix.

@TheJackiMonster TheJackiMonster added this to the 0.14.0 milestone Jan 14, 2022
@TheJackiMonster
Copy link
Collaborator

Okay, I added (a33249f) a function to safely use the translate() functionality of Qt and catching errors just in case. So the app should not crash anymore because of problems with the translations but put in the original English values from the code instead.

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

No branches or pull requests

2 participants