split out translation support into an separate file so it can be more correctly included everywhere
This commit is contained in:
parent
841fa18c58
commit
b0302e6fab
11
terminator
11
terminator
|
@ -22,18 +22,9 @@
|
||||||
import os, sys
|
import os, sys
|
||||||
from optparse import OptionParser, SUPPRESS_HELP
|
from optparse import OptionParser, SUPPRESS_HELP
|
||||||
|
|
||||||
|
import terminatorlib.translation
|
||||||
from terminatorlib.version import APP_NAME, APP_VERSION
|
from terminatorlib.version import APP_NAME, APP_VERSION
|
||||||
|
|
||||||
try:
|
|
||||||
import gettext
|
|
||||||
gettext.install (APP_NAME)
|
|
||||||
except ImportError:
|
|
||||||
import __builtin__
|
|
||||||
def dummytrans (text):
|
|
||||||
"""A _ function for systems without gettext. Effectively a NOOP"""
|
|
||||||
return text
|
|
||||||
__builtin__.__dict__['_'] = dummytrans
|
|
||||||
|
|
||||||
from terminatorlib.config import dbg, err, debug
|
from terminatorlib.config import dbg, err, debug
|
||||||
import terminatorlib.config
|
import terminatorlib.config
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# Terminator - multiple gnome terminals in one window
|
||||||
|
# Copyright (C) 2006-2008 cmsj@tenshu.net
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, version 2 only.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
"""Terminator by Chris Jones <cmsj@tenshu.net>"""
|
||||||
|
|
|
@ -40,6 +40,8 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
gconf = None
|
gconf = None
|
||||||
|
|
||||||
|
from terminatorlib import translation
|
||||||
|
|
||||||
# set this to true to enable debugging output
|
# set this to true to enable debugging output
|
||||||
# These should be moved somewhere better.
|
# These should be moved somewhere better.
|
||||||
debug = False
|
debug = False
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from terminatorlib.config import dbg, debug
|
from terminatorlib.config import dbg, debug
|
||||||
|
from terminatorlib import translation
|
||||||
|
|
||||||
def group(*choices): return '(' + '|'.join(choices) + ')'
|
def group(*choices): return '(' + '|'.join(choices) + ')'
|
||||||
def any(*choices): return group(*choices) + '*'
|
def any(*choices): return group(*choices) + '*'
|
||||||
|
|
|
@ -23,6 +23,8 @@ This list is taken from gnome-terminal's src/encoding.h
|
||||||
and src/encoding.c
|
and src/encoding.c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from terminatorlib import translation
|
||||||
|
|
||||||
class TerminatorEncoding:
|
class TerminatorEncoding:
|
||||||
"""Class to store encoding details"""
|
"""Class to store encoding details"""
|
||||||
encodings = [
|
encodings = [
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
from terminatorlib.config import dbg,err,Defaults,TerminatorConfValuestoreRC
|
from terminatorlib.config import dbg,err,Defaults,TerminatorConfValuestoreRC
|
||||||
from terminatorlib.keybindings import TerminatorKeybindings,Modifier
|
from terminatorlib.keybindings import TerminatorKeybindings,Modifier
|
||||||
from terminatorlib.version import APP_NAME, APP_VERSION
|
from terminatorlib.version import APP_NAME, APP_VERSION
|
||||||
|
from terminatorlib import translation
|
||||||
|
|
||||||
import gtk, gobject
|
import gtk, gobject
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ from config import dbg, err, debug
|
||||||
from terminatorlib.keybindings import TerminatorKeybindings
|
from terminatorlib.keybindings import TerminatorKeybindings
|
||||||
from terminatorlib.terminatorterm import TerminatorTerm
|
from terminatorlib.terminatorterm import TerminatorTerm
|
||||||
from terminatorlib.prefs_profile import ProfileEditor
|
from terminatorlib.prefs_profile import ProfileEditor
|
||||||
|
from terminatorlib import translation
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import deskbar.core.keybinder as bindkey
|
import deskbar.core.keybinder as bindkey
|
||||||
|
|
|
@ -31,6 +31,9 @@ from terminatorlib.config import dbg, err, debug
|
||||||
#import encoding list
|
#import encoding list
|
||||||
from terminatorlib.encoding import TerminatorEncoding
|
from terminatorlib.encoding import TerminatorEncoding
|
||||||
|
|
||||||
|
# import translation support
|
||||||
|
from terminatorlib import translation
|
||||||
|
|
||||||
# import vte-bindings
|
# import vte-bindings
|
||||||
try:
|
try:
|
||||||
import vte
|
import vte
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# Terminator - multiple gnome terminals in one window
|
||||||
|
# Copyright (C) 2006-2008 cmsj@tenshu.net
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, version 2 only.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
"""Terminator by Chris Jones <cmsj@tenshu.net>"""
|
||||||
|
|
||||||
|
from terminatorlib.version import APP_NAME
|
||||||
|
|
||||||
|
try:
|
||||||
|
import gettext
|
||||||
|
gettext.install (APP_NAME)
|
||||||
|
except ImportError:
|
||||||
|
print "Using fallback _()"
|
||||||
|
import __builtin__
|
||||||
|
def dummytrans (text):
|
||||||
|
"""A _ function for systems without gettext. Effectively a NOOP"""
|
||||||
|
return text
|
||||||
|
__builtin__.__dict__['_'] = dummytrans
|
||||||
|
|
Loading…
Reference in New Issue