|
Revision 1190, 0.7 kB
(checked in by arj..@yirdis.nl, 2 years ago)
|
moved data/ inside gaphor/ package: easier accessible when installed as egg
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
""" |
|---|
| 3 |
Internationalization (i18n) support for Gaphor. |
|---|
| 4 |
|
|---|
| 5 |
Here the _() function is defined that is used to translate text into |
|---|
| 6 |
your native language. |
|---|
| 7 |
""" |
|---|
| 8 |
|
|---|
| 9 |
__all__ = [ '_' ] |
|---|
| 10 |
|
|---|
| 11 |
import os |
|---|
| 12 |
|
|---|
| 13 |
import gettext |
|---|
| 14 |
import pkg_resources |
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
localedir = os.path.join(pkg_resources.get_distribution('gaphor').location, \ |
|---|
| 18 |
'gaphor', 'data', 'locale') |
|---|
| 19 |
|
|---|
| 20 |
try: |
|---|
| 21 |
catalog = gettext.Catalog('gaphor', localedir=localedir) |
|---|
| 22 |
|
|---|
| 23 |
_ = catalog.gettext |
|---|
| 24 |
except IOError, e: |
|---|
| 25 |
|
|---|
| 26 |
def _(s): return s |
|---|
| 27 |
|
|---|