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] SyntaxError: name '_' is used prior to global declaration #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sla-subteno-it
Copy link

Before fix, we have this error :
Traceback (most recent call last):
File "/Users/alnslang/.virtualenvs/tests/bin/odoo-sentinel", line 7, in
from odoosentinel import main
File "/Users/alnslang/.virtualenvs/tests/lib/python3.6/site-packages/odoosentinel/init.py", line 87
global _
^
SyntaxError: name '_' is used prior to global declaration

@@ -81,9 +84,6 @@ def __init__(self, stdscr, options):
language = gettext.translation(
I18N_DOMAIN, I18N_DIR, languages=[I18N_DEFAULT])

# Replace global dummy lambda by the translations gettext method
# The install method of gettext doesn't replace the function if exists
global _
_ = language.gettext

Choose a reason for hiding this comment

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

You should move this line too, because the translation method is called on line 67.

@sla-subteno-it
Copy link
Author

@sylvain-garancher is-it ok ?

@Garamotte
Copy link

No, because there is a recursive depdency issue...

I think that we can simply make the Profile not found error message not translateable, as translations need the connection to be established, and this error message is displayed only when the connection could no be established.

@fmdl
Copy link
Contributor

fmdl commented Jul 15, 2018

sylvain cela fait 5 heures que on essaye de résoudre:

    from odoosentinel import main
  File "/Users/florentdelabarre/.virtualenvs/bobbies/lib/python3.6/site-packages/odoosentinel/__init__.py", line 87
    global _
    ^
SyntaxError: name '_' is used prior to global declaration

on comprend rien pour faire marcher ce truc. il y a pas de tuto. un peu pas travailler comme cela. c'est de développer des logiciels, c'est encore mieux quand les autres peuvent s'en servir.

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.

3 participants