1

I've developed a program for the App Developer Showdown, with quickly, in python, and it works as expected when I package and install it normally -in /usr. However when packaged for installation in /opt it doesn't run -and I'm not getting (or can't find) an error message of any sort, as to what the problem might be. I was wondering if someone here has the answer.

The app does require root access -using gksudo- to function.

Application:

  • Could you share your solution with how you got quickly to create the share/locale link? – Ian B. Jul 9 '12 at 14:01
  • @user75704 The answer I added below should help you. – Sam Hewitt Jul 12 '12 at 2:20
1

If you remove the gksudo stuff in bin/aplomb you see the error message:

Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/aplomb/bin/aplomb", line 48, in <module>
    import aplomb
  File "/opt/extras.ubuntu.com/aplomb/aplomb/__init__.py", line 26, in <module>
    from aplomb import AplombWindow
  File "/opt/extras.ubuntu.com/aplomb/aplomb/AplombWindow.py", line 23, in <module>
    locale.bindtextdomain('aplomb', '/opt/extras.ubuntu.com/aplomb/share/locale')
NameError: name 'locale' is not defined
  • That led me to solving my problem, thanks! Only to allow me to find another... – Sam Hewitt Jun 29 '12 at 4:19
1

Adding these lines to the necessary files should solve your locale problems.

import locale

TEXTDOMAIN = 'yourapp'
LOCALEDIR = '/opt/extras.ubuntu.com/yourapp/share/locale'
#LOCALEDIR = '/usr/yourapp/share/locale'
from locale import gettext as _
locale.bindtextdomain(TEXTDOMAIN, LOCALEDIR)
locale.textdomain(TEXTDOMAIN)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.