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 created an application using quickly create ubuntu-application myapp. Then I created translations and created deb package quickly package to install and test it. When I run myapp all strings from glade files were translated but all strings from code were not translated. What's this? How to solve this problem ?

share|improve this question
up vote 2 down vote accepted

I've solved this. I must use locale.gettext instead of gettext. I don't know what the difference is, but it works.

share|improve this answer

In your code, you need to mark all your strings for translation by enclosing them in _(). E.g.:

import gettext
from gettext import gettext as _

some_string = 'This is not a translatable string'
some_other_string = _('This is a translatable string')

Notice the gettext statements above, which Quickly puts in each source file. You'll need to add them to any source file that contains translatable strings.

share|improve this answer
Yes I add it but it's no result – Denis Kovalskiy Jul 13 '12 at 9:11
In that case, please be more detailed in your question. It might be useful to post the code online to I or someone else can have a look at it and better be able to help rather than guessing. You might find this useful:… – David Planella Jul 13 '12 at 9:24
I published code at Launchpad – Denis Kovalskiy Jul 13 '12 at 10:20

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.