~thomas-deruyter-3/qreator/qreator

« back to all changes in this revision

Viewing changes to qreator_lib/helpers.py

  • Committer: David Planella
  • Date: 2012-05-23 12:58:45 UTC
  • mto: This revision was merged to the branch mainline in revision 67.
  • Revision ID: david.planella@ubuntu.com-20120523125845-7589t51mtsj44kjm
Started using the gettext C API (locale module) instead of the Python one (gettext module), so that translations are loaded when installing the app in /opt. See http://askubuntu.com/questions/140552/how-to-make-glade-load-translations-from-opt. Minor whitespace fixes. Removed shebang from QRCode.py to stop Lintian complaining

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from . qreatorconfig import get_data_file
22
22
from . Builder import Builder
23
23
 
24
 
import gettext
25
 
from gettext import gettext as _
26
 
gettext.textdomain('qreator')
 
24
TEXTDOMAIN = 'qreator'
 
25
LOCALEDIR = '/opt/extras.ubuntu.com/qreator/share/locale/'
 
26
import locale
 
27
from locale import gettext as _
 
28
locale.bind_textdomain_codeset(TEXTDOMAIN, LOCALEDIR, 'UTF-8')
 
29
locale.textdomain(TEXTDOMAIN)
27
30
 
28
31
def get_builder(builder_file_name):
29
32
    """Return a fully-instantiated Gtk.Builder instance from specified ui