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 ?
Asked
Active
Viewed 132 times
1
Denis Kovalskiy
- 41
- 3
2 Answers
2
I've solved this. I must use locale.gettext instead of gettext. I don't know what the difference is, but it works.
Eliah Kagan
- 116,445
- 54
- 318
- 493
Denis Kovalskiy
- 41
- 3
1
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.
David Planella
- 15,420
- 11
- 77
- 141
-
Yes I add it but it's no result – Denis Kovalskiy Jul 13 '12 at 09: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: http://askubuntu.com/questions/154129/how-can-i-publish-my-project-code-online-so-someone-can-help-me-with-it – David Planella Jul 13 '12 at 09:24
-
I published code at Launchpad http://bazaar.launchpad.net/~denimnumber1/quickly-ide/trunk/files – Denis Kovalskiy Jul 13 '12 at 10:20