Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question
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
up vote 1 down vote accepted

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

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

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

import locale

TEXTDOMAIN = 'yourapp'
LOCALEDIR = '/opt/'
#LOCALEDIR = '/usr/yourapp/share/locale'
from locale import gettext as _
locale.bindtextdomain(TEXTDOMAIN, LOCALEDIR)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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