Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tagettext.py
blob: ebeebb364b5d13b01997a16e284e5ce3fe2c5c32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-
# Copyright (c) 2010-11 Walter Bender, Martin Langhoff
# License: GPLv2

# Defines the magic global _() with the right params so all modules
# can use it.
#
# Plugins that want to override MUST use a different technique. See
# the developer notes in the TA wikipage.
#
import gettext
import os

# In a git checkout, locale is in the root of the project
# so one dir "up" from tagettext.py
localedir = os.path.join(os.path.dirname(os.path.dirname(__file__)),
                          'locale' )

if os.path.exists(localedir):
    # works from a git checkout
    gettext.install('org.laptop.TurtleArtActivity', localedir)
else:
    # fallback for packaged TA (rpm, xo)
    gettext.install('org.laptop.TurtleArtActivity')