| 1 | # -*- coding: utf-8 -*- |
|---|
| 2 | """ |
|---|
| 3 | = Watchlist Plugin for Trac = |
|---|
| 4 | Plugin Website: http://trac-hacks.org/wiki/WatchlistPlugin |
|---|
| 5 | Trac website: http://trac.edgewall.org/ |
|---|
| 6 | |
|---|
| 7 | Copyright (c) 2008-2010 by Martin Scharrer <martin@scharrer-online.de> |
|---|
| 8 | All rights reserved. |
|---|
| 9 | |
|---|
| 10 | The i18n support was added by Steffen Hoffmann <hoff.st@web.de>. |
|---|
| 11 | |
|---|
| 12 | This program is free software: you can redistribute it and/or modify |
|---|
| 13 | it under the terms of the GNU General Public License as published by |
|---|
| 14 | the Free Software Foundation, either version 3 of the License, or |
|---|
| 15 | (at your option) any later version. |
|---|
| 16 | |
|---|
| 17 | This program is distributed in the hope that it will be useful, |
|---|
| 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 20 | GNU General Public License for more details. |
|---|
| 21 | |
|---|
| 22 | For a copy of the GNU General Public License see |
|---|
| 23 | <http://www.gnu.org/licenses/>. |
|---|
| 24 | |
|---|
| 25 | $Id: translation.py 15264 2016-02-11 04:22:34Z rjollos $ |
|---|
| 26 | """ |
|---|
| 27 | |
|---|
| 28 | __url__ = ur"$URL: //trac-hacks.org/svn/watchlistplugin/0.12/tracwatchlist/translation.py $"[6:-2] |
|---|
| 29 | __author__ = ur"$Author: rjollos $"[9:-2] |
|---|
| 30 | __revision__ = int("0" + ur"$Rev: 15264 $"[6:-2].strip('M')) |
|---|
| 31 | __date__ = ur"$Date: 2016-02-11 04:22:34 +0000 (Thu, 11 Feb 2016) $"[7:-2] |
|---|
| 32 | |
|---|
| 33 | # Import translation functions. Fallbacks are provided for Trac 0.11. |
|---|
| 34 | try: |
|---|
| 35 | from trac.util.translation import domain_functions |
|---|
| 36 | add_domain, _, N_, tag_, gettext, ngettext = \ |
|---|
| 37 | domain_functions('watchlist', ('add_domain', '_', 'N_', 'tag_', 'gettext', 'ngettext')) |
|---|
| 38 | i18n_enabled = True |
|---|
| 39 | except ImportError: |
|---|
| 40 | from trac.util.translation import gettext, ngettext |
|---|
| 41 | _, N_, tag_ = gettext, gettext, None |
|---|
| 42 | def add_domain(a,b,c=None): |
|---|
| 43 | pass |
|---|
| 44 | i18n_enabled = False |
|---|
| 45 | |
|---|
| 46 | # Import tracs `N_` as `T_` to mark strings already translated by trac. |
|---|
| 47 | # Note: Later this might also be needed for `_`. |
|---|
| 48 | try: |
|---|
| 49 | from trac.util.translation import N_ as T_ |
|---|
| 50 | from trac.util.translation import _ as t_ |
|---|
| 51 | except: |
|---|
| 52 | T_ = N_ |
|---|
| 53 | t_ = _ |
|---|
| 54 | |
|---|
| 55 | # EOF |
|---|