mirror of
https://github.com/gryf/pygtktalog.git
synced 2026-02-18 23:45:54 +01:00
Added forgotten pot file.
Added i18n into package init. Made some changes in README file.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""
|
||||
Project: pyGTKtalog
|
||||
Description: Initialize for main module - i18n and so.
|
||||
Type: core
|
||||
Author: Roman 'gryf' Dobosz, gryf73@gmail.com
|
||||
Created: 2009-05-05
|
||||
"""
|
||||
import os
|
||||
import locale
|
||||
import gettext
|
||||
import __builtin__
|
||||
|
||||
import gtk.glade
|
||||
|
||||
|
||||
GETTEXT_DOMAIN = 'pygtktalog'
|
||||
# There should be message catalogs in "locale" directory placed by setup.py
|
||||
# script. If there is no such directory, let's assume that message catalogs are
|
||||
# placed in system wide location such as /usr/share/locale by Linux
|
||||
# distribution package maintainer.
|
||||
LOCALE_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)),
|
||||
'locale')
|
||||
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
|
||||
for module in gtk.glade, gettext:
|
||||
if os.path.exists(LOCALE_PATH):
|
||||
module.bindtextdomain(GETTEXT_DOMAIN, LOCALE_PATH)
|
||||
else:
|
||||
module.bindtextdomain(GETTEXT_DOMAIN)
|
||||
module.textdomain(GETTEXT_DOMAIN)
|
||||
|
||||
# register the gettext function for the whole interpreter as "_"
|
||||
__builtin__._ = gettext.gettext
|
||||
|
||||
Reference in New Issue
Block a user