Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Marie Traissard <jim@lapin.org>2007-01-15 02:04:29 +0300
committerJean-Marie Traissard <jim@lapin.org>2007-01-15 02:04:29 +0300
commit14f432fcd741e93424c4bc9f15ae9d7fc891df97 (patch)
tree4d3022ff67736d21ee8c24e2b4a3f8d6ee54756c /src
parent83017005010e98da8e334f89e4bef78688232b8b (diff)
Make 'True', 'False' and Types translatables in ACE
Diffstat (limited to 'src')
-rw-r--r--src/advanced.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/advanced.py b/src/advanced.py
index 0640c02d7..f87680a55 100644
--- a/src/advanced.py
+++ b/src/advanced.py
@@ -46,6 +46,14 @@ class AdvancedConfigurationWindow(object):
# key = option name (root/subopt/opt separated by \n then)
# value = array(oldval, newval)
self.changed_opts = {}
+
+ # For i18n
+ self.right_true_dict = {True: _('True'), False: _('False')}
+ self.types = {
+ 'boolean': _('Boolean'),
+ 'integer': _('Integer'),
+ 'string': _('Text'),
+ 'color': _('Color')}
treeview = self.xml.get_widget('advanced_treeview')
self.model = gtk.TreeStore(str, str, str)
@@ -91,7 +99,8 @@ class AdvancedConfigurationWindow(object):
make the cellrenderertext not editable else it's editable'''
optname = model[iter][C_PREFNAME]
opttype = model[iter][C_TYPE]
- if opttype == 'boolean' or optname in ('password', 'gpgpassword'):
+ if opttype == self.types['boolean'] or optname in ('password',
+ 'gpgpassword'):
cell.set_property('editable', False)
else:
cell.set_property('editable', True)
@@ -137,8 +146,11 @@ class AdvancedConfigurationWindow(object):
modelpath = self.modelfilter.convert_path_to_child_path(path)
modelrow = self.model[modelpath]
option = modelrow[0].decode('utf-8')
- if modelrow[2] == 'boolean':
- newval = {'False': 'True', 'True': 'False'}[modelrow[1]]
+ if modelrow[2] == self.types['boolean']:
+ for key in self.right_true_dict.keys():
+ if self.right_true_dict[key] == modelrow[1]:
+ modelrow[1] = key
+ newval = {'False': True, 'True': False}[modelrow[1]]
if len(modelpath) > 1:
optnamerow = self.model[modelpath[0]]
optname = optnamerow[0].decode('utf-8')
@@ -152,7 +164,7 @@ class AdvancedConfigurationWindow(object):
self.remember_option(option, modelrow[1], newval)
gajim.config.set(option, newval)
gajim.interface.save_config()
- modelrow[1] = newval
+ modelrow[1] = self.right_true_dict[newval]
self.check_for_restart()
def check_for_restart(self):
@@ -221,10 +233,13 @@ class AdvancedConfigurationWindow(object):
type = ''
if val[OPT_TYPE]:
type = val[OPT_TYPE][0]
+ type = self.types[type] # i18n
value = val[OPT_VAL]
if name in ('password', 'gpgpassword'):
#we talk about password
value = _('Hidden') # override passwords with this string
+ if value in self.right_true_dict:
+ value = self.right_true_dict[value]
model.append(iter, [name, value, type])
def visible_func(self, model, iter):