Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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 _
gettext.textdomain('yourappname')

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: askubuntu.com/questions/154129/… –  David Planella Jul 13 '12 at 9:24
    
I published code at Launchpad bazaar.launchpad.net/~denimnumber1/quickly-ide/trunk/files –  Denis Kovalskiy Jul 13 '12 at 10:20

Your Answer

 
discard

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.