# # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # import sys from os.path import abspath, dirname, join, pardir sys.path.insert(0, join(dirname(__file__), pardir, "plugin")) # here we define the path constants so that other modules can use it. # this allows us to get access to the shared files without having to # know the actual location, we just use the location of the current # file and use paths relative to that. SHARED_FILES = abspath(join(dirname(__file__), pardir, pardir)) LOCALE_PATH = join('/usr', 'share', 'locale') RESOURCE_PATH = join(SHARED_FILES, 'res') # the name of the gettext domain. because we have our translation files # not in a global folder this doesn't really matter, setting it to the # application name is a good idea tough. GETTEXT_DOMAIN = 'time-slider' # set up the gettext system and locales import gettext import locale locale.setlocale(locale.LC_ALL, '') gettext.bindtextdomain(GETTEXT_DOMAIN, LOCALE_PATH) gettext.textdomain(GETTEXT_DOMAIN) # register the gettext function for the whole interpreter as "_" import __builtin__ __builtin__._ = gettext.gettext