core: i18n refactoring:
- _() is no more installed in __builtin__
- instead, there is a new sat.core.i18n module
- added D_() method for deferred translation
- languageSwitch method allow to dynamically change translation language
- import gettext is tested against ImportError, and dummy methods are used when not available (mainly useful for Libervia)
This commit is contained in:
parent
5b623dbb5c
commit
5a00dc9503
28 changed files with 123 additions and 19 deletions
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
from bridge_frontend import BridgeFrontend
|
||||
import dbus
|
||||
from logging import debug, error
|
||||
|
|
|
|||
|
|
@ -18,10 +18,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
try:
|
||||
_("dummy")
|
||||
except: # libervia doesn't allow to explicit the exception here
|
||||
_ = lambda text: text
|
||||
from sat.core.i18n import _
|
||||
|
||||
try:
|
||||
from collections import OrderedDict # only available from python 2.7
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import with_statement
|
||||
from sat.core.i18n import _
|
||||
|
||||
#consts
|
||||
name = u"jp"
|
||||
|
|
@ -44,9 +45,6 @@ logging.basicConfig(level=logging.DEBUG,
|
|||
format='%(message)s')
|
||||
###
|
||||
|
||||
import gettext
|
||||
gettext.install('jp', unicode=True)
|
||||
|
||||
import sys
|
||||
import os
|
||||
from os.path import abspath, basename, dirname
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
import urwid
|
||||
from urwid_satext import sat_widgets
|
||||
from sat_frontends.tools.games import TarotCard
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
import urwid
|
||||
from urwid_satext import sat_widgets
|
||||
from urwid_satext.files_management import FileDialog
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
import urwid
|
||||
from urwid_satext import sat_widgets
|
||||
from sat_frontends.quick_frontend.quick_contact_list import QuickContactList
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
import urwid
|
||||
from urwid_satext import sat_widgets
|
||||
from sat_frontends.quick_frontend.quick_gateways import QuickGatewaysManager
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from sat.core.i18n import _
|
||||
import urwid
|
||||
from urwid_satext import sat_widgets
|
||||
from urwid_satext.files_management import FileDialog
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
import urwid
|
||||
from urwid_satext.sat_widgets import AdvancedEdit,Password,List,InputDialog,ConfirmDialog,Alert,FocusFrame
|
||||
from sat.tools.jid import JID
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
import urwid
|
||||
from urwid_satext import sat_widgets
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
import urwid
|
||||
import copy
|
||||
from urwid_satext import sat_widgets
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
import urwid
|
||||
from urwid_satext import sat_widgets
|
||||
from logging import debug, info, warning, error
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
import sys
|
||||
from logging import debug, info, warning, error
|
||||
from sat.tools.jid import JID
|
||||
|
|
@ -27,9 +28,6 @@ from optparse import OptionParser
|
|||
|
||||
from sat_frontends.quick_frontend.constants import Const
|
||||
|
||||
import gettext
|
||||
gettext.install('sat_frontend', unicode=True)
|
||||
|
||||
class QuickApp(object):
|
||||
"""This class contain the main methods needed for the frontend"""
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
from logging import debug, info, warning, error
|
||||
from sat.tools.jid import JID
|
||||
from sat_frontends.quick_frontend.quick_utils import unescapePrivate
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
from logging import debug
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
from logging import debug, info, warning, error
|
||||
from sat.tools.jid import JID
|
||||
import pdb
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
|
||||
|
||||
from sat.core.i18n import _
|
||||
class QuickGatewaysManager(object):
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
|
||||
|
||||
from sat.core.i18n import _
|
||||
import wx
|
||||
import os.path, glob
|
||||
import pdb
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
|
||||
|
||||
from sat.core.i18n import _
|
||||
import wx
|
||||
import os.path
|
||||
import time
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _
|
||||
import sys
|
||||
import os.path
|
||||
import gettext
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue